Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ZigZag--DrawText Boolean results

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    ZigZag--DrawText Boolean results

    Hi,

    Doing some work on the ZigZag....

    Wanting to DrawText on the chart when the isOverHighDeviation and values are true...

    bool isOverHighDeviation = (deviationType == DeviationType.Percent && IsPriceGreater(highSeries[1], (lastSwingPrice * (1.0 + deviationValue * 0.01))))
    || (deviationType == DeviationType.Points && IsPriceGreater(highSeries[
    1], lastSwingPrice + deviationValue));



    // Display true/false result
    if (!isOverHighDeviation)
    {
    DrawText(
    "highDeviationTag" + CurrentBar,false,"",0,High[0] + (TickSize*3),0,Color.Blue,new Font("Arial",7,FontStyle.Regular),
    StringAlignment.Center,Color.Empty,Color.Empty,
    5);

    }
    else
    {
    DrawText(
    "highDeviationTag" + CurrentBar,false,"H T",0,High[0] + (TickSize*3),0,Color.Blue,new Font("Arial",7,FontStyle.Regular),
    StringAlignment.Center,Color.Empty,Color.Yellow,
    5);
    }


    It all works fine when I first load the indicator but doesn't continue to DrawText as the candles are land down.

    I've only added the draw text code!!

    Any ideas?

    Thanks
    Bruce


    #2
    Hi Bruce,

    ZigZag is mainly for identifying historical chart structures. It's values are redrawn as new bars come in, making it unsuitable for real time programmatic access. If you reload NinjaScript after some real time bars have been drawn, it will then recalculate over these now historical bars.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Hi Ryan,


      Must of been a glitch I had as it seems to be working ok...

      Thanks for the feedback.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      156 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      90 views
      1 like
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      138 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      130 views
      1 like
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      107 views
      0 likes
      Last Post CarlTrading  
      Working...
      X