How to find Limit Order has been executed or not
Forums › ProRealTime English forum › ProOrder support › How to find Limit Order has been executed or not
- This topic has 8 replies, 4 voices, and was last updated 6 years ago by
Nicolas.
-
-
08/22/2019 at 6:45 AM #105248
Hi
I am creating sell order into auto trading system, when trading system start.
1SELLSHORT 1 contract at mySellPrice limitSell order will not in position tab, Until system reach to mySellprice. It will take some time to reach to my indicated (mySellPrice) price.
Meanwhile how can I detect that sell order is executed or not?
08/22/2019 at 7:51 AM #105252Check if OnMarket or not OR, if not, if StrategyProfit <> StrategyProfit[1].
08/22/2019 at 8:50 AM #105254So when I place the sell order using limit, OnMarket condition will be false. And when sell order will be executed in future OnMarket condition will return true.
08/22/2019 at 9:58 AM #105262Yes, sometimes if a trade enters and exits on a single bar ONMARKET will not be able to update its status, so you’ll have to compare STRATEGYPROFIT.
08/22/2019 at 10:28 AM #105271Parimal Patel – I have moved this topic to the ProOrder forum as it is strategy related and not a general discussion. Please try to post future topics and questions in the correct forum.
08/26/2019 at 9:23 AM #105549i have tried above suggestion, but doesn’t work 100%.
When first condition is hit , I am executing first order (could be limit or market). When second condition hit, I am placing another order. In 90% case my 2nd order executed successfully but 10% case system don’t pick up the order. I don’t know why its happening. So I have to check in next bar or next execution point that my order has been executed or not.
STRATEGYPROFIT value change every time (or on every bar) due to first order is already there. ONMARKET doesn’t work as first order is already there.
Is there anyway I can check and fix this issue?
08/26/2019 at 9:48 AM #10555108/26/2019 at 9:51 AM #105552STRATEGYPROFIT is updated only when a trade is closed, so it cannot change each bar, unless your trades only last one bar.
The only workaround would be checking if the entry price of the pending order has been hit, if it is then you may assume the order has been triggered, unless rejected for some reasons.
08/28/2019 at 12:56 PM #105732You can check if you were on market or not on the previous bar with this snippet: (useful if the order opened and closed in the same bar)
Was On Market?123456if ( (not onmarket and onmarket[1]) or (tradeindex(1)=tradeindex(2) and tradeindex(1)=barindex[1] and tradeindex(1)>0) ) and lastcheck<>barindex thenlastcheck = barindexwasonmarket=1elsewasonmarket=0endif1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on