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 aa731, Today, 02:54 AM
      0 responses
      4 views
      0 likes
      Last Post aa731
      by aa731
       
      Started by thanajo, 05-04-2021, 02:11 AM
      3 responses
      469 views
      0 likes
      Last Post tradingnasdaqprueba  
      Started by Christopher_R, Today, 12:29 AM
      0 responses
      10 views
      0 likes
      Last Post Christopher_R  
      Started by sidlercom80, 10-28-2023, 08:49 AM
      166 responses
      2,237 views
      0 likes
      Last Post sidlercom80  
      Started by thread, Yesterday, 11:58 PM
      0 responses
      4 views
      0 likes
      Last Post thread
      by thread
       
      Working...
      X