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 ghoul, Today, 06:02 PM
        0 responses
        7 views
        0 likes
        Last Post ghoul
        by ghoul
         
        Started by Barry Milan, Yesterday, 10:35 PM
        6 responses
        19 views
        0 likes
        Last Post Barry Milan  
        Started by DanielSanMartin, Yesterday, 02:37 PM
        2 responses
        13 views
        0 likes
        Last Post DanielSanMartin  
        Started by DJ888, 04-16-2024, 06:09 PM
        4 responses
        13 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by terofs, Today, 04:18 PM
        0 responses
        12 views
        0 likes
        Last Post terofs
        by terofs
         
        Working...
        X