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 geddyisodin, Today, 05:20 AM
      0 responses
      1 view
      0 likes
      Last Post geddyisodin  
      Started by JonesJoker, 04-22-2024, 12:23 PM
      6 responses
      32 views
      0 likes
      Last Post JonesJoker  
      Started by GussJ, 03-04-2020, 03:11 PM
      12 responses
      3,239 views
      0 likes
      Last Post Leafcutter  
      Started by AveryFlynn, Today, 04:57 AM
      0 responses
      5 views
      0 likes
      Last Post AveryFlynn  
      Started by RubenCazorla, 08-30-2022, 06:36 AM
      3 responses
      79 views
      0 likes
      Last Post PaulMohn  
      Working...
      X