I have used the 250 pips profit stop in PRT as well, but I do not get any results at all…. I have used the same parameters and the spread as well.
If the code is correct the PRT backtest results should be equal to the manual test results. But in PRT I do not have any results at all.
ps. I’m using the Gold spot (E1 contract), 1 hour timeframe
First time you have mentioned Gold?
Attached results on Gold 1 H TF … Time = 040000 lower curve, Time = 010000 upper curve.
There are results on Gold so is attached of interest / help?
Thanks for helping me out, but it doesn’t work the way it should. So, I will get into this to fix it.
Thanks again!!!
Okay, I was confused as you said … in PRT I do not have any results at all … so I thought your code didn’t open any positions for you in PRT?
Anyway, let us know when you sort it please as I like to know there is closure on a problem.
Cheers
GraHal
Ok, I think I have found the solution. Look at the code. That gives me the results I want. Thank you guys!
// Gold breakout
// 1 hour
// One order per day, from 06:30h. The system shuts-down at 21:00h
// Everyday highest and lowest position from 2100 to 0400
DEFPARAM CUMULATEORDERS = false
// OPERATIONAL TIME
DEFPARAM FLATBEFORE = 063000
DEFPARAM FLATAFTER = 210000
Operationaltime = TIME > 063000 AND TIME < 210000
// ONE TRADE PER DAY. It resets the variable each new day
IF INTRADAYBARINDEX = 0 THEN
alreadytraded = 0
ENDIF
// Prevents the system from placing new orders on specified days of the week
daysForbiddenEntry = OpenDayOfWeek = 1 OR OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
// RANGE between 2100h to 0400h
IF TIME=040000 THEN
channelhigh = Highest[7](high)
channellow = Lowest[7](low)
ENDIF
// BREAKOUT Conditions
c1= close > channelhigh
c2= close < channellow
// LONG Positions-Opening
IF Operationaltime AND not daysForbiddenEntry and c1 AND alreadytraded = 0 THEN
BUY 10 CONTRACT AT MARKET
alreadytraded = 1
ENDIF
// SHORT Positions-Opening
IF Operationaltime AND not daysForbiddenEntry and c2 AND alreadytraded = 0 THEN
SELLSHORT 10 CONTRACT AT MARKET
alreadytraded = 1
ENDIF
// Stops and targets
SET STOP LOSS 2.3*pipsize
SET TARGET PROFIT 8.0*pipsize
Yeah now you have the 17 Trades in June you wanted / needed, but most of them are closed within the same 1 H bar (as opened) and so don’t show as positions on the chart results (but they do show in the Orders List / Tabular results).
Do you get the same equity curve as attached?