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

Fill limit orders on touch => realtime equivalent

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

    Fill limit orders on touch => realtime equivalent

    I am running a strategy in realtime and would like to to mimic the equivalent of the 'Fill Limit Orders on touch' functionality in backtesting in realtime.

    Currently the strategy uses the following statements in configure to set stop/targets.


    SetStopLoss(CalculationMode.Ticks, StopTicks);
    SetProfitTarget(CalculationMode.Ticks, ProfitTicks);

    Would I need to use more explicit order management such as the following (in OnExecutionUpdate) so that a position is exited as soon as a price is'touched' when the strategy is running in realtime simulation mode?

    _profitOrder = ExitLongLimit(0, true, _posSize, _profit, ProfitLong, EnterLongName);
    _stopOrder = ExitLongStopMarket(0, true, _posSize, _stop, StopLong, EnterLongName);

    #2
    Hello mballagan,

    Thank you for your reply.

    The closest thing you could do would be to use the setting Enforce Immediate Fills. This may be turned on under Tools > Options > Trading > Enforce Immediate Fills.

    Please let us know if we may be of further assistance to you.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Kate View Post
      Hello mballagan,

      Thank you for your reply.

      The closest thing you could do would be to use the setting Enforce Immediate Fills. This may be turned on under Tools > Options > Trading > Enforce Immediate Fills.

      Please let us know if we may be of further assistance to you.
      Thanks for your reply. The strategy has Calculate = Calculate.OnBarClose; When an EnterLong() or EnterShort() command is executed it appears to enter a position on the bar following the detected entry criteria. Would the Enforce Immediate Fills help in this case also?

      Comment


        #4
        Hello mballagan,

        Thank you for your reply.

        This would be the expected behavior when using Calculate.OnBarClose. When using this Calculate setting, the logic in OnBarUpdate will only run once per bar, when it closes. Consequently, any orders triggered by the bar data would be submitted when the next bar opens. Enforce immediate fills would have no effect on this.

        Please let us know if we may be of further assistance to you.
        Kate W.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by TraderBCL, Today, 04:38 AM
        2 responses
        11 views
        0 likes
        Last Post TraderBCL  
        Started by martin70, 03-24-2023, 04:58 AM
        14 responses
        105 views
        0 likes
        Last Post martin70  
        Started by Radano, 06-10-2021, 01:40 AM
        19 responses
        607 views
        0 likes
        Last Post Radano
        by Radano
         
        Started by KenneGaray, Today, 03:48 AM
        0 responses
        4 views
        0 likes
        Last Post KenneGaray  
        Started by thanajo, 05-04-2021, 02:11 AM
        4 responses
        471 views
        0 likes
        Last Post tradingnasdaqprueba  
        Working...
        X