Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Issue with SetProfitTarget() order

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

    Issue with SetProfitTarget() order

    I have programmed a ninja script strategy to back test my trading method. I want to enter a trade with a stop loss and a profit target and close 1/2 position when the porfit target is reached while moving the stop loss to breakeven

    I use the SetProfitTarget() order type to set my profit target for my 1st half position.

    In the attached picture I use the following symbols.

    The blue arrow is the "set position" where the trade is entered with a "next day" order. In this case is a long trade.
    The yellow triangles are the "stop loss" prices.
    The green triangle is the "profit target" price

    The picture shows that we have reached our setup position indicated by the blue arrow, and the next day 2 orders are entered for the same quantity. When the first order (half position) reaches the profit target the stop loss price for the following day is updated to the entry price (breakeven point) as shown in the picture.

    The issue I am reporting is that in the case illustrated the first half position is closed at the profit target price even if that value was not reached in the trading day as there was a gap. I don't think this what would have happened in real time.

    Is this because the "simulated" process is not available when setting a Profit Target?

    Is there a solution to this problem?

    Thanks
    Attached Files

    #2
    Unfortunately with a gap like that there isn't a sure way to know where the order would have been filled in real trading.

    Please see the following for information about differences between historical and live trading: http://www.ninjatrader.com/support/h...ime_vs_bac.htm

    Additionally you may want to read through this: http://www.ninjatrader.com/support/h..._are_plott.htm

    If you're looking to get into more advanced order management: http://www.ninjatrader.com/support/f...ead.php?t=7499

    Let me know if I can be of further assistance.
    LanceNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by jeronymite, 04-12-2024, 04:26 PM
    3 responses
    44 views
    0 likes
    Last Post jeronymite  
    Started by Barry Milan, Yesterday, 10:35 PM
    7 responses
    20 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by AttiM, 02-14-2024, 05:20 PM
    10 responses
    179 views
    0 likes
    Last Post jeronymite  
    Started by ghoul, Today, 06:02 PM
    0 responses
    10 views
    0 likes
    Last Post ghoul
    by ghoul
     
    Started by DanielSanMartin, Yesterday, 02:37 PM
    2 responses
    13 views
    0 likes
    Last Post DanielSanMartin  
    Working...
    X