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

Calculate Closes[1][0] historicall

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

    Calculate Closes[1][0] historicall

    Hello. I'm trying to calculate diffirence between Close price of one series and Close price of the seconday series (f.e. GC 02-20 and GC 04-20).
    When I'm setting

    Value[0] = Closes[1][0] - Closes[0][0];

    It calculates me only in real-time. On historicall period via Print(Value[0]); I see that Close prices are the same as primary Series.
    How can I resolve this problem? And one more thing:
    I saw in real-time that first Setting (via print) shows the current Closes[0][0] and then, in some seconds it changes to the value of secondary series.

    Help please.

    #2
    Hello YevhenShynkarenko,

    Thanks for your post.

    Merge Policy will merge previous contract month data to the current contract month. GC 04-20 is set to roll on 01/29/2020 so any data before then would be merged from the previous contract month. This would result in the historical data resulting in a 0 comparison and then the realtime data updating with the data from those contract periods.

    If you set Merge Policy to Do Not Merge, you should be able better see the differentiation on separate charts and see how realtime and historical get their result from your indicator. To move forward with your goal, I may suggest cloning the instrument, and then adjusting the rollover periods so you can compare more current data on the future contract month with the older contract month.

    Merge Policy - https://ninjatrader.com/support/help...rge_policy.htm

    Editing Instruments - https://ninjatrader.com/support/help...nstruments.htm

    Please let me know if I can be of further assistance.
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by wzgy0920, Yesterday, 09:53 PM
    2 responses
    49 views
    0 likes
    Last Post wzgy0920  
    Started by Kensonprib, 04-28-2021, 10:11 AM
    5 responses
    191 views
    0 likes
    Last Post Hasadafa  
    Started by GussJ, 03-04-2020, 03:11 PM
    11 responses
    3,230 views
    0 likes
    Last Post xiinteractive  
    Started by andrewtrades, Today, 04:57 PM
    1 response
    14 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by chbruno, Today, 04:10 PM
    0 responses
    7 views
    0 likes
    Last Post chbruno
    by chbruno
     
    Working...
    X