Wanted: small code snippet for reinvestment
Forums › ProRealTime English forum › ProOrder support › Wanted: small code snippet for reinvestment
- This topic has 68 replies, 7 voices, and was last updated 7 years ago by Nicolas.
-
-
01/06/2018 at 11:55 PM #57550
Dear friends: I¡ve been trying to run this code in my PRT Demo account, but no signal appears in the backtest (Dax 1€, timeframe 4h). I’ve checked the platform opcions on the time-zones issue, and it seems that everything is ok. Any idea about why I’m not seeing any trade?
Thanks a lot!!!
01/07/2018 at 12:40 PM #5757901/07/2018 at 12:41 PM #57582Hi Pitupitu,
Did you check the time criteria??? I have tried the code and it works fine. Check that the time criteria fits the 4 hour candles. I have seen a second code in page 2 that set time not achievable for 4 hour candles (080000, 120000, etc) unless you have UTC time. Remember that Spain and Central Europe is UTC+1.
I hope this is the problem. As I said, I have copy/paste the code of the first page with time criteria 090000, 130000 etc and it works, as it is match my time zone.
Saludos,
Juan
01/07/2018 at 1:11 PM #5758701/07/2018 at 1:45 PM #57593Sorry – I changed the times in my modified code as I have my platform set to UTC. I just find it easier to know that 4HR candles are at 0400, 0800 etc etc. I normally get very confused as I am actually UK based but do most of my trading from Greece so in reality I have no idea what time it is anywhere!
01/07/2018 at 2:29 PM #57601Hi guys,
Thank you for your advice. In fact, there are two options, but you have to be coherent: using 8-12-16-20 with UTC, or 9-13-17-21 with UTC+1.
Now, it works, but now in all the domain. I don’t understand why my differences with the results figures attached by Vonasi (my backtest also attached here).
Any idea? Thank you again!!!
01/07/2018 at 4:16 PM #57619Bit confused as I just went from one OC to another and now the backtest launches no trades. I am assuming my changing to UTC +1 for EU Indices didn’t take effect until I logged in fresh onto second PC – and now none of the times are triggered. In the original code, what were the times in – utc or utc+1….I.e is 08:00 actually a UK time implying 09:00 trade time trigger for DAX in local time.
01/08/2018 at 1:08 AM #57655Hi,
Can someone please explain the logic in the code, and any pre-requisites. By pre-requisites I mean do we need to exclude out of hours trading from the chart, or leave 24 hours in play.
Also, whats the logic here:
12345IF time = 090000 or time = 130000 or time = 170000 or time = 210000 thenIf Repulse[3](close)< -0.3 Thensell at marketEndifENDIFWhy does looking for Repulse (not familiar with this one) 3 bars ago create a sell condition…are we not looking 12 hours back here in this line of code?
Excuse the silly questions…
Regards
i
01/08/2018 at 10:06 AM #57673JohnScher may be in a better position to answer your questions about the logic behind the strategy but this is my impression.
All codes make their decisions at the close of a candle and then opens the position at the open of the new one after the close. TIME is a little confusing and I suggest adding the following to a chart as an indicator to understand it better and then hover over any bar to understand fully what time actually means.
1Graph Time as "Time", OpenTime as "OpenTime"So it will only exit at the end of the 0500 0900 1200 and 1700 bars and at the actual time of 0900 1300 1700 2100. I’m guessing this is to ensure that positions are only closed during the main European/American sessions and not during the usually flat Asian overnight session.
01/08/2018 at 11:30 AM #5768301/11/2018 at 12:42 PM #59027My ‘three entry condition’ version with seasonal adjustment has now been on backtest since new year’s day. Just one trade – a win of £597 for a £3 bet that took 4 days and 3 hours on the market ( over 6 days reality due to the weekend). It was up by £1017 at its highest point but fell back to be closed by the very distant trailing stop. Not a bad start though. It was never in a loss.
01/11/2018 at 12:50 PM #5903001/11/2018 at 12:50 PM #5903101/11/2018 at 12:52 PM #5903601/11/2018 at 1:13 PM #59042ooops
Now you are just trying to rack up points for forum posts I think?
Yes there are many ways to skin a cat. Although I think that a blind man could have made money out of last weeks DAX new year post Christmas back to the office rally!
You seem to be a big fan of SuperTrend…. I may have to revisit it and see if I can fall in love with it.
-
AuthorPosts