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

Indicator scale

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

    Indicator scale

    Hello,

    I'm currently making a strategy with a dynamic RSI. This is the RSI combined with the bollinger bands.
    When I create a chart and add both indicators to the plot I can see that the scales are the same for both. I selected this manually in the indicator tab in visual. As u can see in the first image, both scales are the same and the goal would be to buy when the rsi comes back into the bands.
    Now when I program this in a strategy I find that the scales are not the same. U can see this is in 2nd image. This results in the strategy not buying on the right moment. How can I fix this ?

    Greetings,
    Sebastiaan

    #2
    Hello SebastiaanR,

    Thanks for your post.

    Regardless of the scales, the strategy will work with the mathematical values of the indicators so if it is not trading at the correct times then you may need to debug your code to determrine the values that are being used. Here is a link to our debugging tips: https://ninjatrader.com/support/help...script_cod.htm

    To have the startegy add both indicators to the same panel and use the same scale you can specify this in State.dataLoaded for example:

    Code:
                else if (State == State.DataLoaded)
                {
                    myB = Bollinger(RSI(14,3), 2.25, 14);
                    myRSI = RSI(14, 3);                
                    AddChartIndicator(myB);
                    AddChartIndicator(myRSI);                
                    myB.Panel = 1;
                    myB.ScaleJustification = ScaleJustification.Right;
                    myRSI.Panel = 1;
                    myRSI.ScaleJustification = ScaleJustification.Right;                
                }
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Hi PaulH,

      Thank you !
      Unfortunately for me, the strategy was trading at the correct times so the strategy is simply not profitable

      Greetings,
      Sebastiaan

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by arvidvanstaey, Yesterday, 02:19 PM
      5 responses
      14 views
      0 likes
      Last Post NinjaTrader_Zachary  
      Started by Rapine Heihei, Yesterday, 08:25 PM
      1 response
      12 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by Mongo, Yesterday, 11:05 AM
      6 responses
      27 views
      0 likes
      Last Post Mongo
      by Mongo
       
      Started by ct, 05-07-2023, 12:31 PM
      7 responses
      206 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Started by wzgy0920, Yesterday, 09:53 PM
      1 response
      13 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Working...
      X