Expert Advisor

My Picky Breakout Expert Advisor Forex è basato su una strategia di trading giornaliero breakout semplice.
Entra posizione lunga se la barra precedente è elevato sopra precedenti 8 massimi;
ti entra posizione corta se la barra precedente bassa è al di sopra precedenti 8 bassi.
La posizione viene mantenuta aperta per 5 bar (giorni) o fino a quando il segnale d'inversione è generato.
I segnali vengono generati solo il martedì, mercoledì e giovedì.
Non sono previsti livelli di stop loss o profit .
L'expert Advisor controlla esplicitamente l'apertura di nuovi bar.

Il back-test del MT4 Expert advisor MyPickyBreakout su più anni, 4, ha dato i seguenti risultati
per EUR/USD, timeframe giornaliero e 0,1 volume del lotto standard per posizione - 2.776 dollari
di profitto netto a 10 mila dollari a partire account con il relativo prelievo massimo al 8,15%.
Si tratta di un termine a basso rischio EA lungo.

Mini Domande.
Quali sono gli stop-loss e take-profit utilizzato da questo EA?

Non usa stop-loss o livelli di take-profit. Va a chiudere i suoi ordini.

Quanto spesso lo scambio?

Il quotidiano EUR/USD grafico (le impostazioni ottimali) questo EA commercio 2-3 volte al mese.

Quali parametri di input insolito utilizza?
•BarsToLookUp (default = 8) - barre (giorni) da confrontare con l'ultima barra per determinare se il breakout è accaduto.
•MinDiff (default = 3) - importo minimo di pips di differenza tra alti bar 'o bassi a ritenere che una maggiore o minore di un altro.
•MaxDuration (default = 5) - durata massima di posizioni in bar (giorni).


 




//+------------------------------------------------------------------+ //| myPickyBreakout.mq4 | //| Copyright © 2009 | //| | //| | //| | //+------------------------------------------------------------------+ #property copyright "Copyright © 2009, EarnForex.com" #property link "http://www.earnforex.com" extern double Lots = 0.1; extern double Slippage = 5; extern int BarsToLookUp = 8; extern int MinDiff = 3; extern int MaxDuration = 5; int Magic; int Duration = 0; int LastBars = 0; int OT; int init() { Magic = Period()+59172491; return(0); } //+------------------------------------------------------------------+ //| Random entry expert advisor | //+------------------------------------------------------------------+ int start() { if (AccountFreeMargin() < (Lots*2*1000)) { //Print("Free margin level is too low."); return(0); } if (Lots < 0.01) { Print("Lots below 0.01."); return(0); } //Wait for the new Bar in a chart. if (LastBars == Bars) return(0); else LastBars = Bars; int count = 0; int total = OrdersTotal(); for (int pos = 0; pos < total; pos++) { if (OrderSelect(pos, SELECT_BY_POS) == false) continue; if ((OrderMagicNumber() == Magic) && (OrderSymbol() == Symbol())) { OT = OrderTicket(); count = 1; Duration++; } } if (Duration == MaxDuration) { CloseOrder(OT); count = 0; } //Let's check if the last bar was highest high or lowest low in BarsToLookUp last bars int H = 0; int L = 0; for (int i = 2; i <= (BarsToLookUp+1); i++) { if ((High[1] - High[i]) > MinDiff*Point) H++; if ((Low[i] - Low[1]) > MinDiff*Point) L++; } //Trade only on Tuesdays, Wednesdays and Thursdays if ((DayOfWeek() < 2) || (DayOfWeek() > 4)) return(0); if ((H == BarsToLookUp) && (L == BarsToLookUp)) { if (count > 0) return(0); if (Close[1] >= Open[1]) fBuy(); else fSell(); } else if (H == BarsToLookUp) { if ((count > 0) && (OrderType() == OP_SELL)) CloseOrder(OT); if (!((count > 0) && (OrderType() == OP_BUY))) fBuy(); } else if (L == BarsToLookUp) { if ((count > 0) && (OrderType() == OP_BUY)) CloseOrder(OT); if (!((count > 0) && (OrderType() == OP_SELL))) fSell(); } } //+------------------------------------------------------------------+ //| Buy | //+------------------------------------------------------------------+ void fBuy() { RefreshRates(); int result = OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,0,0,"myPickyBreakout",Magic,0); if (result == -1) { int e = GetLastError(); Print(e); } Duration = 0; } //+------------------------------------------------------------------+ //| Sell | //+------------------------------------------------------------------+ void fSell() { RefreshRates(); int result = OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,0,0,"myPickyBreakout",Magic,0); if (result == -1) { int e = GetLastError(); Print(e); } Duration = 0; } //+------------------------------------------------------------------+ //| Close all orders opened by this EA | //+------------------------------------------------------------------+ void CloseOrder(int OT) { RefreshRates(); if (OrderType() == OP_BUY) OrderClose(OT, Lots, Bid, Slippage); if (OrderType() == OP_SELL) OrderClose(OT, Lots, Ask, Slippage); Duration = 0; }