Author Topic: Afl error. pls help  (Read 2006 times)

srameash

  • Newbie
  • *
  • Posts: 1
    • View Profile
Afl error. pls help
« on: January 22, 2016, 06:23:54 am »
I m stuck  with the below code.  the highs should be plotted with Green square boxes, but after the first box in green, other boxes color becomes Red. mysteriously if we click on the chart then red boxes at highs becomes green each with one click. what I want is with higher high all the boxes in green . Lows are correctly plotted with all red boxes. pls help.
 _SECTION_BEGIN("MA5");
 UpTrend=StaticVarGet("StaticUpTrend");
 //Plot(C,"",colorBlue,64);
 
 MA5=MA(C,5);
 Plot(MA5,"",colorAqua,styleDashed);
 //FINDING PEAK
 TOP1=(Ref(MA5,-1)>Ref(MA5,0) //RIGHT SIDE
   AND Ref(MA5,-1)>Ref(MA5,-2));//LEFT SIDE
 
 MA5_HValue =  ValueWhen(TOP1,MA5,1);
 UpTrend=IIf(Ref(MA5_HValue,0)>Ref(MA5_HValue,-1),True,
       IIf(Ref(MA5_HValue,0)==Ref(MA5_HValue,-1), Ref(UpTrend,-1),False)   );
 Vcolor1=IIf(UpTrend,colorGreen,colorRed);
PlotShapes(shapeSmallCircle,Vcolor1,0,MA5_HValue,0,0);//Red OR Green
StaticVarSet("StaticUpTrend",UpTrend);
_SECTION_END();

EddieSvop

  • Newbie
  • *
  • Posts: 12
    • View Profile
    • This is the topic
Afl error pls help
« Reply #1 on: June 08, 2019, 09:11:43 pm »
There is lots of help available, but you need to ask more specific questions.

What parts of the model do you need help with?