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

How can I know that a stopOrder is active ?

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

    How can I know that a stopOrder is active ?

    I wrote a strategy and I canīt put a stopOrder in the right way:
    OBS.: SCheck(Sup(), 2) is a routine to verify if Sup() is below 2 * ThickSize of GetCurrentBid(). In same way, Rcheck(Res(), 2) is a routine to check if Res() is above 2 * TickSize of GetCurrentAsk().

    1 - I use OnExecution to know when a EntryOrder in filled.
    Click image for larger version

Name:	OnExecution.JPG
Views:	56
Size:	94.1 KB
ID:	1047154 2 - I use "Saida()" to update stopOrder. But if i donīt have any stopOrder, this "Saida()" canīt put any stopOrder.
    Click image for larger version

Name:	saida.JPG
Views:	54
Size:	109.6 KB
ID:	1047155 How can I verifiy if a stopOder is Accepted by broker ? I try OnOrderUpdate() without success. Can anyone help me in this problem ?

    Regards
    Eros

    #2
    Hello Eros Lima,

    Thank you for the question.

    From the image only I cannot tell what may be happening, but we do have a sample which demonstrates using OnOrderUpdate/OnExecutionUpdate for target orders including a stop order like you have pictured. https://ninjatrader.com/support/help...and_onexec.htm

    I would likely suggest experimenting with the sample as that excludes the extra logic you have pictured, this would allow you to test a more simple use case to find the status of the stop. You could then compare and contrast against what you have created to see where the problem is.

    This is the general suggestion on how to approach using order objects with targets, to observe the order being accepted that would need to happen in OnOrderUpdate. Most commonly you can use the signal name or from entry signal name as ways of locating the order in OnOrderUpdate.

    I would suggest using Prints in the override to verify you can see the order updates, I do not see any prints currently used in the images you had provided so this would be a good starting point to finding the problem. https://ninjatrader.com/support/help...lightsub=print


    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by funk10101, Today, 12:02 AM
    0 responses
    3 views
    0 likes
    Last Post funk10101  
    Started by gravdigaz6, Yesterday, 11:40 PM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by MarianApalaghiei, Yesterday, 10:49 PM
    3 responses
    10 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by XXtrader, Yesterday, 11:30 PM
    0 responses
    4 views
    0 likes
    Last Post XXtrader  
    Started by love2code2trade, 04-17-2024, 01:45 PM
    4 responses
    28 views
    0 likes
    Last Post love2code2trade  
    Working...
    X