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

stoping doubling orders

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

    stoping doubling orders

    I am working with an 1hour timeframe charts.
    Sometimes the long and short order is trigger, and on bar close the system shorts 1, close short 1, and go long 1.
    of course I just need to be long 1 (the last order triggered).
    How can I avoiding the first unwanted order?

    #2
    Hello dafonseca,

    I'm not quite sure what you are experiencing.

    Are you attempting to reverse your position?

    Are you calling ExitLong() and EnterShort() on the same bar?

    If so, this will cause 3 orders to be sent. First the ExitLong() will trigger a sell order to exit the position. The position in NinjaTrader does not update immediately and will not update until the order traverses all order states. This will not happen by the the time EnterShort() is called. The EnterShort() will see that you are still in a long position and will send a second order to exit the long position. It will also send a 3rd order to enter the short position.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by AveryFlynn, Today, 04:57 AM
    0 responses
    4 views
    0 likes
    Last Post AveryFlynn  
    Started by RubenCazorla, 08-30-2022, 06:36 AM
    3 responses
    77 views
    0 likes
    Last Post PaulMohn  
    Started by f.saeidi, Yesterday, 12:14 PM
    9 responses
    23 views
    0 likes
    Last Post f.saeidi  
    Started by Tim-c, Today, 03:54 AM
    0 responses
    3 views
    0 likes
    Last Post Tim-c
    by Tim-c
     
    Started by FrancisMorro, Today, 03:24 AM
    0 responses
    5 views
    0 likes
    Last Post FrancisMorro  
    Working...
    X