Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy performing differently in live mode and backtest mode

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

    Strategy performing differently in live mode and backtest mode

    I have written a strategy that calculates the number of contracts to be traded, depending on the result of the last trade. For the very first trade, it sets the number of contracts to be traded to the value of a user input parameter - InitialQuantity.

    The strategy works fine in backtest mode, but when I run it in live mode, it does not read the value from InitialQuantity, but always starts with 1 contract, and I cannot understand why. Perhaps I am misunderstanding the values that Performance.AllTrades and Performance.RealtimeTrades return.

    I have attached the code and would be gratefuul for any suggestions.
    Thanks.
    Attached Files
    Last edited by annettes; 08-24-2011, 05:03 AM. Reason: spelling errors

    #2
    annettes, are you sure the value does not get reset as you calc the needed contracts fresh on realtime data seen and thus a new trade collection to be used? Perhaps you would need to work in an intSeries for the contact sizes used, so you could refer to the last known intSeries qty before transitioning to realtime trading with it.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    152 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    89 views
    1 like
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    131 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    127 views
    1 like
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    107 views
    0 likes
    Last Post CarlTrading  
    Working...
    X