FTSE EMA crossing code
Forums › ProRealTime English forum › ProOrder support › FTSE EMA crossing code
- This topic has 5 replies, 3 voices, and was last updated 4 years ago by rsd001.
-
-
03/31/2020 at 8:43 PM #124167
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.
- buy when the 10 ema cross’s the 25 ema in an upward direction and close when it crosses in a downward direction.
- sell when the 10 ema cross’s the 25 ema in a downward direction and close when it cross’s in an upward direction
can anyone do this for me
please email.
03/31/2020 at 8:57 PM #124168rsd001 – 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. 🙂
03/31/2020 at 9:18 PM #124170What you’ve described would look like this:
1234indicator1 = 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.
03/31/2020 at 9:40 PM #124173The whole thing would look something like this:
123456789101112131415161718192021222324252627282930313233DEFPARAM cumulateOrders = False // Cumulating positions deactivateDefparam flatbefore = 080000Defparam flatafter = 163000//strategyindicator1 = 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 positionsIF NOT LongOnMarket AND c1 THENBUY 1 CONTRACTS AT MARKETENDIF// Conditions to exit long positionsIf LongOnMarket AND c2 THENSELL AT MARKETENDIF// Conditions to enter short positionsIF NOT ShortOnMarket AND c2 THENSELLSHORT 1 CONTRACTS AT MARKETENDIF// Conditions to exit short positionsIF ShortOnMarket AND c1 THENEXITSHORT AT MARKETENDIF// Stops and targets : Enter your protection stops and profit targets hereSET STOP %LOSS 1SET TARGET %PROFIT 204/01/2020 at 12:37 PM #12423604/01/2020 at 12:41 PM #124237this is great, ill try it today.
-
AuthorPosts
Find exclusive trading pro-tools on