Order, profit and stop loss triggered wrong
Forums › ProRealTime English forum › ProOrder support › Order, profit and stop loss triggered wrong
- This topic has 8 replies, 3 voices, and was last updated 6 years ago by
Hiraokii.
-
-
10/26/2018 at 6:42 PM #83575
Hi brothers, I want to ask another thing, I searched in fóruns already and I didn’t read anything to help me solve my problem.
I have a code simple like this one, but when I run the backtest, the buy entry is always at the close of the previous bar level and not at the high level. And the stop is the same thing, it didn’t stop at the low of the previous bar and close at the low of the actual. Thanks12345678If not longonmarket and close>=high[1] thenBuy 1 lot at high[1] limitSet target profit range[1]Set stop loss low[1]EndifIf longonmarket (barindex-tradeindex=2) thenSell at marketEndif10/26/2018 at 8:21 PM #83576Your buy at a limit (better) price should work as you describe – are you allowing for spread?
SET TARGET and SET STOP expects a distance and not a level or price so your SET TARGET should work (use SET TARGET pPROFIT to look for it in pips) but your SET STOP is unlikely to ever be hit.
You have a typo in line 6 as an AND is missing.
An image would help to show where you think a trade is being opened or closed incorrectly.
10/27/2018 at 5:18 AM #83581Thanks brother, I am starting to understand better now.
But I didn’t understand the spread thing, ig spread is 0,3 so it’s 0.003 right?
In this picture it’s buying on the close of the candle and not at the higher. And it’s not stopping.10/27/2018 at 6:07 AM #8358310/27/2018 at 7:15 AM #8359210/27/2018 at 7:51 AM #835930,3 spread is 0.00003 (three tenths of a pip), not 0.003!
Set stop loss low[1] is WRONG, as Vonasi pointed out. It requires a difference in price (such as CLOSE – LOW[1]), not a price. Dax is quoting about 11,200, so it would be 11,200-PIP stop loss and will never get hit (your account would be wiped out long before that).10/27/2018 at 8:38 AM #8359810/27/2018 at 9:08 AM #836021Set Stop Loss (high - close)10/28/2018 at 4:28 AM #83628 -
AuthorPosts
Find exclusive trading pro-tools on