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

Plotting weekly RSI on daily strategy

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

    Plotting weekly RSI on daily strategy

    Hi there,
    I'm working on strategy and I would like to plot the weekly RSI on my strategy that used a primairy daily data series.
    I've added the secondairy dataseries (weekly) and I used this on the RSI.
    If I plot the weekly RSI in my strategy, it starts plotting at the same moment as the other indicators which use daily data. This results in the weekly rsi stopping to plot after some time.
    I think I know the problem and that is that the weekly RSI starts plotting after 20 bars from the daily data however it should start plotting after 20 bars weekly data (So 140 bars daily data).
    How can I fix this ?

    #2
    Hello SebastiaanR,

    If you are wanting to use an indicator with a higher time frame and be able to have this plot on the chart with AddChartIndicator() it would be necessary to use AddDataSeries() and change the code internally in (a copy of) the indicator to use that added series.

    Below is a link to an example.
    https://ninjatrader.com/support/foru...196#post820196

    When adding series, all series will need to have data before OnBarUpdate starts to run for any series, but once OnBarUpdate is run once the data is there and the script will continue processing data for every bar update of every series in the script (unless it hits a run time error and disables).

    Use prints to understand what data is updating by printing the time of the bar and BarsInProgress.
    Below is a link to a forum post that demonstrates using prints to understand behavior.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello ChelseaB,

      Thank you for your answer !
      Just to clarify, this answer is for plotting the indicator. So let's say I dont plot the indicator but just use the values of it in my strategy. Are these values corresponding correctly ? Or do I still have to add the higher timeframe internally in the indicator to make sure that the actual values are correct to use in a strategy ?

      Regards,
      Sebastiaan

      Comment


        #4
        Hello Sebastiaan,

        An indicator does not have to be added to a chart to use the plot values in a host script. The indicator would still need to set plot values however.

        Using AddChartIndicator() does not change the values of an indicator. The values will be the same whether it is or is not added to the chart as the plot values are set by processing data.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by TraderBCL, Today, 04:38 AM
        1 response
        4 views
        0 likes
        Last Post bltdavid  
        Started by martin70, 03-24-2023, 04:58 AM
        14 responses
        105 views
        0 likes
        Last Post martin70  
        Started by Radano, 06-10-2021, 01:40 AM
        19 responses
        606 views
        0 likes
        Last Post Radano
        by Radano
         
        Started by KenneGaray, Today, 03:48 AM
        0 responses
        4 views
        0 likes
        Last Post KenneGaray  
        Started by thanajo, 05-04-2021, 02:11 AM
        4 responses
        470 views
        0 likes
        Last Post tradingnasdaqprueba  
        Working...
        X