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 Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      601 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      347 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      103 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      559 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      558 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X