Hybrid Robo-advisor

Tuesday, March 24, 2015

Trading automatico con Sella.it - #bancasella #widetrader #multicharts


Il trading system "PIVOTEM" per il FTSEMIB future



Gentile Lettore,

come regalo di Natale ai fedelissimi ho deciso di allegare un listato basato sui pivot point che produce buoni risultati in sample (senza aver prodotto iper ottimizzazioni) e che può essere uno dei tanti punti di partenza per i propri studi su strategie di trading ed algoritmi.

Segue il listato[1] in formato testo e i risultati sul FTSEMIB future a 60 minuti già conteggiati 30 € di slippage a trade.
La strategia si basa sull’acquisto (caso long) in stop alla rottura del punto di pivot filtrato con una media a 20 periodi e l’indicatore Ematrend (presente sia su Visualtrader che sulla nuova Multicharts 9). Quando si arriva in ipercomprato di breve (calcolato con RSI a 14 periodi) sopra 80 si chiude la posizione. Simmetricamente per lo short.

{PIVOTEM
copyright 2014 @ Enrico Malverti}

var: AP(0), PVH1(0), PVL1(0), PVH2(0), PVL2(0);
Var: mioosc(0);
Input: maxstop(750), profittarget(1000), len(21), mult(3);
mioosc = ematrend(mult,len);
AP = ( High + Low + Close ) / 3;

PVH1 = ( 2 * AP ) - L;

PVL1 = ( 2 * AP ) - H;

PVH2 = AP - PVL1 + PVH1;

PVL2 = AP - PVH1 + PVL1;

if marketposition = 0 and T >= 1000 and T <= 1700  
and C > average(C, 20)
and C > mioosc
then buy next bar at PVH2 stop;
if marketposition = 0 and t >= 1000 and T <= 1700
and C < average(C, 20)
and  C < mioosc
then sellshort next bar at PVL2 stop;


setstoploss(maxstop);

if marketposition = 1 and RSI(C, 14) > 80 then sell next bar at open;
if marketposition = -1 and RSI(C, 14) < 20 then buytocover next bar at open;

Strategy Performance Summary




All Trades
Net Profit
289655
Gross Profit
869990
Gross Loss
-580335
Adjusted Net Profit
195819,196313708
Adjusted Gross Profit
796723,625019134
Adjusted Gross Loss
-600904,428705426
Select Net Profit
-85320
Select Gross Profit
442835
Select Gross Loss
-528155
Account Size Required
31880
Return on Account
908,5790464241
Return on Initial Capital
289,655
Max Strategy Drawdown
-46555
Max Strategy Drawdown (%)
-27,5237222501
Max Close To Close Drawdown
-31880
Max Close To Close Drawdown (%)
-18,8306104901
Return on Max Strategy Drawdown
6,2217806895
Profit Factor
1,4991168894
Adjusted Profit Factor
1,3258741107
Select Profit Factor
-0,8384565137
Max # Contracts Held
1
Slippage Paid
56250
Commission Paid
0
Open Position P/L
45
Annual Rate of Return
16,9624184763
Monthly Rate of Return
1,413534873
Buy & Hold Return
24400,3837543972
Avg Monthly Return
1413,1707317073
Monthly Return StdDev
7635,5645196955




Performance Ratios



Upside Potential Ratio
33,7748920766
Sharpe Ratio
0,138876244
Sortino Ratio
0,2556742091
Fouse Ratio
0,0059371378
Calmar Ratio
0,0129488883
Sterling Ratio
0,0019791284
Net Profit as % of Largest loss
6880,1662707839
Net Profit as % of Max Trade Drawdown
6929,5454545455
Net Profit as % of Max Strategy Drawdown
622,1780689507
Select Net Profit as % of Largest loss
-2026,6033254157
Select Net Profit as % of Max Trade Drawdown
-2041,1483253589
Select Net Profit as % of Max Strategy Drawdown
-183,2671034261
Adj Net Profit as % of Largest loss
4651,287323366
Adj Net Profit as % of Max Trade Drawdown
4684,6697682705
Adj Net Profit as % of Max Strategy Drawdown
420,6190448152




Time Analysis



Trading Period
17 Yrs, 1 Mth, 15 Dys, 2 Hrs, 40 Mins
Time in the Market
13 Yrs, 9 Mths, 8 Dys, 20 Mins
Percent in the Market
80,3739712117
Longest flat period
7 Dys, 2 Hrs
Max Run-up Date
16/10/2009
Max Drawdown Date
28/05/1998
Max Strategy Drawdown Date
21/12/1998 14.00.00
Max Close To Close Drawdown Date
06/10/2008 12.00.00

 
  

[1] Ricordo che il codice ha valenza didattica. Il trading è una attività rischiosa, chi lo utilizzasse per attività di trading lo fa sotto la sua piena ed esclusiva responsabilità.

Trading systems vincenti: la presentazione a Itforum2013

Video della presentazione del libro "Trading systems vincenti" a ITFORUM2013 con Gabriele Villa (Borsa Italiana).