Forums › ProRealTime English forum › ProOrder support › frequency of execution of system › Reply To: frequency of execution of system
04/27/2020 at 7:33 PM
#128492
Thank you both!
It seems that the calculation timeframe can be different to the execution timeframe which is very interesting. Can you please explain to me how I could implemented this?
I am using a very simple MACD strategy as per below.
On a theoretical note though, shouldn’t the 24hr MACD strategy with parameters [a,b,c] produce exactly the same decisions with the 12 hr MACD strategy with parameters [2a, 2b, 2c] every 24 hours?
Many thanks!
|
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 |
// Definition of code parameters DEFPARAM CumulateOrders = False // Cumulating positions deactivated // Conditions to enter long positions a = 10 b = 34 c = 18 Amount = 4 indicator1 = MACD[a,b,c](close) c1 = (indicator1 >= 0) IF c1 THEN BUY Amount PERPOINT AT MARKET ENDIF // Conditions to exit long positions indicator2 = MACD[a,b,c](close) c2 = (indicator2 <= 0) IF c2 THEN SELL AT MARKET ENDIF // Conditions to enter short positions indicator3 = MACD[a,b,c](close) c3 = (indicator3 <= 0) IF c3 THEN SELLSHORT Amount PERPOINT AT MARKET ENDIF // Conditions to exit short positions indicator4 = MACD[a,b,c](close) c4 = (indicator4 >= 0) IF c4 THEN EXITSHORT AT MARKET ENDIF |