[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Easy Language code assistance



PureBytes Links

Trading Reference Links

In the following snippet I insert a "V" on the chart to mark a bar that
signals a potential entry.
The mark displays fine, but one bar late.  That is, it marks the correct
bar, but the the mark does not appear until the bar of the following day is
charted.  Can anyone explain this behavior?

Regards,
Glenn Crumpley

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

 {Set flag if all conditions are met}
       if Condition1 and Signal=0 then begin

           if AlertBar=0 then begin
              AlertBar=currentbar;
          end;

           {Following code adds text identifying the AlertBar on the chart}
               Display = TRUE;
               StOffSt = 2;
               Str = "V";

               {Display text and line under text}

               if Display then begin
                  VLevel = Highest(H, StOffSt + 1) + VOffset;
                  Value4 = StOffSt/2;
                  DLine  = iff(Mod(StOffSt, 2) = 0, 2, 0);

                  Value1 = Text_New(Date[Value4],Time[Value4], VLevel, Str);
                  Value2 = Text_SetStyle(Value1,DLine,2);
                  Value2 = Text_SetColor(Value1,Tool_Yellow);

                  Value3 = TL_New(Date[StOffSt],Time[StOffSt], VLevel, Date,
Time, VLevel);
                  Value2 = TL_SetColor(Value3, Tool_Yellow);
                  Value2 = TL_SetExtLeft(Value3, FALSE);
                  Value2 = TL_SetExtRight(Value3, FALSE);
                  Value2 = TL_SetAlert(Value3,0);

                  Signal=1;
               end;
           {End of text display code}

       end;