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

Backtest-specific override method?

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

    Backtest-specific override method?

    Dear Ninja Trader,

    I'm relatively new to NT7 so this question might have been answered before:

    Is there any override method that can be called ONLY during a backtest process?

    e.g. I'm writing a FX strategy. Since contract sizes are different in simulation and a live brokerage, I want to write a fail safe code that determines if it is running in reality or backtest and therefore sets a correction factor for the contract size accordingly.

    Thanks in advance.

    #2
    Hello Arian,

    Thank you for your note.

    You can use the property Historical to check if the script is running on historical data or real-time data.

    http://www.ninjatrader.com/support/h...historical.htm
    Cal H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by bee1943, Today, 09:55 AM
    1 response
    11 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by FAQtrader, 04-25-2024, 12:00 PM
    7 responses
    101 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by giulyko00, Yesterday, 11:49 AM
    4 responses
    28 views
    0 likes
    Last Post giulyko00  
    Started by Sebastian - TwinPeaks, Yesterday, 01:31 PM
    4 responses
    26 views
    0 likes
    Last Post Sebastian - TwinPeaks  
    Started by NUVERSA, Today, 09:31 AM
    1 response
    11 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Working...
    X