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 TraderG23, 12-08-2023, 07:56 AM
    9 responses
    382 views
    1 like
    Last Post Gavini
    by Gavini
     
    Started by oviejo, Today, 12:28 AM
    0 responses
    1 view
    0 likes
    Last Post oviejo
    by oviejo
     
    Started by pechtri, 06-22-2023, 02:31 AM
    10 responses
    125 views
    0 likes
    Last Post Leeroy_Jenkins  
    Started by judysamnt7, 03-13-2023, 09:11 AM
    4 responses
    59 views
    0 likes
    Last Post DynamicTest  
    Started by ScottWalsh, Yesterday, 06:52 PM
    4 responses
    36 views
    0 likes
    Last Post ScottWalsh  
    Working...
    X