TS Dax Bias 30Min – Entrata chiusura mercato
Forums › ProRealTime forum Italiano › Supporto ProOrder › TS Dax Bias 30Min – Entrata chiusura mercato
- This topic has 6 replies, 3 voices, and was last updated 2 years ago by fifi743.
-
-
09/10/2022 at 10:50 AM #200468
Buongiorno a tutti, non sono sicuro sia l’area giusta del forum per questa richiesta.
Posto questo T.S. che lavora sul Dax sfruttando la tendenza rialzista dopo la chiusura del mercato. Il sistema lavora su più timeframe ed è stato ottimizzato escludendo alcuni giorni del mese che statisticamente hanno una tendenza opposta. Il backtest è su timeframe a 30min ma dovrebbe poi girare su TF 5minuti per la miglior gestione del trailing stop.
Chiedo cortesemente se avete qualche suggerimento per filtrare/migliorare le entrate e se ritenete che il sistema è overfitted .
TS Bis Dax 30M123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687//-------------------------------------------------------------------------// Codice principale : 2022 Bias Dax 30M - 5M Chiusura//-------------------------------------------------------------------------// Definizione dei parametri del codiceDEFPARAM CumulateOrders = False // Posizioni cumulate disattivate//-------------------------------------------------------------------------//-------------------------------------------------------------------------TIMEFRAME (5 hours, UPDATEONCLOSE)//FILTROONCE TORO = close[1] > open[1]Body = abs(close - open)LongCond = TORO AND (Body > (Range * bd))timeframe (30 minutes, updateonclose)//-------------------------------------------------------------------------------------------------------------------------------------------------// Condizioni per entrare su posizioni longif not onmarket and currenttime=173000 and day <> 5 and day <> 17 and day <> 18 and day <> 21 and day <> 23 and day <> 25 and day <> 26 and LongCond THENBUY 2 CONTRACT AT MARKETSET STOP $LOSS slENDIF//-------------------------------------------------------------------------------------------------------------------------------------------------timeframe (default)// Condizioni per uscire da posizioni longif currenthour=end THENSELL AT MARKETENDIF//trailing stop functionIF NOT ONMARKET THENTrailingStart = st //20 trailing will start @trailinstart points profitTrailingStep = 5 //5 trailing step to move the "stoploss"Distance = 5 //7 pips Distance from caurrent price (if required by the broker)PointsToKeep = ptk //1 pips to be gained when breakeven is set//reset the stoploss valuenewSL=0ENDIFIF (BarIndex - TradeIndex) >= 0 THEN //0//manage long positionsIF LONGONMARKET THEN//first move (breakeven)IF newSL=0 AND close-TradePrice(1)>=(TrailingStart*PipSize+PointsToKeep*PipSize) THENnewSL = TradePrice(1)+TrailingStep*PipSize+PointsToKeep*PipSizeENDIF//next movesIF newSL>0 AND close-newSL>=TrailingStep*PipSize THENnewSL = newSL+TrailingStep*PipSizeENDIFENDIF//manage short positionsIF SHORTONMARKET THEN//first move (breakeven)IF newSL=0 AND TradePrice(1)-close>=(TrailingStart*PipSize+PointsToKeep*PipSize) THENnewSL = TradePrice(1)-TrailingStep*PipSize+PointsToKeep*PipSizeENDIF//next movesIF newSL>0 AND newSL-close>=TrailingStep*PipSize THENnewSL = newSL-TrailingStep*PipSizeENDIFENDIF//stop order to exit the positionsIF newSL>0 THENIF LongOnMarket THENIF (close + Distance) > newSL THENSELL AT newSL STOPELSIF (close - Distance) < newSL THENSELL AT newSL LIMITELSESELL AT MarketENDIFELSIF ShortOnmarket THENIF (close + Distance) < newSL THENEXITSHORT AT newSL STOPELSIF (close - Distance) > newSL THENEXITSHORT AT newSL LIMITELSEEXITSHORT AT MarketENDIFENDIFENDIFendifsET TARGET PPROFIT sp09/10/2022 at 10:59 AM #20047009/12/2022 at 9:30 AM #20059909/12/2022 at 1:39 PM #200615revised123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596//-------------------------------------------------------------------------// Codice principale : 2022 Bias Dax 30-5M Chiusura//-------------------------------------------------------------------------//-------------------------------------------------------------------------// Codice principale : 2022 Bias Dax 30M - 5M Chiusura//-------------------------------------------------------------------------// Definizione dei parametri del codiceDEFPARAM CumulateOrders = False // Posizioni cumulate disattivate//-------------------------------------------------------------------------//-------------------------------------------------------------------------ONCE bd = 0.16ONCE end = 8.0ONCE ptk = 95.0ONCE sl = 330.0ONCE sp = 335.0ONCE st = 25.0TIMEFRAME (4 hours, UPDATEONCLOSE)//FILTROONCE TORO = close[1] > open[1]Body = abs(close - open)LongCond = TORO AND (Body > (Range * bd))timeframe (30 minutes, updateonclose)//-------------------------------------------------------------------------------------------------------------------------------------------------// Condizioni per entrare su posizioni longif not onmarket and currenttime=173000 and day <> 5 and day <> 17 and day <> 18 and day <> 21 and day <> 23 and day <> 25 and day <> 26 THENBUY 2 CONTRACT AT MARKETSET STOP $LOSS slENDIF//-------------------------------------------------------------------------------------------------------------------------------------------------timeframe (default)// Condizioni per uscire da posizioni longif currenthour=end THENSELL AT MARKETENDIF//trailing stop functionIF NOT ONMARKET THENTrailingStart = st //20 trailing will start @trailinstart points profitTrailingStep = 5 //5 trailing step to move the "stoploss"Distance = 5 //7 pips Distance from caurrent price (if required by the broker)PointsToKeep = ptk //1 pips to be gained when breakeven is set//reset the stoploss valuenewSL=0ENDIFIF (BarIndex - TradeIndex) >= 0 THEN //0//manage long positionsIF LONGONMARKET THEN//first move (breakeven)IF newSL=0 AND close-TradePrice(1)>=(TrailingStart*PipSize+PointsToKeep*PipSize) THENnewSL = TradePrice(1)+TrailingStep*PipSize+PointsToKeep*PipSizeENDIF//next movesIF newSL>0 AND close-newSL>=TrailingStep*PipSize THENnewSL = newSL+TrailingStep*PipSizeENDIFENDIF//manage short positionsIF SHORTONMARKET THEN//first move (breakeven)IF newSL=0 AND TradePrice(1)-close>=(TrailingStart*PipSize+PointsToKeep*PipSize) THENnewSL = TradePrice(1)-TrailingStep*PipSize+PointsToKeep*PipSizeENDIF//next movesIF newSL>0 AND newSL-close>=TrailingStep*PipSize THENnewSL = newSL-TrailingStep*PipSizeENDIFENDIF//stop order to exit the positionsIF newSL>0 THENIF LongOnMarket THENIF (close + Distance) > newSL THENSELL AT newSL STOPELSIF (close - Distance) < newSL THENSELL AT newSL LIMITELSESELL AT MarketENDIFELSIF ShortOnmarket THENIF (close + Distance) < newSL THENEXITSHORT AT newSL STOPELSIF (close - Distance) > newSL THENEXITSHORT AT newSL LIMITELSEEXITSHORT AT MarketENDIFENDIFENDIFendifsET TARGET PPROFIT spCiao Nicolas, ho ripostato il codice escludendo il filtro perchè non funziona. Riposto risultati backtest senza filtro e attendo suggerimenti. Grazie
1 user thanked author for this post.
09/13/2022 at 8:38 AM #200675Grazie mille per il codice completo. Come hai ottenuto le impostazioni per ciascuna delle tue variabili, per favore? Hai fatto un'ottimizzazione per tutto il periodo e per quante unità? Qual è lo spread utilizzato per favore?
09/14/2022 at 4:09 PM #20080409/14/2022 at 6:02 PM #200816 -
AuthorPosts
Find exclusive trading pro-tools on