Newbie questions about automatic trading with ProOrder code
- This topic has 21 replies, 5 voices, and was last updated 7 years ago by .
Similar topics:
Forums › ProRealTime English forum › ProOrder support › Newbie questions about automatic trading with ProOrder code
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
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!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
// 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?
Find exclusive trading pro-tools on