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

TP/SL is not working often

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

    TP/SL is not working often

    Hi,

    is there any possibility to working TP/SL intermittently (it was set currency , ex:60$)?
    Last edited by bosajin; 07-15-2020, 01:46 PM.

    #2
    Hello bosajin,

    Thanks for your post.

    If you are calling SetProfitTarget/SetStopLoss in OnBarUpdate, the methods must be called when the strategy is flat, before the entry order is submitted. Please follow the example below when doing so.

    SamplePriceModification - https://ninjatrader.com/support/help...of_stop_lo.htm

    If the Currency that is used for the order results in an order level that is less than one tick from the average entry price, this can result in an invalid order submission that would be ignored.

    If you increase the Currency value used, do you see this behavior?

    When you test with TraceOrders enabled, do you see any feedback for the stop/target submission?

    TraceOrders - https://ninjatrader.com/support/help...aceorders2.htm

    I look forward to assisting.
    JimNinjaTrader Customer Service

    Comment


      #3
      This answer makes no sense. You say "If you are calling SetProfitTarget/SetStopLoss in OnBarUpdate, the methods must be called when the strategy is flat, before the entry order is submitted. Please follow the example below when doing so." Then you give a link to a documentation page with an example. In that example, it calls SetStopLoss in two places, one place where we are flat and the other where we are in a LONG position. The fact that the example calls SetStopLoss when in a long position contradicts the statement that the methods must be called when flat.

      Can someone at NT support please clarify this and state explicitly when and how you must call SetStopLoss and SetTakeProfit when submitting an order? The vast majority of us want to do this at the time the order is submitted, and we want the freedom to set these dynamically. The documentation on this is very sketchy. Please clarify.

      Comment


        #4
        Hello westofpluto,

        Set methods prep NinjaTrader to submit target and stop loss order when an associated entry order is seen as filled. They should be submitted before the associated entry method is submitted.

        You can call Set methods when the strategy is in a long position to move the stop loss or profit target, but if the Set method is not called before the associated entry order, then NinjaTrader will submit target/stop to the last level that was set when the Set method was called. This can mean that when your entry order fills, the target and stop are submitted to previous levels which may be invalid. The order submission for the target/stop can then be ignored or rejected.

        Therefore, it is suggested to reset your target/stop to initial levels when the strategy is flat, before the next entry is made. Or if you are scaling in to an existing position, to ensure that the Set methods associated with the new entry are called before that entry method is called.
        JimNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Radano, 06-10-2021, 01:40 AM
        19 responses
        606 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
        470 views
        0 likes
        Last Post tradingnasdaqprueba  
        Started by aa731, Today, 02:54 AM
        0 responses
        5 views
        0 likes
        Last Post aa731
        by aa731
         
        Started by Christopher_R, Today, 12:29 AM
        0 responses
        11 views
        0 likes
        Last Post Christopher_R  
        Working...
        X