I want to understand the behavior of ExitShortStopMarket, ExitLongStopMarket
----
1. Suppose the current market OHLC bar is 72.90, 73.59, 72.15, 72.73, and I am currently Long +5 contracts. If I issue an order using ExitLongStopMarket at a price of 72.88 for the next bar, my order is rejected. I did not try to open any Short position, but only to close the Long position.
This is the error that is printed:
7/11/2018 11:00:00 AM Strategy 'MyTestStrategy/165864626': Entered internal SubmitOrderManaged() method at 7/11/2018 11:00:00 AM: BarsInProgress=0 Action=Sell OrderType=StopMarket Quantity=5 LimitPrice=0 StopPrice=72.88 SignalName='LongExit' FromEntrySignal='LongEntry'
7/11/2018 11:00:00 AM Strategy 'MyTestStrategy/165864626': Ignored SubmitOrderManaged() method at 7/11/2018 11:00:00 AM: BarsInProgress=0 Action=Sell OrderType=StopMarket Quantity=5 LimitPrice=0 StopPrice=72.88 SignalName='LongExit' FromEntrySignal='LongEntry' Reason='Invalid order price, please see log tab'
The next Ohlc bar was : 72.72,72.73,71.80,71.89. So, normally I would expect I would expect since the next bar opened below my Stop Level (went through the stop), the order should get converted to a market order and get traded at the open of 72.72. Why was the order rejected with an "Invalid order price" ?
----
2. Suppose the current market OHLC bar is 68.46, 68.99, 68.05, 68.94, and I am currently Short -5 contracts.If I issue an order using ExitShortStopMarket at a price of 68.64 for the next bar, my order gets rejected. I did not try to open any Long position, but only to close the Short position.
This is the error that is printed:
7/24/2018 10:00:00 AM Strategy 'MyTestStrategy/165864626': Entered internal SubmitOrderManaged() method at 7/24/2018 10:00:00 AM: BarsInProgress=0 Action=BuyToCover OrderType=StopMarket Quantity=5 LimitPrice=0 StopPrice=68.64 SignalName='ShortExit' FromEntrySignal='ShortEntry'
7/24/2018 10:00:00 AM Strategy 'MyTestStrategy/165864626': Ignored SubmitOrderManaged() method at 7/24/2018 10:00:00 AM: BarsInProgress=0 Action=BuyToCover OrderType=StopMarket Quantity=5 LimitPrice=0 StopPrice=68.64 SignalName='ShortExit' FromEntrySignal='ShortEntry' Reason='Invalid order price, please see log tab'
The next Ohlc bar was: 68.94,69.35,68.89,69.34. So, normally I was expect that since the next bar opened above my Stop Level (went through the stop), the order should get converted to a market order and get traded at the open of 68.94. Why was the order reject with an "Invalid order price" ?
----
Log tab only says: "An Exit() method to submit an order enter at xxx has been ignored. Please search on the term 'Internal Order Handling Rules' in the Help Guide.
Does the Stop Price level needs to be compulsorily below the last Close for ExitLongStopMarket, and above the last Close for ExitShortStopMarket ?
Comment