EXIT TRADING UNTIL TOMORROW – HOW TO CODE
Forums › ProRealTime English forum › ProOrder support › EXIT TRADING UNTIL TOMORROW – HOW TO CODE
- This topic has 5 replies, 3 voices, and was last updated 8 years ago by GraHal.
-
-
01/03/2017 at 5:07 PM #19720
Hi Guys
Anybody know how best to code an ‘exit for today’ / Exit Trades until Tomorrow please?
I’ve got as far as below, but can’t think how to code the line
EXIT MARKET UNTIL TOMORROW
Many Thanks
GraHal12345If POSITIONPERF(3) + POSITIONPERF(2) + POSITIONPERF < - x THENSell at MarketExitshort at MarketEXIT MARKET UNTIL TOMORROWEndIf01/03/2017 at 10:48 PM #1976401/03/2017 at 11:17 PM #1976601/04/2017 at 4:08 PM #1983201/04/2017 at 4:15 PM #19834You can do it easily with your previous code:
12345If POSITIONPERF(3) + POSITIONPERF(2) + POSITIONPERF < - x THENSell at MarketExitshort at Marketsavedate = DateEndIfAnd then when you want to initiate new orders, put a condition to verify if the current Date is not the previously saved one:
123if buycondition and Date<>savedate thenBUY 1 SHARE AT MARKETendifIt may be not the next day (tomorrow as you refer to it), but not the same day as your last closure. Don’t know if it’s important or not.
01/04/2017 at 11:10 PM #19877Embarrasingly easy when watching the Master 🙂 I was over-complicating the Date<>SaveDate.
Results confused me at first. I worked on it (using GRAPH Function) until it made sense. Profit (optimised) almost same as without Date<>Savedate, but profit profile not as good … bigger drawdown.
I’ll run Bot on Demo and if proves good I’ll put on here.
Many Thanks Nicolas
GraHal1 user thanked author for this post.
-
AuthorPosts