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
// 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
www.tradingsistem.com
You must be logged in to post a comment.
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
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.. ;)
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!!!