Jump to content

Recommended Posts

Posted

multiplier indi

------------------------

 

#property indicator_chart_window

#property indicator_buffers 2

#property indicator_color1 Blue

#property indicator_color2 Red

 

double gd_76 = 2.0;

double g_ibuf_84[];

double gd_88;

double g_ibuf_96[];

double gd_100;

 

int init() {

SetIndexBuffer(0, g_ibuf_84);

SetIndexBuffer(1, g_ibuf_96);

SetIndexStyle(0, DRAW_LINE, STYLE_SOLID, 2);

SetIndexStyle(1, DRAW_LINE, STYLE_SOLID, 2);

return (0);

}

 

int start() {

string ls_0 = "2011.11.02";

int l_str2time_8 = StrToTime(ls_0);

if (TimeCurrent() >= l_str2time_8) {

Comment("Your indicator has been expired");

return (0);

}

int li_16 = Bars - IndicatorCounted() - 1;

for (int li_12 = li_16; li_12 >= 0; li_12--) {

if (Close[li_12] > gd_88 && Close[li_12] > Close[li_12 + 1]) gd_88 = g_ibuf_84[li_12 + 1] + (Close[li_12] - (g_ibuf_84[li_12 + 1])) / gd_76;

if (Close[li_12] < gd_88 && Close[li_12] < Close[li_12 + 1]) gd_88 = g_ibuf_84[li_12 + 1] + (Close[li_12] - (g_ibuf_84[li_12 + 1])) / gd_76;

if (Close[li_12] > gd_100 && Close[li_12] < Close[li_12 + 1]) gd_100 = g_ibuf_96[li_12 + 1] + (Close[li_12] - (g_ibuf_96[li_12 + 1])) / gd_76;

if (Close[li_12] < gd_100 && Close[li_12] > Close[li_12 + 1]) gd_100 = g_ibuf_96[li_12 + 1] + (Close[li_12] - (g_ibuf_96[li_12 + 1])) / gd_76;

if (li_12 > Bars - 5) {

gd_88 = Close[li_12];

gd_100 = gd_88;

}

g_ibuf_84[li_12] = gd_88;

g_ibuf_96[li_12] = gd_100;

}

return (0);

}

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...