Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Using ExitLongStopMarket

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

  • NinjaTrader_Jesse
    replied
    Hello Abdullah_KSA,

    If the order has not filled yet and you want to cancel it you would need to use Cancel Order. The exit methods are for exiting a position you currently hold.

    https://ninjatrader.com/support/help...thod_to_ca.htm

    I look forward to being of further assistance.

    Leave a comment:


  • Abdullah_KSA
    replied
    Originally posted by trendisyourfriend View Post
    Is it possible that your condition has an error or it is just a typo?
    If (High[0] <= (EMA1[0] + (40 * TickSize)))

    EMA1[0] = EMA[10] ???

    Umm .. to be honest, I'm not the expert here .. I can barely do the basics
    Anyways, prior to using EMA1, I defined EMA1 by saying.. EMA1 = EMA(Close, 120);
    I cut it out earlier, not to make it so lengthy
    I found it in the help section, and it should work ok

    Leave a comment:


  • Abdullah_KSA
    replied
    Originally posted by NinjaTrader_Jesse View Post
    Hello Abdullah_KSA,

    Thank you for the post.

    I wanted to clarify here, the EnterLongStopMarket has filled and you are in a position. Now you want to wait for the condition you provided to become true and then ExitLongStopMarket. Have I understood that correct?

    I am not sure I see the question surrounding the ExitLongStopMarket, are you asking how to form the condition or were you seeing that the supplied code didn't work?

    I look forward to being of further assistance.

    When the EnterLongStopMarket is filled, it only places a pending order 10 ticks above the high price. So the order is not necessarily executed. It depends on how the price goes. If it goes up, then my placed order will be completely executed/filled. If it goes down, here's where I need the help. If it reaches the level I specified, I'd like to either cancel the order to exit it.

    I'm using the ExitLongStopMarket as a way to exit my unexecuted pending orders (if the price goes down). However, I'm not quite sure if my logic is correct since I'm using ExitLongStopMarket after the action of my initial IF statement. Is this correct? Should I include it inside the action part? The code compiles with no problems, but still doesn't cancel the pending orders when price goes down.. I hope now it is clear .. English is not my 1st language .. sorry

    Leave a comment:


  • trendisyourfriend
    replied
    Is it possible that your condition has an error or it is just a typo?
    If (High[0] <= (EMA1[0] + (40 * TickSize)))

    EMA1[0] = EMA[10] ???

    Leave a comment:


  • NinjaTrader_Jesse
    replied
    Hello Abdullah_KSA,

    Thank you for the post.

    I wanted to clarify here, the EnterLongStopMarket has filled and you are in a position. Now you want to wait for the condition you provided to become true and then ExitLongStopMarket. Have I understood that correct?

    I am not sure I see the question surrounding the ExitLongStopMarket, are you asking how to form the condition or were you seeing that the supplied code didn't work?

    I look forward to being of further assistance.

    Leave a comment:


  • Abdullah_KSA
    started a topic Using ExitLongStopMarket

    Using ExitLongStopMarket

    Hi,

    In my strategy code, I use EnterLongStopMarket if my conditions are perfectly met. It works just fine placing the order and waiting for the price till it reaches it, then fills the order. However, sometimes the price goes down and doesn't reach to the level I hope for. So, in this case, I'd like to tell it that after you place the order and then the price goes down to a certain level, ExitLongStopMarket(). Here's the logic I'm using and it's not giving me any errors while compiling, but my orders are still not cancelled even the price goes down to the level where I'd to exit:

    If (my condition is met)
    {
    EnterLongStopMarket();
    }

    // the above part is done elegantly
    // now here's the part where I'm confused and where I'd tell it that after you place the order (as in above) and the price goes down to a certain
    // level, ExitLongStopMarket()

    If (High[0] <= (EMA1[0] + (40 * TickSize))) // that's the price level when is reached, I'd like to exit or cancel any pending orders
    {
    ExitLongStopMarket();
    }

    Appreciate your kind support

Latest Posts

Collapse

Topics Statistics Last Post
Started by voltation, Today, 04:32 PM
1 response
9 views
0 likes
Last Post NinjaTrader_ShawnB  
Started by coopgrafik, Today, 03:44 PM
2 responses
24 views
0 likes
Last Post coopgrafik  
Started by cionjay, Today, 02:36 PM
1 response
9 views
0 likes
Last Post NinjaTrader_Kate  
Started by onnb1, Today, 02:08 PM
1 response
10 views
0 likes
Last Post NinjaTrader_Jim  
Started by omermirza, Today, 01:15 PM
4 responses
20 views
0 likes
Last Post omermirza  
Working...
X