FTSE EMA crossing code
- This topic has 5 replies, 3 voices, and was last updated 5 years ago by .
Viewing 6 posts - 1 through 6 (of 6 total)
Viewing 6 posts - 1 through 6 (of 6 total)
Similar topics:
Forums › ProRealTime English forum › ProOrder support › FTSE EMA crossing code
Hi,
Im not very good at coding, can anyone support by building the code for an ema crossover system.
I’m looking at using 10 and 25 ema.
can anyone do this for me
please email.
rsd001 – Welcome to the forums. If you post your request in the correct forum then you might have a better chance of some assistance. ProBuilder is for indicator questions and ProOrder is for strategy questions. I will move your topic to the correct forum. Please try to be more careful when posting future topics to ensure that they are in the right place. 🙂
What you’ve described would look like this:
|
1 2 3 4 |
indicator1 = ExponentialAverage[10](typicalPrice) indicator2 = ExponentialAverage[25](typicalPrice) c1 = (indicator1 > indicator2 and indicator1[1] < indicator2[1]) c2 = (indicator1 < indicator2 and indicator1[1] > indicator2[1]) |
You then add c1 and c2 to your entry and exit conditions as necessary.
If you’re interested in this kind of strategy you should also have a look at this:
https://www.prorealcode.com/topic/optimization-moving-average-crossing-strategy/
a program that finds optimal pairs of 69 different crossing MAs.
The whole thing would look something like this:
|
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 |
DEFPARAM cumulateOrders = False // Cumulating positions deactivate Defparam flatbefore = 080000 Defparam flatafter = 163000 //strategy indicator1 = ExponentialAverage[10](typicalPrice) indicator2 = ExponentialAverage[25](typicalPrice) c1 = (indicator1 > indicator2 and indicator1[1] < indicator2[1]) c2 = (indicator1 < indicator2 and indicator1[1] > indicator2[1]) // Conditions to enter long positions IF NOT LongOnMarket AND c1 THEN BUY 1 CONTRACTS AT MARKET ENDIF // Conditions to exit long positions If LongOnMarket AND c2 THEN SELL AT MARKET ENDIF // Conditions to enter short positions IF NOT ShortOnMarket AND c2 THEN SELLSHORT 1 CONTRACTS AT MARKET ENDIF // Conditions to exit short positions IF ShortOnMarket AND c1 THEN EXITSHORT AT MARKET ENDIF // Stops and targets : Enter your protection stops and profit targets here SET STOP %LOSS 1 SET TARGET %PROFIT 2 |
this is great, ill try it today.
Find exclusive trading pro-tools on