Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 md4866, 05-01-2024, 08:15 PM
      2 responses
      18 views
      0 likes
      Last Post md4866
      by md4866
       
      Started by samish18, Today, 12:20 PM
      0 responses
      7 views
      0 likes
      Last Post samish18  
      Started by thread, 04-15-2024, 11:58 PM
      3 responses
      48 views
      0 likes
      Last Post Georg1o
      by Georg1o
       
      Started by leojimenezp, 04-20-2024, 05:49 PM
      4 responses
      50 views
      0 likes
      Last Post leojimenezp  
      Started by nicthe, Today, 09:24 AM
      1 response
      8 views
      0 likes
      Last Post nicthe
      by nicthe
       
      Working...
      X