Il modello che adotto, infatti, ignora i vincoli della teoria classica (due anomalie tipiche sono racchiuse negli ovali) e si preoccupa, piuttosto, di cercare quei ritmi che gli consentono di risultare vincente ed efficace, anche a scapito della perfezione ciclica. Finora ci è riuscito perfettamente.Per la cronaca, è stato studiato da tempo e regolarmente monitorato e tradato; non si tratta, dunque, di quei modelli ex-post che risultano vincenti per definizione.
Il punto di svolta calcolato dovrebbe cadere proprio oggi 30 giugno; se fosse automatizzato, il modello invertirebbe posizione questa sera, al valore di chiusura. Di fatto, il ciclo potrebbe chiudere lunedì o martedì. Deviazioni più ampie rappresenterebbero una defaillance.
Per replicare la regolarità trascorsa, saranno necessarie intorno alle tre settimane; monitoreremo e verificheremo in prossimità della scadenza "adesso" presunta, da affinare sempre più man mano che si avvicina. L’obiettivo è che, alla fine, il valore dell’Eurostoxx risulti più elevato di quello attuale. Le oscillazioni intermedie, anche corpose e anche se dovessero toccare nuovi minimi, andrebbero ignorate. Fin qui il modello, letto con assoluta obiettività e senza opinioni personali. Che, poi, ciascuno di noi (mi metto in cima alla lista) abbia la “pancia” per assecondarlo è tutta un’altra questione.
Buon weekend a tutti.
Aspetto veramente con molta curiosità qualche riflessione di Natale ..... la mia idea sullo scale trading iniziale puo' sembrare molto scolastica e quasi banale ma vi assicuro che e' stata quella di partenza. Da quella idea attualmente opero con la piattaforma Metatrader 4 che gira H24 su un server dedicato situato in Francia. Sulla piattaforma gira un expert advisor (programma di trading automatico) scritto in linguaggio C (che ho dovuto studiare per 1 anno). Opero su un grafico a 5 Minuti prevalentemente con le coppie EurChf e EurUsd e dopo tanta fatica e tanto studio per la prima volta nella mia lunga esperienza con i mercati finanziari posso dire con onesta' intellettuale che non perdo più soldi. Dirò di più .... da inizio anno ad oggi stanno anche lentamente ma costantemente iniziando a rientrare ....
Il mio "stato dell'arte" è al momento il mio fondo LFS che può essere visionato su https://www.darwinex.com/darwin/LFS.4.16
Ci tengo a precisare che non mi sto facendo pubblicità ne la faccio per altri ma questo broker inglese ha avuto un'idea veramente geniale e mette in contatto investitori e trader. La mia strategia è quindi monitorata giornalmente e analizzata con loro algoritmi quindi essenzialmente "valuata" nel modo più oggettivo possibile. Tutto questo a suffragio della mia affermazione ... non perdo più denaro ....
Aspetto veramente con molta curiosità qualche riflessione di Natale ..... la mia idea sullo scale trading iniziale puo' sembrare molto scolastica e quasi banale ma vi assicuro che e' stata quella di partenza. Da quella idea attualmente opero con la piattaforma Metatrader 4 che gira H24 su un server dedicato situato in Francia. Sulla piattaforma gira un expert advisor (programma di trading automatico) scritto in linguaggio C (che ho dovuto studiare per 1 anno). Opero su un grafico a 5 Minuti prevalentemente con le coppie EurChf e EurUsd e dopo tanta fatica e tanto studio per la prima volta nella mia lunga esperienza con i mercati finanziari posso dire con onesta' intellettuale che non perdo più soldi. Dirò di più .... da inizio anno ad oggi stanno anche lentamente ma costantemente iniziando a rientrare ....
Il mio "stato dell'arte" è al momento il mio fondo LFS che può essere visionato su https://www.darwinex.com/darwin/LFS.4.16
Ci tengo a precisare che non mi sto facendo pubblicità ne la faccio per altri ma questo broker inglese ha avuto un'idea veramente geniale e mette in contatto investitori e trader. La mia strategia è quindi monitorata giornalmente e analizzata con loro algoritmi quindi essenzialmente "valuata" nel modo più oggettivo possibile. Tutto questo a suffragio della mia affermazione ... non perdo più denaro ....
//+------------------------------------------------------------------+//| UpndDown.mq4 |//| Copyright 2016, Luigi Giammarini |//| //+------------------------------------------------------------------+#property copyright "Luigi Giammarini"#property link ""#property version "1.5"#property strict
extern double CapIniziale = 100.0; // Capitale Inizialeextern int _MagicNumber = 1010; // Magic Numberextern double Lot = 0.01; // Lottiextern int PuntiGapStop = 100; // Distanza in Pip fra gli ordiniextern bool DBuy = true; // se vuole iniziare con Buy true altrimenti falseextern bool DSell = false; // se vuole iniziare con Sell true altrimenti falseextern int MaxOrdiniClose = 10; // Numero massimo di Ordini apertiextern double Perdita = 20.0; // Perdita Massima totaleextern double Utile = 1.0; // Utile per chiusura ordiniextern int MaxSlip = 0; // massimo slippage
//------------------------------------ Variabili globalidouble _Lot;double Prezzo=Bid;double openbuylots=0;double openselllots=0;double TotLottiAperti=0;double Grid1=0;double Grid0=0;double Grid_1=0;
int Conto=0;int MaxOrdiniAperti;
//-------------------------------------
int start()
{ int _GetLastError = 0;
//----------------------------------------Calcolo Ordini Aperti
int total = OrdersTotal();int i=0;int OpenLongOrders = 0, OpenShortOrders = 0, PendLongs =0, PendShorts =0;int PendLimitLongs = 0, PendLimitShorts = 0; for( i=0;i<total;i++) { if (OrderSelect(i, SELECT_BY_POS )) { if ( OrderSymbol() == Symbol() && OrderMagicNumber() == _MagicNumber) { int type = OrderType();
if (type == OP_BUY ) {OpenLongOrders=OpenLongOrders+1;}if (type == OP_SELL ) {OpenShortOrders=OpenShortOrders+1;}if (type == OP_BUYSTOP ) {PendLongs=PendLongs+1;}if (type == OP_SELLSTOP ) {PendShorts=PendShorts+1;}if (type == OP_BUYLIMIT ) {PendLimitLongs=PendLongs+1;}if (type == OP_SELLLIMIT ) {PendLimitShorts=PendShorts+1;} } } }//--------------------------------calcolo lotti aperti
openbuylots = 0; openselllots = 0; // set the variables to zero int iPos=0; for(iPos=OrdersTotal()-1; iPos>=0; iPos--) if (OrderSelect(iPos,SELECT_BY_POS,MODE_TRADES) && OrderMagicNumber()==_MagicNumber && OrderSymbol() ==Symbol() ){ if(OrderType()==OP_BUY) openbuylots = openbuylots+OrderLots(); if(OrderType()==OP_SELL) openselllots = openselllots+OrderLots(); } //--------------------------------CALCOLO PROFITTO PER SIMBOLO double Profit=0;
//---------------------------------------------ORDINI APERTI
for(int cnt=0; cnt<OrdersTotal(); cnt++) { if (!OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES)) continue; if(OrderSymbol()==Symbol() && OrderMagicNumber()==_MagicNumber) { Profit = Profit + OrderProfit(); } } int TotOrdiniAperti= OpenLongOrders+OpenShortOrders; MaxOrdiniAperti = TotOrdiniAperti; TotLottiAperti = openbuylots+openselllots; //--------------------------------------------------- Stringhe per Informazioni string Profitto=DoubleToString(Profit, 2); string MassimoOrdiniAperti=DoubleToString(MaxOrdiniAperti,0); string LongAperti=DoubleToString(openbuylots, 2); string ShortAperti=DoubleToString(openselllots, 2); string LottiAperti=DoubleToString(TotLottiAperti,2); string Capitale=DoubleToString(AccountBalance(),2);
//-----------------------------------------------------INFORMAZIONI ObjectsDeleteAll(0, OBJ_LABEL);
//--------------------------------------------------------------------OpenBuy ObjectCreate("Commento2", OBJ_LABEL, 0, 0, 0); ObjectSetText("Commento2", "LottiBuy",10, "Verdana", Black); ObjectSet("Commento2", OBJPROP_CORNER, 1); ObjectSet("Commento2", OBJPROP_XDISTANCE, 27); ObjectSet("Commento2", OBJPROP_YDISTANCE, 40); ObjectCreate("OpenBuy", OBJ_LABEL, 0, 0, 0); ObjectSetText("OpenBuy", LongAperti,10, "Verdana", Black); ObjectSet("OpenBuy", OBJPROP_CORNER, 1); ObjectSet("OpenBuy", OBJPROP_XDISTANCE, 95); ObjectSet("OpenBuy", OBJPROP_YDISTANCE, 40); //--------------------------------------------------------------------OpenSell ObjectCreate("Commento3", OBJ_LABEL, 0, 0, 0); ObjectSetText("Commento3", "LottiSell",10, "Verdana", Black); ObjectSet("Commento3", OBJPROP_CORNER, 1); ObjectSet("Commento3", OBJPROP_XDISTANCE, 27); ObjectSet("Commento3", OBJPROP_YDISTANCE, 60); ObjectCreate("OpenSell", OBJ_LABEL, 0, 0, 0); ObjectSetText("OpenSell", ShortAperti,10, "Verdana", Black); ObjectSet("OpenSell", OBJPROP_CORNER, 1); ObjectSet("OpenSell", OBJPROP_XDISTANCE, 95); ObjectSet("OpenSell", OBJPROP_YDISTANCE, 60); //--------------------------------------------------------------------Profitto ObjectCreate("Commento4", OBJ_LABEL, 0, 0, 0); ObjectSetText("Commento4", "Profitto",12, "Verdana", Black); ObjectSet("Commento4", OBJPROP_CORNER, 1); ObjectSet("Commento4", OBJPROP_XDISTANCE, 20); ObjectSet("Commento4", OBJPROP_YDISTANCE, 80); ObjectCreate("Profitto", OBJ_LABEL, 0, 0, 0); ObjectSetText("Profitto", Profitto,12, "Verdana", Black); ObjectSet("Profitto", OBJPROP_CORNER, 1); ObjectSet("Profitto", OBJPROP_XDISTANCE, 95); ObjectSet("Profitto", OBJPROP_YDISTANCE, 80); //--------------------------------------------------------------------MaxOrdini ObjectCreate("Commento5", OBJ_LABEL, 0, 0, 0); ObjectSetText("Commento5", "Aperti",10, "Verdana", Black); ObjectSet("Commento5", OBJPROP_CORNER, 1); ObjectSet("Commento5", OBJPROP_XDISTANCE, 42); ObjectSet("Commento5", OBJPROP_YDISTANCE, 20); ObjectCreate("Aperti", OBJ_LABEL, 0, 0, 0); ObjectSetText("Aperti", MassimoOrdiniAperti,10, "Verdana", Black); ObjectSet("Aperti", OBJPROP_CORNER, 1); ObjectSet("Aperti", OBJPROP_XDISTANCE, 95); ObjectSet("Aperti", OBJPROP_YDISTANCE, 20); //--------------------------------------------------------------------Capitale ObjectCreate("Commento6", OBJ_LABEL, 0, 0, 0); ObjectSetText("Commento6", "Capitale",10, "Verdana", Black); ObjectSet("Commento6", OBJPROP_CORNER, 1); ObjectSet("Commento6", OBJPROP_XDISTANCE, 27); ObjectSet("Commento6", OBJPROP_YDISTANCE, 100); ObjectCreate("Capitale", OBJ_LABEL, 0, 0, 0); ObjectSetText("Capitale", Capitale,10, "Verdana", Black); ObjectSet("Capitale", OBJPROP_CORNER, 1); ObjectSet("Capitale", OBJPROP_XDISTANCE, 95); ObjectSet("Capitale", OBJPROP_YDISTANCE, 100); ChartRedraw(); //-------------------------------------------------- Inizio Sequenza Ordini (Buy) if ( PendLongs==0 && PendShorts==0 && OpenLongOrders==0 && OpenShortOrders==0 && Conto==0 && DBuy==true ) { double Base=Bid; int PrimoGap=PuntiGapStop; int Gap=PuntiGapStop; Grid0=NormalizeDouble (Base, Digits); Grid1=NormalizeDouble(Grid0+(PrimoGap*Point),Digits); Grid_1=NormalizeDouble(Grid0-(PrimoGap*Point),Digits); Conto=1; } if ( (Close[0] >= Grid0) && (PendLongs==0 && PendShorts==0)&& (PendLimitLongs==0 && PendLimitShorts==0) && Conto==1 ) { if(OrderSend(Symbol(), OP_BUY, Lot, Ask, MaxSlip , 0.0, 0.0, "Buystop",_MagicNumber, 0, Red ) < 0 ) { _GetLastError = GetLastError(); Alert( "Error OrderSend buy primo № ", _GetLastError ); return(-1); }
if(OrderSend(Symbol(), OP_SELLSTOP, Lot, Grid_1, MaxSlip , 0.0, 0.0, "Buystop",_MagicNumber, 0, Red ) < 0 ) { _GetLastError = GetLastError(); Alert( "Error OrderSend buy primo № ", _GetLastError ); return(-1); } }//+------------------------------------------------------------------Ordini contrapposti if ( (Close[0] <= Grid_1)&& (PendLimitLongs==0 && PendLimitShorts==0) && (PendLongs==0 && PendShorts==0)&& Conto==1 ) { if(OrderSend(Symbol(), OP_BUYSTOP, Lot , Grid0, MaxSlip , 0.0, 0.0, "Buystop",_MagicNumber, 0, Red ) < 0 ) { _GetLastError = GetLastError(); Alert( "Error OrderSend buy primo № ", _GetLastError ); return(-1); } if(OrderSend(Symbol(), OP_SELL, Lot, Bid, MaxSlip , 0.0, 0.0, "Buystop",_MagicNumber, 0, Red ) < 0 ) { _GetLastError = GetLastError(); Alert( "Error OrderSend buy primo № ", _GetLastError ); return(-1); } } //+------------------------------------------------------------Inizio Sequenza Ordini (Sell)
if ( PendLongs==0 && PendShorts==0 && OpenLongOrders==0 && OpenShortOrders==0 && Conto==0 && DSell==true ) { double Base=Bid; int PrimoGap=PuntiGapStop; int Gap=PuntiGapStop; int SL=200; int TP=0; Grid0=NormalizeDouble (Base, Digits); Grid1=NormalizeDouble(Grid0+(PrimoGap*Point),Digits); Grid_1=NormalizeDouble(Grid0-(PrimoGap*Point),Digits); Conto=2; } if ( (Close[0] >= Grid1) && (PendLongs==0 && PendShorts==0)&& (PendLimitLongs==0 && PendLimitShorts==0) && Conto==2 ) { if(OrderSend(Symbol(), OP_BUY, Lot, Ask, MaxSlip , 0.0, 0.0, "Buystop",_MagicNumber, 0, Red ) < 0 ) { _GetLastError = GetLastError(); Alert( "Error OrderSend buy primo № ", _GetLastError ); return(-1); }
if(OrderSend(Symbol(), OP_SELLSTOP, Lot, Grid0, MaxSlip , 0.0, 0.0, "Buystop",_MagicNumber, 0, Red ) < 0 ) { _GetLastError = GetLastError(); Alert( "Error OrderSend buy primo № ", _GetLastError ); return(-1); } }//+--------------------------------------------------------------Ordini contrapposti if ( (Close[0] <= Grid0)&& (PendLimitLongs==0 && PendLimitShorts==0) && (PendLongs==0 && PendShorts==0)&& Conto==2 ) { if(OrderSend(Symbol(), OP_BUYSTOP, Lot , Grid1, MaxSlip , 0.0, 0.0, "Buystop",_MagicNumber, 0, Red ) < 0 ) { _GetLastError = GetLastError(); Alert( "Error OrderSend buy primo № ", _GetLastError ); return(-1); } if(OrderSend(Symbol(), OP_SELL, Lot, Bid, MaxSlip , 0.0, 0.0, "Buystop",_MagicNumber, 0, Red ) < 0 ) { _GetLastError = GetLastError(); Alert( "Error OrderSend buy primo № ", _GetLastError ); return(-1); } } //+------------------------------------------------------------------+// CHISURA ORDINI //+------------------------------------------------------------------+ double Stop = Perdita*(Lot*100); double Target = Utile*(Lot*100); if ( Profit > Target || (OpenLongOrders+OpenShortOrders)>MaxOrdiniClose || Profit < - Stop ) { if (Profit > Target && openbuylots>openselllots) {DBuy=true; DSell=false;} if (Profit > Target && openselllots>openbuylots) {DBuy=false; DSell=true;} Conto=0; int totals = OrdersTotal(); for(int ii=totals-1;ii>=0;ii--) { if (OrderSelect(ii, SELECT_BY_POS)) { int type = OrderType();
bool result = false; switch(type) { //Close opened long positions case OP_BUY : result = OrderClose( OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_BID), 5, Red ); break; //Close opened short positions case OP_SELL : result = OrderClose( OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_ASK), 5, Red ); break;
//Close pending orders case OP_BUYLIMIT : case OP_BUYSTOP : case OP_SELLLIMIT : case OP_SELLSTOP : result = OrderDelete( OrderTicket() ); } Conto=0; if(result == false) { Alert("Order " , OrderTicket() , " failed to close. Error:" , GetLastError() ); Sleep(3000); } } } return(0); } return(0); } //-------------------------------------------------------------------------- if ( Profit > Target || (OpenLongOrders+OpenShortOrders)>MaxOrdiniClose || Profit < - Stop ) >>I periodi di trend definito, in particolar modo per le valute, ma vale anche per gli indici, le materie prime ecc.ecc. sono statisticamente di minor durata rispetto ai periodi laterali. Se quindi si riesce a gestire senza troppi danni il periodo di trend e si guadagna nel laterale si porta la statistica dalla propria parte ...
Come ho detto, devo verificare se il mio schema pseudo-ciclico sugli indici funziona anche con le divise.
//-----------------------------------Std----------------------------------------------------------------------------------- sq=0.0; for(n=i0;n<=i0+p;n++) { sq+=MathPow(Close[n]-fx[n],2); } sq=MathSqrt(sq/(p+1))*kstd;
for(n=i0;n<=i0+p;n++) { sqh[n]=fx[n]+sq; sql[n]=fx[n]-sq; }//+------------------------------------------------------------------+//| BA-Regression.mq4 |//| Copyright 2017, Quelli di Borsanalisi |//+------------------------------------------------------------------+#property copyright "http://quellidiborsanalisi.blogspot.it/"#property link "http://quellidiborsanalisi.blogspot.it/"#property version "1.0"#property strict
extern int _MagicNumber = 1010; // Magic Numberextern double Lot = 0.01; // Lottiextern int MaxSlip = 0; // massimo slippageinput int degree =3;input double kstd =2.0;input int bars =250;input int shift =0;
//------------------------------------ Variabili globalidouble _Lot;double Prezzo=Bid;double openbuylots=0;double openselllots=0;double TotLottiAperti=0;double LineaAlta;double LineaBassa;double LineaRegressione;
int Conto=0;int MaxOrdiniAperti;
//-------------------------------------
int start()
{ int _GetLastError = 0; //---------------------------------------- Assegno parametriint A=degree;double B=kstd;int C=bars;int D=shift;//-------------------------------------------------- Indicatore
LineaAlta = iCustom(NULL,0,"i-Regr",A,B,C,D,1,0); LineaBassa = iCustom(NULL,0,"i-Regr",A,B,C,D,2,0); LineaRegressione = iCustom(NULL,0,"i-Regr",A,B,C,D,0,0); //-------------------------------------------------- Inizio Sequenza Ordini (Buy) if ( OpenLongOrders<1 && Close[0] < LineaBassa ) { if(OrderSend(Symbol(), OP_BUY, Lot, Ask, MaxSlip , 0.0, 0.0, "Buystop",_MagicNumber, 0, Red ) < 0 ) { _GetLastError = GetLastError(); Alert( "Error OrderSend buy primo № ", _GetLastError ); return(-1); } }
//+------------------------------------------------------------Inizio Sequenza Ordini (Sell)
if ( OpenShortOrders<1 && Close[0] > LineaAlta ) { if(OrderSend(Symbol(), OP_SELL, Lot, Bid, MaxSlip , 0.0, 0.0, "Buystop",_MagicNumber, 0, Red ) < 0 ) { _GetLastError = GetLastError(); Alert( "Error OrderSend buy primo № ", _GetLastError ); return(-1); } } //+------------------------------------------------------------------+// CHISURA ORDINI //+------------------------------------------------------------------+ if ( (OpenLongOrders > 0 && Close[0] > LineaRegressione) || (OpenShortOrders > 0 && Close[0] < LineaRegressione) ) { int totals = OrdersTotal(); for(int ii=totals-1;ii>=0;ii--) { if (OrderSelect(ii, SELECT_BY_POS)) { int type = OrderType();
bool result = false; switch(type) { //Close opened long positions case OP_BUY : result = OrderClose( OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_BID), 5, Red ); break; //Close opened short positions case OP_SELL : result = OrderClose( OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_ASK), 5, Red ); break;
//Close pending orders case OP_BUYLIMIT : case OP_BUYSTOP : case OP_SELLLIMIT : case OP_SELLSTOP : result = OrderDelete( OrderTicket() ); } if(result == false) { Alert("Order " , OrderTicket(), " failed to close. Error:" , GetLastError() ); Sleep(3000); } } } return(0); } return(0); } //--------------------------------------------------------------------------