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 fx.practic, 10-15-2013, 12:53 AM
        5 responses
        5,404 views
        0 likes
        Last Post Bidder
        by Bidder
         
        Started by Shai Samuel, 07-02-2022, 02:46 PM
        4 responses
        95 views
        0 likes
        Last Post Bidder
        by Bidder
         
        Started by DJ888, Yesterday, 10:57 PM
        0 responses
        8 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by MacDad, 02-25-2024, 11:48 PM
        7 responses
        159 views
        0 likes
        Last Post loganjarosz123  
        Started by Belfortbucks, Yesterday, 09:29 PM
        0 responses
        8 views
        0 likes
        Last Post Belfortbucks  
        Working...
        X