• 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 Teebone21, Today, 05:03 PM
    1 response
    3 views
    0 likes
    Last Post Teebone21  
    Started by gbulle, Today, 01:17 PM
    4 responses
    14 views
    0 likes
    Last Post gbulle
    by gbulle
     
    Started by CougarMountain, Today, 03:55 PM
    0 responses
    4 views
    0 likes
    Last Post CougarMountain  
    Started by syxforex, Today, 01:13 PM
    3 responses
    13 views
    0 likes
    Last Post NinjaTrader_PaulH  
    Started by pjsmith, Today, 01:17 PM
    2 responses
    6 views
    0 likes
    Last Post pjsmith
    by pjsmith
     
    Working...
    X