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

1 minute and 60 seconds chart different

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

    1 minute and 60 seconds chart different

    Hi. Why is the Heiken-Ashi 1 minute and 60 seconds chart different in the backtest? The 1 minute chart in real trading mode coincides with the 60 seconds chart on the history and does not coincide with the 1 minute chart on the history. Why is it so? I need the real 1-minute chart to coincide with the 1-minute chart on the history, and not the 60-second chart. Because of this, the strategy's results do not coincide with the history.


    #2
    Hello Kostiantyn,

    If you are comparing a heiken ashi 60 second vs a 1 minute that should be different because the 60 second chart is using 1 second data to build bars where the 1 minute chart is using 1 minute data to build bars. The 60 second chart is more granular and has more data points to utilize while building 1 minutes worth of data. In realtime you build the bars based on the incoming data instead so you should see its possibly more similar.

    If you want to compare a backtest and realtime you need to use the same data type, for example only use 1 minute or only use 60 second. Comparing 1 minute vs 60 second will yield differences.

    On a separate note heiken ashi bars are not going to be accurate for fills in historical because you are basing fills off of imaginary averaged values, in realtime the real market is used to fill orders. For more accuracy in comparing historical vs realtime while using heiken ashi you should avoid using the BarsType and instead use the indicator for heiken ashi that can be found on the public user app share. That allows the underlying bars type of actual market data to be used for fills.

    This is a corrected version of the Heiken Ashi BarsType that comes with NinjaTrader that aims to address the following issues: Values do not match rounded indicator (actual candle Open High and Low are not tracked and used in the BarsType) Realtime Close is incorrect (reloading historical data results in different results) The first bar […]

    JesseNinjaTrader Customer Service

    Comment


      #3
      Can I configure the 1 minute real-time schedule not as 60 seconds, but exactly as 1 minute without using the 60-second schedule? I need the strategy to work on a real account with the 1-minute chart, and not with the 60-second chart. Are there any settings in the terminal NinjaTrader8? I have a very good understanding of it. Thank you.

      Comment


        #4
        Hello Kostiantyn,

        If you want to use 1 minute heiken ashi bars you would select 1 minute as its source when setting up the chart. The heiken ashi bars type has selections for the type of data it uses to calculate when you apply it.


        JesseNinjaTrader Customer Service

        Comment


          #5
          Hi. I downloaded and installed Heiken-Ashi-Accurate BarsType (NT8) https://ninjatraderecosystem.com/use...-barstype-nt8/. Can you tell me how I can get the series to load in my strategy. The standard Heiken-Ashi does this:
          Code:
          protected override void OnStateChange()
          {
            if (State == State.SetDefaults)
            {
                Name = "Examples Indicator";            
            }
            else if (State == State.Configure)
            {
                // Add a 1 minute Heiken Ashi Bars object for the ES 03-18 contract - BarsInProgress index = 1
                AddHeikenAshi("ES 03-18", BarsPeriodType.Minute, 1, MarketDataType.Last);
            }
          }​
          And how do I add Heiken-Ashi-Accurate BarsType (NT8)?​

          Comment


            #6
            Hello Kostiantyn,

            You would need to use AddDataSeries for any custom bars type and specify the ID from the bars type. You can see an example of that code in the AddDataSeries help guide page under the tips:
            https://ninjatrader.com/support/help...ghtsub=adddata
            2. You can add a custom BarsType which is installed on your system by casting the registered enum value for that BarsPeriodType. For example: AddDataSeries((BarsPeriodType)14, 10);

            3. You can specify optional BarsPeriod values (such as Value2) of a custom BarsType in the BarsPeriod object initializer. For example: AddDataSeries(new BarsPeriod() { BarsPeriodType = (BarsPeriodType)14, Value = 10, Value2 = 20 });


            Because that bars type is open source you can open the file in the NinjaScript editor to find its ID in its OnStateChange override.
            JesseNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by r68cervera, Today, 05:29 AM
            0 responses
            2 views
            0 likes
            Last Post r68cervera  
            Started by geddyisodin, Today, 05:20 AM
            0 responses
            3 views
            0 likes
            Last Post geddyisodin  
            Started by JonesJoker, 04-22-2024, 12:23 PM
            6 responses
            34 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
            6 views
            0 likes
            Last Post AveryFlynn  
            Working...
            X