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 trilliantrader, 04-18-2024, 08:16 AM
        5 responses
        22 views
        0 likes
        Last Post trilliantrader  
        Started by Davidtowleii, Today, 12:15 AM
        0 responses
        3 views
        0 likes
        Last Post Davidtowleii  
        Started by guillembm, Yesterday, 11:25 AM
        2 responses
        9 views
        0 likes
        Last Post guillembm  
        Started by junkone, 04-21-2024, 07:17 AM
        9 responses
        68 views
        0 likes
        Last Post jeronymite  
        Started by mgco4you, Yesterday, 09:46 PM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Working...
        X