Buongiorno doctrading e buongiorno a tutti.
Vorrei riportare all’attenzione della community il sistema “FINE GIORNATA” postato tre anni fa da doctrading perchè le performance sono ancora interessanti.
Con USD/JPY i backtest sono ottimi negli ultimi 4 mesi, in particolare con timeframe 1 minuto.
Se qualche membro della community ha la possibilità e la pazienza di effettuare backtest più lunghi potrebbe essere utile per capire se questo sistema è veramente ottimo anche nel lungo periodo.
Di seguito propongo una mia versione aggiornata in cui ho inserito la gestione della posizione tramite il sistema KAMA & SMA proposto da Roberto tempo fa, con uno stop fisso a 30.
Defparam cumulateorders = false
// TAILLE DES POSITIONS
n = 1
// PARAMETRES
// high ratio = few positions
// AUD/JPY : ratio = 0.5 / SL = 0.8 / TP = 1.2 / Period = 12
// EUR/JPY : ratio = 0.6 / SL = 1 / TP = 0.8 / Period = 8
// GBP/JPY : ratio = 0.5 / SL = 0.6 / TP = 1 / Period = 8
// USD/JPY : ratio = 0.5 / SL = 1 / TP = 0.8 / Period = 12
ratio = 0.6
period = 8
// HORAIRES
startTime = 210000
endTime = 231500
exitLongTime = 210000
exitShortTime = 80000
// BOUGIE REFERENCE à StartTime
if time = startTime THEN
amplitude = highest[Period](high) - lowest[Period](low)
ouverture = close
endif
// LONGS & SHORTS : every day except Fridays
// entre StartTime et EndTime
if time >= startTime and time <= endTime and dayOfWeek <> 5 then
buy n shares at ouverture - amplitude*ratio limit
sellshort n shares at ouverture + amplitude*ratio limit
endif
// Stop Loss & Take Profit
// Stop e target
//SET STOP PLOSS 25
//SET TARGET PPROFIT 13 //395
//////////////////////////////////////////////////////////////////////////////////////////////////////////
// Trailing Stop
//------------------------------------------------------------------------------------
IF Not OnMarket THEN
TrailStart = 10 //10 Start trailing profits from this point
BasePerCent = 0.100 //10.0% Profit to keep
StepSize = 6 //6 Pips chunks to increase Percentage
PerCentInc = 0.100 //10.0% PerCent increment after each StepSize chunk
RoundTO = -0.5 //-0.5 rounds to Lower integer, +0.4 rounds to Higher integer
PriceDistance = 7 * pipsize//8.9 minimun distance from current price
y1 = 0
y2 = 0
ProfitPerCent = BasePerCent
ELSIF LongOnMarket AND close > (TradePrice + (y1 * pipsize)) THEN //LONG
x1 = (close - tradeprice) / pipsize //convert price to pips
IF x1 >= TrailStart THEN //go ahead only if N+ pips
Diff1 = abs(TrailStart - x1)
Chunks1 = max(0,round((Diff1 / StepSize) + RoundTO))
ProfitPerCent = BasePerCent + (BasePerCent * (Chunks1 * PerCentInc))
ProfitPerCent = max(ProfitPerCent[1],min(100,ProfitPerCent))
y1 = max(x1 * ProfitPerCent, y1) //y = % of max profit
ENDIF
ELSIF ShortOnMarket AND close < (TradePrice - (y2 * pipsize)) THEN//SHORT
x2 = (tradeprice - close) / pipsize //convert price to pips
IF x2 >= TrailStart THEN //go ahead only if N+ pips
Diff2 = abs(TrailStart - x2)
Chunks2 = max(0,round((Diff2 / StepSize) + RoundTO))
ProfitPerCent = BasePerCent + (BasePerCent * (Chunks2 * PerCentInc))
ProfitPerCent = max(ProfitPerCent[1],min(100,ProfitPerCent))
y2 = max(x2 * ProfitPerCent, y2) //y = % of max profit
ENDIF
ENDIF
IF y1 THEN //Place pending STOP order when y>0
SellPrice = Tradeprice + (y1 * pipsize) //convert pips to price
IF abs(close - SellPrice) > PriceDistance THEN
IF close >= SellPrice THEN
SELL AT SellPrice STOP
ELSE
SELL AT SellPrice LIMIT
ENDIF
ELSE
SELL AT Market
ENDIF
ENDIF
IF y2 THEN //Place pending STOP order when y>0
ExitPrice = Tradeprice - (y2 * pipsize) //convert pips to price
IF abs(close - ExitPrice) > PriceDistance THEN
IF close <= ExitPrice THEN
EXITSHORT AT ExitPrice STOP
ELSE
EXITSHORT AT ExitPrice LIMIT
ENDIF
ELSE
EXITSHORT AT Market
ENDIF
ENDIF
set stop ploss 30
Puoi postare un linkal vecchio post?
Ti allego due foto dei backtest fatti con 1M, cioè 1 milione, di barre.
Una è SENZA l’opzione tick-per-tick (ed il periodo di backtest è maggiore), l’altra è CON l’opzione tick-per-tick (ed il backtest parte dall’1/8/2010, prima non era disponibilie).
Molte grazie Roberto.
Non mi sembra ci siano conferme sulla tenuta delle performances…
Buona giornata.