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

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.

    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by rbeckmann05, Yesterday, 06:48 PM
    1 response
    12 views
    0 likes
    Last Post bltdavid  
    Started by llanqui, Today, 03:53 AM
    0 responses
    6 views
    0 likes
    Last Post llanqui
    by llanqui
     
    Started by burtoninlondon, Today, 12:38 AM
    0 responses
    10 views
    0 likes
    Last Post burtoninlondon  
    Started by AaronKoRn, Yesterday, 09:49 PM
    0 responses
    15 views
    0 likes
    Last Post AaronKoRn  
    Started by carnitron, Yesterday, 08:42 PM
    0 responses
    11 views
    0 likes
    Last Post carnitron  
    Working...
    X