AlexParticipant
Junior
La strateggia necessita 2 indicatori da allegare.Si accettano consigli per migliorarla grazie.
DEFPARAM CumulateOrders = false
ONCE Positionsize=1
// define saisonal position multiplier >0 - long
ONCE Januaryl = 2//DD 1263
ONCE Februaryl = 2//DD 1263
ONCE Marchl = 2//2 migliora 12% Ma DD 1580
ONCE Aprill = 2//2 MM 20% DD 1360
ONCE Mayl = 2//MM DD 1252 Abbassa
ONCE Junel = 0 //23% DD 1298
ONCE Julyl = 0 //3% dd < 900
ONCE Augustl = 2//8% dd > 938
ONCE Septemberl = 0//5% < dd 906
ONCE Octoberl = 2//34% dd = 906
ONCE Novemberl = 2//26% dd > 934
ONCE Decemberl = 2//25% DD > 954
// saisonal pattern long position
IF CurrentMonth = 1 THEN
saisonalPatternMultiplierl = Januaryl
ELSIF CurrentMonth = 2 THEN
saisonalPatternMultiplierl = Februaryl
ELSIF CurrentMonth = 3 THEN
saisonalPatternMultiplierl = Marchl
ELSIF CurrentMonth = 4 THEN
saisonalPatternMultiplierl = Aprill
ELSIF CurrentMonth = 5 THEN
saisonalPatternMultiplierl = Mayl
ELSIF CurrentMonth = 6 THEN
saisonalPatternMultiplierl = Junel
ELSIF CurrentMonth = 7 THEN
saisonalPatternMultiplierl = Julyl
ELSIF CurrentMonth = 8 THEN
saisonalPatternMultiplierl = Augustl
ELSIF CurrentMonth = 9 THEN
saisonalPatternMultiplierl = Septemberl
ELSIF CurrentMonth = 10 THEN
saisonalPatternMultiplierl = Octoberl
ELSIF CurrentMonth = 11 THEN
saisonalPatternMultiplierl = Novemberl
ELSIF CurrentMonth = 12 THEN
saisonalPatternMultiplierl = Decemberl
ENDIF
// define saisonal position multiplier >0 short
ONCE Januarys = 1//2 >25% DD 954 > 1041
ONCE Februarys = 1//% Poco
ONCE Marchs = 2 //5% DD =954
ONCE Aprils = 2//9% DD=954
ONCE Mays = 0//13% DD=954
ONCE Junes = 0//1% DD=954 Ratio aumenta
ONCE Julys = 2//9% DD 954 > 1004
ONCE Augusts = 2//25% DD=1004
ONCE Septembers = 1//da rivedere
ONCE Octobers = 1//da rivedere
ONCE Novembers = 0//20% DD=1004
ONCE Decembers = 2//10% DD=1004
// saisonal pattern short position
IF CurrentMonth = 1 THEN
saisonalPatternMultipliers = Januarys
ELSIF CurrentMonth = 2 THEN
saisonalPatternMultipliers = Februarys
ELSIF CurrentMonth = 3 THEN
saisonalPatternMultipliers = Marchs
ELSIF CurrentMonth = 4 THEN
saisonalPatternMultipliers = Aprils
ELSIF CurrentMonth = 5 THEN
saisonalPatternMultipliers = Mays
ELSIF CurrentMonth = 6 THEN
saisonalPatternMultipliers = Junes
ELSIF CurrentMonth = 7 THEN
saisonalPatternMultipliers = Julys
ELSIF CurrentMonth = 8 THEN
saisonalPatternMultipliers = Augusts
ELSIF CurrentMonth = 9 THEN
saisonalPatternMultipliers = Septembers
ELSIF CurrentMonth = 10 THEN
saisonalPatternMultipliers = Octobers
ELSIF CurrentMonth = 11 THEN
saisonalPatternMultipliers = Novembers
ELSIF CurrentMonth = 12 THEN
saisonalPatternMultipliers = Decembers
ENDIF
// Condizioni per entrare su posizioni long
myLong, mySell, my0 = CALL "Flag_Buy"
myEntriShort, myEsciShort, my1 = CALL "Flag_Sell"
IF TIME >= 90000 AND TIME <= 173000 AND close > myLong AND my0 THEN
IF saisonalPatternMultiplierl > 0 THEN
BUY Positionsize * saisonalPatternMultiplierl CONTRACT AT MARKET
ENDIF
ENDIF
// Condizioni per uscire da posizioni long
IF close < mySell THEN
SELL AT MARKET
ENDIF
// Condizioni per entrare su posizioni short
IF TIME >= 90000 AND TIME <= 173000 AND close < myEntriShort AND my1 THEN
IF saisonalPatternMultipliers > 0 THEN
SELLSHORT Positionsize * saisonalPatternMultipliers CONTRACT AT MARKET
ENDIF
ENDIF
// Condizioni per uscire da posizioni short
IF close > myEsciShort THEN
EXITSHORT AT MARKET
ENDIF
ONCE maxCandlesShortWithoutProfit =63// limit short loss latest after 63 candles
// stop and profit management
posProfit = (((close - positionprice) * pointvalue) * countofposition) / pipsize
ms = posProfit < 0 AND (BarIndex - TradeIndex) >= maxCandlesShortWithoutProfit
IF SHORTONMARKET AND ms THEN
EXITSHORT AT MARKET
ENDIF
// Stop e target:
SET Target Pprofit 86
SET STOP PLOSS 63
————————————————————————————-
//Flag_Buy
if box=1 and (high>tth or low<ttl) then
box=0
flag=0
endif
if box=0 and flag=0 and low>low[3] and low[2]>low[3] and low[2]>low[1] then
th=low[3]
flag=1
endif
if flag=1 and box=0 and low<th then
flag=0
endif
if flag=1 and box=0 and high<high[2] and high[1]<high[3] and high[2]<high[3] then
tth=high[3]
ttl=th
box=1
endif
once tth=undefined
once ttl=undefined
c1=close>= wilderaverage[200*8](close)
RETURN tth AS “Long”, ttl AS “Sell”,c1 AS “(0)”
————————————————————————————–
//Flag_Sell
if box=1 and (high>tth or low<ttl) then
box=0
flag=0
endif
if box=0 and flag=0 and low>low[3] and low[2]>low[3] and low[2]>low[1] then
th=low[3]
flag=1
endif
if flag=1 and box=0 and low<th then
flag=0
endif
if flag=1 and box=0 and high<high[2] and high[1]<high[3] and high[2]<high[3] then
tth=high[3]
ttl=th
box=1
endif
once tth=undefined
once ttl=undefined
c1=close>= wilderaverage[200*8](close)
RETURN tth AS “Long”, ttl AS “Sell”,c1 AS “(0)”
Ciao, mi sono trasferito il vostro presentare alla biblioteca, al Forum, invece, per discutere su di esso. Sembra quello che avete utilizzato l’ormai famoso andamento stagionale del sistema Pathfinder.
Sembra buono con me, ma ti dispiacerebbe preghiamo di aiutarci a capire meglio le lunghe e corte trigger delle posizioni di trading? Grazie. Vi posto la strategia nella libreria, una volta che si dà maggiori dettagli sulla strategia.
AlexParticipant
Junior
Ciao nicolas bisogna cambiare e aggiungere questo Flag_Sell
if box=1 and (high>tth or low<ttl) then
box=0
flag=0
endif
if box=0 and flag=0 and low>low[1] and low[2]>low[3] and low[3]>low[1] then
th=low[3]
flag=1
endif
if flag=1 and box=0 and low<th then
flag=0
endif
if flag=1 and box=0 and high<high[1] and high[2]<high[1] and high[3]<high[2] then
tth=high[3]
ttl=th
box=1
endif
once tth=undefined
once ttl=undefined
c1=close < wilderaverage[218*7](close)
RETURN ttl AS "EntriShort",tth AS "EsciShort",c1 AS "(1)"
AlexParticipant
Junior
E questo e flag_Buy,
if box=1 and (high>tth or low<ttl) then
box=0
flag=0
endif
if box=0 and flag=0 and low>low[3] and low[2]>low[3] and low[2]>low[1] then
th=low[3]
flag=1
endif
if flag=1 and box=0 and low<th then
flag=0
endif
if flag=1 and box=0 and high<high[2] and high[1]<high[3] and high[2]<high[3] then
tth=high[3]
ttl=th
box=1
endif
once tth=undefined
once ttl=undefined
c1=close>= wilderaverage[200*8](close)
RETURN tth AS "Long", ttl AS "Sell",c1 AS "(0)"
AlexParticipant
Junior
In allegato itf strateggia completa.
Grazie, ma vuoi ci dispiacerebbe dice come fa la strategia sta funzionando? Quali sono gli indicatori bandiera buy e bandiera vendere?
Sembra che aver ottimizzato un po takeprofit e il stoploss?
AlexParticipant
Junior
Buy =close > tth indicatore flag_buy
SELL close < ttl indicatore flag_buy
SELLSHORT close < ttl indicatore flag_Sell
EXITSHORT close > tth indicatore flag_Sell
Equilibrio Long close >= media[x] Periodi accetta solo Long
Equilibrio short close < media[x]Periodi accetta solo Short
La rottura di resistenza deve avvenire ora Tra 9.00 e 17.30
AlexParticipant
Junior
Per ulteriori chiarimenti vedi esempi pratici al seguente sito.
http://hk-lisse.over-blog.com/tag/prorealtime%20backtest/
Grazie, è più chiaro ora, si è utilizzato Darvas boxes codici dal sito HK-Lisse!
La strategia sembra giusto per me, come ho detto. L’unico problema che ho avuto è che il TakeProfit e stoploss sono un po ‘sovradattamento a mio parere. E ‘lo stesso caso per i periodi WilderAverage: 200 * 8 per posizione long e 218 * 7 per un breve? Ha ottimizzato themw con ProBacktest ottimizzatore?
Ti sto chiedendo a queste domande, perché molte persone faranno lo stesso se il codice è pubblicato nella libreria di codici 🙂
AlexParticipant
Junior
Per avere un DD basso io ho optato questo tipo di setup di media mobile,ma si possono trovare altri setup di media,profitto e stop losss e di equilibrio vistoche non e una strateggia di lungo periodo ma quasi intraday,ho ottimizzato themw con ProBacktest ottimizzatore? si.
AlexParticipant
Junior
a mio parere le medie mobili di lungo periodo dara una ottimizzazione automatica anche per il futuro.
È la strategia non va bene con lo stesso movimento periodo medio per le posizioni LONG e SHORT?
Si consiglia di utilizzare il valore reale invece troppo:
wilderaverage[1600](close)
Si dovrebbe anche cercare di ottimizzare il TakeProfit e fermare la perdita di valore con un approccio diverso, con “IN SAMPLE” e “OUT OF SAMPLE”.
Ciò significherebbe: ottimizzare dalla data di inizio al 80% dell’intero dati e quindi verificare se i valori ottimizzati per poter lavorare bene nel 20% dei dati che durano.
AlexParticipant
Junior
Di fatti sono state messe di periodo diverso le medie mobili appunto per questo motivo,troppi falsi segnali
AlexParticipant
Junior
Nicolas un chiarimento sulle strategie che faccio io, comincio a lavorare in un trading system che fa solo Long,poi lavoro con la stesso trading system che lavora solo short,ottimizzando long e short separatamente,unisco i due trading system cercando un equilibrio e ottengo questi risultati.
AlexParticipant
Junior
ciao nicolas ma come mai ancora non posti questo trading system,perche ne ho altri piu interessanti tipo allego foto.