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

OnConnectionStatusUpdate

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

    OnConnectionStatusUpdate

    Two questions regarding OnConnectionStatusUpdate:

    1. In backtest (historic state), is there a way to simulate / reproduce a connection loss and re-connect ?

    2. Within the OnConnectionStatusUpdate, suppose I use ReloadAllHistoricalData() as follows:

    protected override void OnConnectionStatusUpdate(ConnectionStatusEventArgs connectionStatusUpdate)
    {
    if (connectionStatusUpdate.Status == ConnectionStatus.ConnectionLost)
    {
    IsReloadAllHistoricalDataNeeded = true;
    }
    else if (IsReloadAllHistoricalDataNeeded && connectionStatusUpdate.Status == ConnectionStatus.Connected)
    {
    ReloadAllHistoricalData();
    IsReloadAllHistoricalDataNeeded = false;
    }
    }

    Would NT also buy / sell positions to bring the strategy's positions to be in line with the expected strategy positions as if there was no connection loss?


    #2
    Hello uday12,

    Thanks for your post.

    I am not aware of a way to simulate connection loss in a backtest. Perhaps others in the community might and they are of course welcome to contribute.

    Reloading all historical data will also cause your strategy to be reloaded so it would react according to how you have configured syncing options to your account, reference: https://ninjatrader.com/support/help..._positions.htm
    Paul H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Waxavi, Today, 02:10 AM
    0 responses
    6 views
    0 likes
    Last Post Waxavi
    by Waxavi
     
    Started by TradeForge, Today, 02:09 AM
    0 responses
    11 views
    0 likes
    Last Post TradeForge  
    Started by Waxavi, Today, 02:00 AM
    0 responses
    2 views
    0 likes
    Last Post Waxavi
    by Waxavi
     
    Started by elirion, Today, 01:36 AM
    0 responses
    4 views
    0 likes
    Last Post elirion
    by elirion
     
    Started by gentlebenthebear, Today, 01:30 AM
    0 responses
    5 views
    0 likes
    Last Post gentlebenthebear  
    Working...
    X