I satisfy the request of a member of the website (Miguel33) with this simple code with excellent position …. good income but not very good outputs, if you have improvement ideas do not hesitate to ask, try this code on other tools and share the results … thank you
Soddisfo la richiesta di Miguel33 di un codice semplice ma con ottime potenzialità…. buone le entrate ma non molto buone le uscite, se avete idee migliorative non esitate a chiedere, provate questo codice anche su altri strumenti e condividete i risultati…grazie
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 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
// Definizione dei parametri del codice DEFPARAM CumulateOrders = False // Posizioni cumulate disattivate ONCE Cond1=0 ONCE Cond2=0 ONCE Cond11=0 ONCE Cond12=0 maxperdita=-500 // nella valuta delle strumento SL=150 // Stop Loss MediaX = Average[15](close) MediaY = Average[100](close) // Condizioni per entrare su posizioni long c1 = (MediaX CROSSES OVER MediaY) IF c1 THEN Cond1=1 ENDIF c2 = (Close<MediaX) IF c2 THEN Cond2=1 ENDIF c3 = (Close>MediaX) c4 = (Close<MediaY) IF c4 THEN Cond1=0 Cond2=0 ENDIF IF cond1=1 AND cond2=1 and c3 THEN BUY 1 CONTRACT AT MARKET cond1=0 cond2=0 ENDIF // Condizioni per entrare su posizioni short c11 = (MediaY CROSSES OVER MediaX) IF c11 THEN Cond11=1 ENDIF c12 = (Close>MediaX) IF c12 THEN Cond12=1 ENDIF c13 = (Close<MediaX) c14 = (Close>MediaY) IF c14 THEN Cond11=0 Cond12=0 ENDIF IF cond11=1 AND cond12=1 and c13 THEN Sellshort 1 CONTRACT AT MARKET cond11=0 cond12=0 ENDIF // Stop e target IF STRATEGYPROFIT < maxperdita THEN QUIT ENDIF SET STOP pLOSS SL |
Canale di Fill
Share this
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.
ProRealTime ITF files and other attachments :PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
Thanks for helping the community Canale di Fill! Unfortunately, the Miguel33’s strategy is not good before 2015.. Seems that the chosen moving average periods are functioning well for the most recent period of this forex pairs on the 1 hour chart: since January 2015, EURUSD is in a range between 1.08 and 1.18. It’s interesting to see that MA crossover can perform well in this kind of market. Well, this one is for learning purpose.. 😉
Thanks,
The problem with this kind of strategy (average, crossing…) is that is overoptimized. You will always find better results with better periods of moving average.
Sadly, without Walk forward backtest (Hope to be in the 10.4 version …) it is unuseful
Sorry
Zilliq
Grazie ragazzi per i vostri commenti, ma io ho creato un mio personalissimo “montecarlo” che prevede che il range di EUR/USD sarà con una buona probabilità lo stesso dell’ultimo periodo ottimizzato per i prossimi 3 mesi, per cui con una buona probabilità l’ottima performance continuerà per i prossimi mesi, sfortunatamente non durerà per sempre. Io personalmente ho aggiunto un trailing stop per migliorare ulteriormente le performance ma non è ancora soddisfacente per il mio gusto.
Filippo
Grazie filippo.
sto facendo dei backtest per valutare meglio in diverse situazioni.
se trovo qualcosa di interessante lo condivido
Hello, If you google, you will find a lot of articles and block posts that clearly show experience with MA cross strategies in real automated trading. They do not work. They are only good in backtesting scenarios. Best, Patrick
I would like to inform you that these strategies tested till today (03.05.2019) generates enormous profit!!!!!So ‘the future’ demonstrates that the creator was right after all!!!