• 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

Running strategy the most efficient way as possible

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

    Running strategy the most efficient way as possible

    I noticed every time that I enable a strategy, the strategy execution logic uses the active connection and gets the data every time, regardless if the time period does not change. I can see in the Strategies tab within Control Center in the column Connection how the value changes once I enable the strategy using the Enabled column checkbox. It starts by displaying the active connection (I assume that it uses the connection to download the data) and by the time it begins processing the historical data the Connection column changes to Loading... Once it reaches Loading, the strategy execution is fast.

    If the information has been downloaded from running the strategy before, how can I prevent from downloading the information every time I enable the strategy?

    Is the solution to disable the "Get data from server" Market Data Option after I have executed the strategy at least one time?
    Is this the best/most efficient way to execute a strategy once the data is in my system?

    As a different but related question, how can a run strategy and tell it not to process historical information and only execute in real-time only? For this I assume that I have an active life connection.

    Thanks

    #2
    Hello GARZONJ, Thanks for your post.

    NinjaTrader runs your strategy logic for every bar on the chart when enabled, it does not download new historical data every time you enable a strategy. It will download any data that is missing though. If you want to backtest the strategy in the strategy analyzer on historical data, disconnect from your data provider and the historical run will work with the cached historical data

    In a strategy you can add this to the beginning of OnBarUpdate to ignore the historical data run:

    if(State == State.Historical)
    return;

    Kind regards.
    Chris L.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by edmata1109, Yesterday, 10:36 PM
    0 responses
    5 views
    0 likes
    Last Post edmata1109  
    Started by StevenNelson, 10-11-2019, 05:51 AM
    2 responses
    14 views
    0 likes
    Last Post ManIp
    by ManIp
     
    Started by TazoTodua, Yesterday, 12:29 PM
    2 responses
    24 views
    0 likes
    Last Post TazoTodua  
    Started by sdauteuil, Yesterday, 03:16 PM
    0 responses
    8 views
    0 likes
    Last Post sdauteuil  
    Started by Zenersev, Yesterday, 02:11 PM
    0 responses
    5 views
    0 likes
    Last Post Zenersev  
    Working...
    X