Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Basic Order Handling

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

    Basic Order Handling

    Ninjas,

    I'm fairly new to NT, so please be gentle I have a question about order handling.

    I trade an EOD strategy that enters a market as soon as the price exceeds a certain point. I've modelled this in my NT strategy with this line of code ("LongEntry()" calculates the breakout price) :

    EnterLongStopLimit(DefaultQuantity, LongEntry(2.0, 15).Entry[0], LongEntry(2.0, 15).Entry[0], "LongEntry");

    A trailing stop is then attached ("LongStop()" is my stop price) :

    ExitLongStop(DefaultQuantity, LongStop(2.0, 5).Stop[0], "LongStop", "LongEntry");

    Backtesting the strategy with these two lines of code works fine. However, as soon as I try to integrate the same sort of function calls to add short trades to the strategy things start to go downhill. The code looks like this:

    // Set entry orders
    EnterLongStopLimit(..., "LongEntry");
    EnterShortStopLimit(..., "Short Entry");

    // Set stop orders
    ExitLongStop(..., "LongStop", "LongEntry");
    ExitShortStop(..., "ShortStop", "ShortEntry");


    The results show that NJ reverses the position when a new entry is generated -- i.e. the stops are no longer taken into account.

    What am I not seeing?

    Tradey

    #2
    Hi Tradey,

    It's likely that you are running in to some of the built-in handing rules described at the bottom of the page here: http://www.ninjatrader-support.com/H...tml?Overview36

    Use TraceOrders to see what's happening with your orders: http://www.ninjatrader.com/support/f...ead.php?t=3627
    TimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Kaledus, Today, 01:29 PM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by frankthearm, Yesterday, 09:08 AM
    13 responses
    45 views
    0 likes
    Last Post frankthearm  
    Started by PaulMohn, Today, 12:36 PM
    2 responses
    16 views
    0 likes
    Last Post PaulMohn  
    Started by Conceptzx, 10-11-2022, 06:38 AM
    2 responses
    55 views
    0 likes
    Last Post PhillT
    by PhillT
     
    Started by yertle, Yesterday, 08:38 AM
    8 responses
    37 views
    0 likes
    Last Post ryjoga
    by ryjoga
     
    Working...
    X