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 sjsj2732, 03-23-2026, 04:31 AM
      0 responses
      43 views
      0 likes
      Last Post sjsj2732  
      Started by NullPointStrategies, 03-13-2026, 05:17 AM
      0 responses
      295 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      290 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      135 views
      1 like
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      98 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Working...
      X