Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Order Dissapearing

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

    Order Dissapearing

    This very well may be the last question that deals with the code of this particular strategy. It appears that everything is working perfectly now (after a great deal of time learning and a whole lot of trial and error!)- so hopefully this fix will not open up a can of worms.

    I have an order that is randomly dissappearing. I say randomly because the code is being called but some times that order is showing up and other times it is not, despite the code always showing a print statement.

    LongAdjustedStop is the name of the order and it is supposed to be called and the order submitted when LongLimit is filled.

    Here is the code that I have for it that is found in OnExecution:

    Code:
    			if (LongLimit != null
    				&& LongLimit.OrderState == OrderState.Filled
    				&& LongStopB != null
    				&& LongAdjustedStop == null)
    	
    			{
    				LongAdjustedStop = ExitLongStop(0,true,positionSize,adjustedStopLong,"LongAdjustedStop","LongEntryB");
    				Print(Time[0] + " Hello, LongAdjustedStop is being called!");
    				Print("LongAdjustedStop Price: " + adjustedStopLong + " At Time: " + Time[0]);
    				testBool = true;
    				Print("LongAdjustedStop = " +LongAdjustedStop);
    			}
    Attached is a screenshot of the Output Window for July 30, 2013. On there you will find that LongAdjustedStop is null. But, you will also find a screenshot of August 9, 2013 where LongAdjustedStop was also called and the order was set and it properly executed.

    In both cases the Print statement of "Hello, LongAdjustedStop is being called!" is showing up and therefore it does not appear to be a problem with the conditional statements. I don't know what else to Print at this point or where else to look in order to find why this is not submitting the order?

    Could you help me with what I should be looking at?

    Thank you very much!
    Attached Files

    #2
    jg123,

    Thank you for your post.

    Right above that line for your Print(Hello...)
    There is a line that says the sell stop order is ignored because it is greater than or equal to the close price of the current bar.

    This is going to go back to the other thread that was in the same discussion on this subject -
    http://www.ninjatrader.com/support/f...ad.php?t=68146
    Cal H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    637 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    366 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    107 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    569 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    571 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X