• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Setting Environment Variables for backtest

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

    Setting Environment Variables for backtest

    Hey guys how do U set these parameters from within a strategy for backtesting? I need the actual code. i'm sure it goes in the initialize.

    max bars lookback = infinite
    exit on close= false
    time in force=day

    Thanks

    #2
    Hello elitetradenyc,

    All these can be found in our Help Guide, TimeInForce, ExitOnClose, MaximumBarsLookBack.

    Code:
    protected override void Initialize() 
    {
        // Store all series values instead of only the last 256 values
        MaximumBarsLookBack = MaximumBarsLookBack.Infinite;
        ExitOnClose = false;
        TimeInForce = Cbi.TimeInForce.Day;
    }
    JCNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by RtelTrade, Today, 01:27 PM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by RolloHarper, Today, 12:59 PM
    2 responses
    12 views
    0 likes
    Last Post NinjaTrader_Jermaine  
    Started by tvaughan4, Today, 01:02 PM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_PaulH  
    Started by NinjaTrader_Brandon, Today, 01:19 PM
    0 responses
    11 views
    0 likes
    Last Post NinjaTrader_Brandon  
    Started by nedstrader, Today, 01:01 PM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_PaulH  
    Working...
    X