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 Hwop38, 05-04-2026, 07:02 PM
      0 responses
      169 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      326 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      252 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      353 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      180 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Working...
      X