Hi i'am new to the community, but already on reading this forum for 7 month's. I like amibroker but my ideas go further than my coding knowledge. So thanks for all the helpfull stuff.
I have a question.
I would like to display shapedigit1 through 9 in the chart on each bar if there is a positive trend, for wich the condition is close>ref(close,-4) is true. this on a weekly timeframe. So if this is true in week 1 then shapedigit1 is displayed on the bar and if this is true on the next week shapedigit2 is displayed on the next bar and so on until 9. After nine times the counter is back to zero and the counting can start again as long as the trend is positive.
I have already read en tried a lot. Iám getting close, but i don't get this working.
Who is willing to help me ?
Kind regards from the Netherlands,
Roel
//swingcounter code
trend=1
s=0;
for(i=0; i<barcount; i++);
{
s=0;
while (s<10)
{
s=s+s;
IIf(Close>Ref(Close,-4) AND trend==1,s=1,s=11);
IIf(s==1,PlotShapes(shapeDigit1,colorWhite,layer=0,yposition=Graph0,offset=-0,xshift=0),PlotShapes(shapeNone,colorAqua,layer=0,yposition=Graph0,offset=-12,xshift=0));
IIf(s==2,PlotShapes(shapeDigit2,colorWhite,layer=0,yposition=Graph0,offset=-10,xshift=0),PlotShapes(shapeNone,colorAqua,layer=0,yposition=Graph0,offset=-12,xshift=0));
}
}
s=0;
The code above plots a shapedigit1 and shapedigit2 on every bar in positieve and negative trend. Negative trend = 0