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

Need help with new strategy please.

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

    #16
    Ok got it, next.

    Thanks for the explanation Jesse, pretty sure I have it now. I have been learning a lot doing this. I believe the help guide could be better on this subject though.

    Now to next hurdle. I will express to you in English what I wish to do to determine trend direction. Then if you could tell me how to express that in Ninja Script, I would be grateful.
    I want to use the ATRTrailing indicator. This indicator has 2 states, being either short or long.
    So what I wish to express is like this:

    Trend is long when ATRTrailing is long.
    Trend is short when ATRTrailing is short.

    Again in part code, part English:

    ATRTrailing _ATRTrail
    bool LongTrend, _ATRTrail is Long;
    bool ShortTrend, _ATRTrail is Short;

    I should also say that the ATRTrailing indicator is on the UniRenko chart.
    UniRenko index is [1].

    Thanks Jesse.
    Last edited by KennyK; 05-25-2017, 06:54 PM. Reason: Further thought

    Comment


      #17
      Hello,

      Thank you for the reply.

      This would depend on the output of the indicators plot, can you tell me what is the indicator currently show when you apply it? Is it a 1 or -1 as an example? Or does it have two plots in which only one of is a value at a time?

      In the case it has a single plot that has a value that fluctuates between a few states it may look like the following:

      Code:
      if(ATRTrailing(...).PlotName[0] == 1)
      {
      
      } else if(ATRTrailing(...).PlotTwo[0] == -1)
      {
      
      }

      Otherwise, if this was multiple plots it may instead look like:


      Code:
      if(ATRTrailing(...).PlotOne[0] > 0)
      {
      
      } else if(ATRTrailing(...).PlotName[0] > 0)
      {
      
      }

      I look forward to being of further assistance.
      JesseNinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Barry Milan, Yesterday, 10:35 PM
      3 responses
      10 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by WeyldFalcon, 12-10-2020, 06:48 PM
      14 responses
      1,428 views
      0 likes
      Last Post Handclap0241  
      Started by DJ888, 04-16-2024, 06:09 PM
      2 responses
      9 views
      0 likes
      Last Post DJ888
      by DJ888
       
      Started by jeronymite, 04-12-2024, 04:26 PM
      3 responses
      41 views
      0 likes
      Last Post jeronymite  
      Started by bill2023, Yesterday, 08:51 AM
      2 responses
      16 views
      0 likes
      Last Post bill2023  
      Working...
      X