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 funk10101, Today, 09:43 PM
    0 responses
    6 views
    0 likes
    Last Post funk10101  
    Started by pkefal, 04-11-2024, 07:39 AM
    11 responses
    37 views
    0 likes
    Last Post jeronymite  
    Started by bill2023, Yesterday, 08:51 AM
    8 responses
    44 views
    0 likes
    Last Post bill2023  
    Started by yertle, Today, 08:38 AM
    6 responses
    26 views
    0 likes
    Last Post ryjoga
    by ryjoga
     
    Started by algospoke, Yesterday, 06:40 PM
    2 responses
    24 views
    0 likes
    Last Post algospoke  
    Working...
    X