Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

STRATEGY CANCELS ExitLongLimit ORDER AFTER ENTRY SUBMIT

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

    STRATEGY CANCELS ExitLongLimit ORDER AFTER ENTRY SUBMIT

    Hello Ninjatrader Team!

    am developing a strategy for RENKOBARS 10/5 in which the entry is made when the price breaks the ParabolicSAR indicator, buying above and selling below. The Stop is set with a limit order which trails as the indicator moves. Additionally, a Fibonacci retracement is drawn in the space between the upper and lower ParabolicSAR (see image). Finally, the Profit has been calculated at Fibonacci levels of 25% and 61.8% (2 contracts) OR 61.8% and 100% (defined by user) **Here im havingsome problems too, when I change the FIBO level Profit it only submits 1 contract... WHY???.

    I am having difficulties here as initially the profit orders were executed without any problem, but after fixing and properly configuring the Stop, the profit orders (ExitLongLimit) disappear 1 second after the order is executed... leaving the Stop trailing without any profit order for the two contracts. Attached you can find the code I have created, with various Stop options (ParabolicSAR/Supertrend/Swing), as well as entry options (SAR/MOMENTUM/MA).

    Please, can you help me find the error that is causing the immediate closure of these operations? I attach images of the configuration and how the strategy would look in LONG.

    On the other hand, I want to set up a new variable (BOOL) whereby the stop remains still when entering at the ParabolicSAR price (beginning the entry without trailing). How can I do this?

    And finally, is it possible to include a Sell order with double the selected contracts after hitting a Buy stop, so that if the entry in LONG hits the Stop... a Sell entry with double the contracts is executed to recover the position.

    Thanks a lot!!!


    #2
    Hello tradingnasdaqprueba,

    From the code provided one problem is that you cannot submit a exit order at the same time as the entry is being submitted, you need to wait until you are in a position before submitting the exit order.

    If your other orders are being cancelled they are likely being expired, your condition to submit the exit orders needs to remain true until filled. You can use TraceOrders to check if they are being expired.



    For your other questions I would suggest making a seperate post for each question and extract just the logic for the order you wanted to control so we can isolate just to that part of the script with your questions.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    54 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    130 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    72 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    44 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    49 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X