Trade closes automatically
Forums › ProRealTime English forum › ProOrder support › Trade closes automatically
- This topic has 9 replies, 2 voices, and was last updated 7 years ago by
JC_Bywan.
-
-
07/29/2017 at 4:43 PM #41961
Hi guys,
First of all, a big thumbs up for this forum. You guys really help me out.
I’ve got a question:I have backtested a strategy for gold and it works quite well. There is only one thing I want to change. While backtesting PRT automatically closes a trade because a new trade is activated by the strategy. I actually don’t want this trade to be closed automatically. My question is, does this also happen when I’m trading for real? And if so, what would be the solution to fix this problem?
Thanks again guys
BR Pieter07/29/2017 at 5:44 PM #41964Hi, assuming you talk about trade closed not just by any other trade but only by new trade in opposite direction, then this recent topic should explain and provide with code keyword to avoid it (not the “time” 1st part of topic but a bit firther towards the end the “if not onmarket and…” or “longonmarket”/”shortonmarket” parts of it)
https://www.prorealcode.com/topic/help-for-a-newby-time-specific-actions/
07/30/2017 at 1:20 AM #4198807/30/2017 at 10:13 AM #41996Don’t know what more I could say than post #41666 (07/26/2017 at 1:07 PM) extracted from link I gave above, so I’ll copy it below in case link didn’t work:
=== 07/26/2017 at 1:07 PM === #41666 ===
“onmarket” should be the useful keyword to avoid “take and reverse” when you want the existing trade to go all the way not stopped prematurely by opposite entry conditions being met (p.17 https://www.prorealtime.com/en/pdf/probacktest.pdf )
Would use it by adding the condition “if not onmarket” to your existing entry conditions, so that it considers a new entry only if onmarket=0, then it shouldn’t open any opposite direction trade while there’s one still ongoing
12345if not onmarket and [add here your long order entry conditions] thenbuy etc...if not onmarket and [add here your short order entry conditions] thensellshort etc...07/30/2017 at 10:29 AM #4200007/30/2017 at 10:33 AM #42002Ok, if the problem is not so much the first one closing but having both trades in opposite direction at the same time, that’s not possible, PRT won’t let you have trades in opposite directions inside same strategy as far as I know, no coding could go around that. I am not aware of the possibility of this being looked at for next version with new PRT engine, but maybe Nicolas would correct me if there was news on that front.
07/30/2017 at 10:37 AM #4200307/30/2017 at 10:37 AM #4200407/30/2017 at 10:43 AM #4200507/30/2017 at 10:58 AM #42007Was wondering if you saw my 10:37 as we posted together at the same time (happened to me before, missing a reply when the person posted twice in short time and I don’t see there’s a new message between the one I reply to and mine) .
I would insist though, this double strategy would work only if you have the old “unlimited risk” cfd account type, not the new “limited risk” cfd account for some countries with recent legislative changes for cfd from what I’ve read (I have an old one, haven’t tested changes first-hand with new one).
https://www.prorealcode.com/topic/trading-automatique-sur-compte-a-risque-limite-et-proorder/
-
AuthorPosts
Find exclusive trading pro-tools on