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 multi-timeframe problem

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

    Indicator multi-timeframe problem

    Hi, I am developing an indicator, when the indicator is added in 60 minutes chart, it is work well but when I overlap these results in 6 ticks range bars chart, the results are different.

    I follow the steps from this thread: https://ninjatrader.com/support/foru...ghlight=update

    And I added a secundary data series, as you can see in the next line:
    Code:
    AddDataSeries(Instrument.FullName, new BarsPeriod() { BarsPeriodType = BarsPeriodType, Value = Valor }, DaysToLoad, TradingHour, true);
    In addition, these properties were added to configure the data series.

    Code:
       [NinjaScriptProperty]
            [Display(ResourceType = typeof(Custom.Resource), Name = "Type", GroupName = "Another TimeFrame", Order = 1)]
            public BarsPeriodType BarsPeriodType
            { get; set; }
    
            [NinjaScriptProperty]
            [Display(ResourceType = typeof(Custom.Resource), Name = "Value", GroupName = "Another TimeFrame", Order = 2)]
            public int Valor
            { get; set; }
    
            [NinjaScriptProperty]
            [Display(ResourceType = typeof(Custom.Resource), Name = "Trading Hours", Order = 3, GroupName = "Another TimeFrame")]
            [TypeConverter(typeof(TradingHoursDataConverter))]
            public string TradingHour
            { get; set; }
    
            [NinjaScriptProperty]
            [Display(ResourceType = typeof(Custom.Resource), Name = "Days to Load", GroupName = "Another TimeFrame", Order = 4)]
            public int BarsToLoad
            { get; set; }

    OnBarUpdate method is configured to work in BarInProgress==1
    But the results differ between the overlapped indicator and the indicator on the chart.

    Note: When the indicator is in 60 minutes chart, OnBarUpdate method is configured to work in BarInProgress==0

    Why these results are different? And How can i solve these issues?

    Richard Martínez M.

    #2
    Hello Richardmm,

    It would be expected that if the instrument, or bar type, or interval is changed the data will be different and the results from the test will be different.

    You can find exactly what is different by using prints. Below is link to a forum post with details of how to use prints to understand the behavior of a script.


    I would be happy to assist you in understanding the meaning of prints of you add these to your script and include the output with your next post.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by andrewtrades, Today, 04:57 PM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by chbruno, Today, 04:10 PM
    0 responses
    6 views
    0 likes
    Last Post chbruno
    by chbruno
     
    Started by josh18955, 03-25-2023, 11:16 AM
    6 responses
    436 views
    0 likes
    Last Post Delerium  
    Started by FAQtrader, Today, 03:35 PM
    0 responses
    7 views
    0 likes
    Last Post FAQtrader  
    Started by rocketman7, Today, 09:41 AM
    5 responses
    19 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X