Free Forex Expert Advisor

Expert Advisor

Forex Expert Advisor

ActivTrades: Forex Expert Advisor

Forex EA, trading automatico e tools. Fondamentale per i Forex broker migliorare il trading dei trader con una continua innovazione, corsi di formazi ...

Forex Expert Advisor

Forex EA, trading automatico e tools.

Fondamentale per i Forex broker migliorare il trading dei trader con una continua innovazione, corsi di formazione e webinar ed un servizio di assistenza che risponda con chiarezza e prontamente alle domande. Gli Expert Advisor nel mercato Forex sono molto usati perché permettono di automatizzare il trading online risparmiando tempo e denaro, evitano lo stress emotivo e il coinvolgimento eccessivo. Sia per i trader che utilizzano la piattaforma MT4, la MT5 o la piattaforma di Mobile Trading, un Expert Advisor migliorare nettamente i risultati nel tempo del trading online.

Trading automatizzato con MetaTrader 4

MetaTrader 4 ti offre gli strumenti necessari per automatizzare completamente la tua attività di trading e gestione patrimoniale. Tutti i tipi di Expert Advisor in commercio sono accettati: scalping a breve termine, momentum a medio termine e trend following a lungo termine. Grazie alle risorse programmabili di MetaTrader il trader può scrivere personalmente le proprie regole strategiche, senza sottostare più alla pressione derivante dall’ osservazione del mercato, dalla gestione del rischio e dall’esecuzione delle operazioni di trading. 

Table of Contents:

Come caricare gli EA nella Piattaforma MT4

Guida Expert Advisor.L'utilizzo di Expert advisor Metatrader è semplice, ma a volte le persone si confondono con esso e dopo aver scaricato un file c ...

Guida Expert Advisor.
L'utilizzo di Expert advisor Metatrader è semplice, ma a volte le persone si confondono con esso e dopo aver scaricato un file con il Expert advisor Metatraderche un utente può rimanere bloccato con esso senza sapere cosa fare dopo. Questo è un semplice aiuto su per collegare facilmente un Expert advisor Metatrader 4 e attivarlo.

1. Scarica il vostro consulente esperto MT4 o copiarlo e salvarlo sul MetaTrader gli 'esperti' cartella:

 Expert advisor.

2. Fare doppio clic su di esso con il mouse e vi sarà aperto nell'editor MQL (questo editor è dotato di MT4). Ci sarà 'Compile' un pulsante nella parte superiore centrale della finestra. Fare clic su esso e il suo consulente esperto sarà compilato e pronto all'uso. Ci potrebbero essere alcuni errori o avvisi durante la compilazione, ma nella maggior parte dei casi non ci dovrebbe essere alcuna. Si può tentare di risolvere questi errori, ma ci vuole tempo e qualche capacità di programmazione, di solito.

 Expert Advisor.

3. Ora, tutto quello che dovete fare è aggiungere il vostro consulente esperto per il grafico preferito e attivarla. È inoltre possibile modificare alcuni parametri di input per l'advisor nella scheda Ingressi:

 Expert Advisor.

Questo è tutto! Ora potete godervi il vostro consulente esperto - i suoi segnali e la sua negoziazione (se è progettata per effettuare trading). Buona fortuna


Abilitare il funzionamento degli EA:

  1. aprire il menu "Strumenti" -> Opzioni
  2. selezionare la scheda "Consiglieri esperti"
  3. contrassegnare le caselle
    • "Abilita consiglieri esperti"
    • "Permetti compravendita in tempo reale"

Come caricare gli EA nella piattaforma di trading:

  1. cliccare sul file prescelto, salvarlo, decomprimerlo e salvare l'EA nella cartella di destinazione C:\Programmi\MetaTrader 4\experts
  2. chiudere e riaprire la piattaforma Metatrader4: nella finestra Navigatore, nella cartella definita "Consiglieri esperti", potrete visualizzare il nuovo script appena salvato;
  3. trascinare con il mouse l'EA su uno dei grafici aperti.

 

 

 

 

 

Expert Advisor

Gli Expert Advisor sono dei trading system.

Gli Expert Advisor sono dei trading system.

Expert Advisor - Adjustable MA

Expert Advisor Adjustable - Regolabile MA Expert Advisor Forex è un EA con media personalizzabile che offre la regolazioneflessibile della tradizion ...

Expert Advisor

Adjustable - Regolabile MA Expert Advisor Forex è un EA con media personalizzabile che offre la regolazione
flessibile della tradizionale strategia di cross-MA 2.

È possibile impostare diversi periodi MA, tipi di MA, differenza minima, stop-loss, take-profit, trailing stop e slittamento.
Questo expert Advisor apre sempre in posizione trasversale e si chiude sul cross successivo.

Il back-test delMA esperto consulente MetaTrader regolabile sul periodo di anni 1 ha mostrato il 19,5% di
profitto con il massimo drawdown del 10%.
La posizione del volume è stato fissato a 0.1 lotti standard.
La EA fatto 248 operazioni, di cui il 60,48% delle posizioni è stato remunerativo.
Le impostazioni di default sono stati utilizzati in questo back-test sul grafico EUR/USD.

MiniFAQ

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

Di default utilizza fisso stop-loss a 100 pips e take-profit a 70 pips.
Il trailing stop è disattivato per default.

Quanto spesso trada?

Il grafico a 5 minuti di EUR / USD (le impostazioni di back-test) questo EA scambi una volta al giorno in media.

Tutte le altre impostazioni di default possono essere utilizzate?

Il test in avanti limitata (che dovrebbe essere più affidabile di un back-test) a AUD / USD grafico M5 ha mostrato alcuni redditizio set-up per questo advisor esperto. Questi parametri devono essere cambiata da default:

  1. StopLoss - 30
  2. TakeProfit - 50
  3. TrailingStop - 20
  4. Period_1 - 50
  5. Period_2 - 10 



//+------------------------------------------------------------------+ //| Adjustable Moving Average | //| Copyright © 2009, EarnForex.com | //| http://www.earnforex.com/ | //+------------------------------------------------------------------+ #property copyright "Copyright © 2009, EarnForex" #property link "http://www.earnforex.com" extern double Lots = 0.1; extern int StopLoss = 100; extern int TakeProfit = 70; extern int TrailingStop = 0; extern int Slippage = 3; extern int Period_1 = 20; extern int Period_2 = 17; //0 - SMA, 1 - EMA, 2 - SMMA, 3 - LWMA extern int MA_Method = 1; //The minimum difference between MAs for Cross to count extern int MinDiff = 3; int Magic; //Depend on broker's quotes double Poin; int Deviation; int LastBars = 0; //0 - undefined, 1 - bullish cross (fast MA above slow MA), -1 - bearish cross (fast MA below slow MA) int PrevCross = 0; int SlowMA; int FastMA; //+------------------------------------------------------------------+ //| Initialization | //+------------------------------------------------------------------+ int init() { FastMA = MathMin(Period_1, Period_2); SlowMA = MathMax(Period_1, Period_2); Poin = Point; Deviation = Slippage; //Checking for unconvetional Point digits number if ((Point == 0.00001) || (Point == 0.001)) { Poin *= 10; Deviation *= 10; } Magic = Period()+19472394; return(0); } //+------------------------------------------------------------------+ //| Start function | //+------------------------------------------------------------------+ void start() { if (FastMA == SlowMA) { Print("MA periods should differ."); return; } if (TrailingStop > 0) DoTrailing(); //Wait for the new Bar in a chart. if (LastBars == Bars) return; else LastBars = Bars; if ((Bars < SlowMA) || (IsTradeAllowed() == false)) return; CheckCross(); } //+------------------------------------------------------------------+ //| Check for cross and open/close the positions respectively | //+------------------------------------------------------------------+ void CheckCross() { double FMA_Current = iMA(NULL, 0, FastMA, 0, MA_Method, PRICE_CLOSE, 0); double SMA_Current = iMA(NULL, 0, SlowMA, 0, MA_Method, PRICE_CLOSE, 0); if (PrevCross == 0) //Was undefined { if ((FMA_Current - SMA_Current) >= MinDiff * Poin) PrevCross = 1; //Bullish state else if ((SMA_Current - FMA_Current) >= MinDiff * Poin) PrevCross = -1; //Bearish state return; } else if (PrevCross == 1) //Was bullish { if ((SMA_Current - FMA_Current) >= MinDiff * Poin) //Became bearish { ClosePrev(); fSell(); PrevCross = -1; } } else if (PrevCross == -1) //Was bearish { if ((FMA_Current - SMA_Current) >= MinDiff * Poin) //Became bullish { ClosePrev(); fBuy(); PrevCross = 1; } } } //+------------------------------------------------------------------+ //| Close previous position | //+------------------------------------------------------------------+ void ClosePrev() { int total = OrdersTotal(); for (int i = 0; i < total; i++) { if (OrderSelect(i, SELECT_BY_POS) == false) continue; if ((OrderSymbol() == Symbol()) && (OrderMagicNumber() == Magic)) { if (OrderType() == OP_BUY) { RefreshRates(); OrderClose(OrderTicket(), OrderLots(), Bid, Deviation); } else if (OrderType() == OP_SELL) { RefreshRates(); OrderClose(OrderTicket(), OrderLots(), Ask, Deviation); } } } } //+------------------------------------------------------------------+ //| Sell | //+------------------------------------------------------------------+ int fSell() { double SL, TP; RefreshRates(); if (StopLoss > 0) SL = Bid + StopLoss * Poin; else SL = 0; if (TakeProfit > 0) TP = Bid - TakeProfit * Poin; else TP = 0; int result = OrderSend(Symbol(), OP_SELL, Lots, Bid, Deviation, SL, TP, "Adjustable MA", Magic); if (result == -1) { int e = GetLastError(); Print(e); } else return(result); } //+------------------------------------------------------------------+ //| Buy | //+------------------------------------------------------------------+ int fBuy() { double SL, TP; RefreshRates(); if (StopLoss > 0) SL = Ask - StopLoss * Poin; else SL = 0; if (TakeProfit > 0) TP = Ask + TakeProfit * Poin; else TP = 0; int result = OrderSend(Symbol(), OP_BUY, Lots, Ask, Deviation, SL, TP, "Adjustable MA", Magic); if (result == -1) { int e = GetLastError(); Print(e); } else return(result); } void DoTrailing() { int total = OrdersTotal(); for (int pos = 0; pos < total; pos++) { if (OrderSelect(pos, SELECT_BY_POS) == false) continue; if ((OrderMagicNumber() == Magic) && (OrderSymbol() == Symbol())) { if (OrderType() == OP_BUY) { RefreshRates(); if (Bid - OrderOpenPrice() >= TrailingStop * Poin) //If profit is greater or equal to the desired Trailing Stop value { if (OrderStopLoss() < (Bid - TrailingStop * Poin)) //If the current stop-loss is below the desired trailing stop level OrderModify(OrderTicket(), OrderOpenPrice(), Bid - TrailingStop * Poin, OrderTakeProfit(), 0); } } else if (OrderType() == OP_SELL) { RefreshRates(); if (OrderOpenPrice() - Ask >= TrailingStop * Poin) //If profit is greater or equal to the desired Trailing Stop value { if (OrderStopLoss() > (Ask + TrailingStop * Poin)) //If the current stop-loss is below the desired trailing stop level OrderModify(OrderTicket(), OrderOpenPrice(), Ask + TrailingStop * Poin, OrderTakeProfit(), 0); } } } } } //+------------------------------------------------------------------+
 

Leggi anche:

Expert Advisor - Artificial Intelligence

Expert Advisor Artificial Intelligence Expert Advisor Forex usa una semplice imitazione della rete neurale per produrre i segnali buy/sell e trailing ...

Expert Advisor

Artificial Intelligence Expert Advisor Forex usa una sempliceimitazione della rete neurale per produrre i segnali buy/sell e trailing stop.
Non è una vera e propria rete neurale, perché non impara dal mercato.
Invece è necessario ottimizzare per mercato impostando i parametri più vari.

La sua funzione sensibile utilizza l'oscillatore Williams Bill 'acceleratore/decelleratore.
Expert Advisor esegue anche controlli sul margine ancora disponibile per tradare.

Il test di questoExpert Advisor conIntelligenza Artificiale per MetaTrader ha fruttato1.700 dollari
di profitto utilizzando il cambio GBP / USD su time frame orario utilizzando solo 0,1 lotti standard.

E 'stato realizzato su conto standard di $ 10.000 in un anno, con massimo drawdown di 20 $.
Questo Forx EA è stato anche testato su un periodo di tre anni con le stesse performances.

MiniFAQ

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

Si utilizza l'80 pip stop-loss, ma non viene usato alcun take-profit.
Si utilizza anche un trailing stop-loss per i suoi ordini.
La media dei trades vincenti è di circa 71 pips, le perdite medie di circa 82 pips.

Quanto spesso fa trading?

Su time frame orario con GBP/USD (cambio ottimale) fa 17-18 trades al mese di media.


//+------------------------------------------------------------------+ //| ArtificialIntelligence.mq4 | //| Copyright © 2006, Yury V. Reshetov | //| http://reshetov.xnet.uz/ | //+------------------------------------------------------------------+ #property copyright "Copyright © 2006, Yury V. Reshetov ICQ:282715499 http://reshetov.xnet.uz/" #property link "http://reshetov.xnet.uz/" //---- input parameters extern int x1 = 120; extern int x2 = 120; extern int x3 = 19; extern int x4 = 100; // StopLoss level extern double sl = 80; extern double lots = 1; extern int MagicNumber = 888; static int prevtime = 0; double Poin; //+------------------------------------------------------------------+ //| expert initialization function | //+------------------------------------------------------------------+ int init() { //Checking for unconvetional Point digits number if (Point == 0.00001) Poin = 0.0001; //5 digits else if (Point == 0.001) Poin = 0.01; //3 digits else Poin = Point; //Normal return(0); } //+------------------------------------------------------------------+ //| expert deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- return(0); } //+------------------------------------------------------------------+ //| expert start function | //+------------------------------------------------------------------+ int start() { if (AccountFreeMargin() < (2*lots*1000)) return(0); if(Time[0] == prevtime) return(0); prevtime = Time[0]; int spread = 3; //---- if(IsTradeAllowed()) { RefreshRates(); spread = MarketInfo(Symbol(), MODE_SPREAD); } else { prevtime = Time[1]; return(0); } int ticket = -1; // check for opened position int total = OrdersTotal(); //---- for(int i = 0; i < total; i++) { OrderSelect(i, SELECT_BY_POS, MODE_TRADES); // check for symbol & magic number if(OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber) { int prevticket = OrderTicket(); // long position is opened if(OrderType() == OP_BUY) { // check profit if(Bid > (OrderStopLoss() + (sl * 2 + spread) * Poin)) { if(perceptron() < 0) { // reverse ticket = OrderSend(Symbol(), OP_SELL, lots * 2, Bid, 3, Ask + sl * Poin, 0, "AI", MagicNumber, 0, Red); Sleep(30000); //---- if(ticket < 0) prevtime = Time[1]; else OrderCloseBy(ticket, prevticket, Blue); } else { // trailing stop if(!OrderModify(OrderTicket(), OrderOpenPrice(), Bid - sl * Poin, 0, 0, Blue)) { Sleep(30000); prevtime = Time[1]; } } } // short position is opened } else { // check profit if(Ask < (OrderStopLoss() - (sl * 2 + spread) * Poin)) { if(perceptron() > 0) { // reverse ticket = OrderSend(Symbol(), OP_BUY, lots * 2, Ask, 3, Bid - sl * Poin, 0, "AI", MagicNumber, 0, Blue); Sleep(30000); //---- if(ticket < 0) prevtime = Time[1]; else OrderCloseBy(ticket, prevticket, Blue); } else { // trailing stop if(!OrderModify(OrderTicket(), OrderOpenPrice(), Ask + sl * Poin, 0, 0, Blue)) { Sleep(30000); prevtime = Time[1]; } } } } // exit return(0); } } // check for long or short position possibility if(perceptron() > 0) { //long ticket = OrderSend(Symbol(), OP_BUY, lots, Ask, 3, Bid - sl * Poin, 0, "AI", MagicNumber, 0, Blue); //---- if(ticket < 0) { Sleep(30000); prevtime = Time[1]; } } else { // short ticket = OrderSend(Symbol(), OP_SELL, lots, Bid, 3, Ask + sl * Poin, 0, "AI", MagicNumber, 0, Red); if(ticket < 0) { Sleep(30000); prevtime = Time[1]; } } //--- exit return(0); } //+------------------------------------------------------------------+ //| The PERCEPTRON - a perceiving and recognizing function | //+------------------------------------------------------------------+ double perceptron() { double w1 = x1 - 100; double w2 = x2 - 100; double w3 = x3 - 100; double w4 = x4 - 100; double a1 = iAC(Symbol(), 0, 0); double a2 = iAC(Symbol(), 0, 7); double a3 = iAC(Symbol(), 0, 14); double a4 = iAC(Symbol(), 0, 21); return(w1 * a1 + w2 * a2 + w3 * a3 + w4 * a4); } //+------------------------------------------------------------------+

Expert Advisor - Molanis Activtrades

Expert Advisor Facili con Molanis Strategy Builder. Forex Expert Advisor – Con Molanis Strategy Builder i trading system automatici sul Forex, chia ...

Expert Advisor Facili con Molanis Strategy Builder.

Forex Expert Advisor – ConMolanis Strategy Builder i trading system automatici sul Forex, chiamati anche Expert Advisor, o Forex EA, sono facili per tutti, anche per i trader che non sanno programmare. Sono accessibili sia su MetaTrader 4, sia con il nuovo linguaggio MQL5, pensato per il nuovo MetaTrader 5. Infatti con Molanis non è richiesta alcuna conoscenza di programmazione, ma si può costruire un nuovo Forex Expert Advisor creando un diagramma che viene analizzato automaticamente dal generatore di codice Molanis. Il diagramma viene trasformato in pochi secondi in un Expert Advisor anche multi time frame e multi valuta. Fare trading automatico sul Forex è facile con Molanis. 

Scarica Gratis Molanis Strategy Builder Adesso!

 

Forex Expert Advisor personalizzati: Molanis ti consente di utilizzare i tuoi indicatori MT4 o i tuoi trading system per poterli usare con profitto sulle piattaforme trading MetaTrader 4 o 5. 

Money Management

Molanis Strategy Builder e’ utile anche per  facilitare un eccellente money management. I lotti possono essere dimensionati utilizzando una percentuale massima di rischio per operazione. Il software Molanis riduce i lotti dopo una o più perdite consecutive. Il fattore di riduzione dipende da una percentuale fissa (25 punti %) o da un’equazione. 

Molanis Strategy Builder - Caratteristiche 

  • Crea in pochi minuti Expert Advisor in MQL5 senza scrivere alcun codice
  • Utilizza l'analisi tecnica per creare le regole del Trading System
  • Crea il tuo Forex EA con qualsiasi indicatore MT4, o un tuo indicatore personalizzato
  • Crea Expert Advisor multi-time frame e multi-valuta
  • Variabili Stop e Limit create e testate per ottimizzare il vostro forex Expert Advisor
  • I Forex EA possono essere attivi su grafico a barre o tick, con gestione a 4 o 5 cifre
  • Strategie di trading possono essere trasformate in segnali forex con un solo clic
  • Segnali Forex con avvisi a schermo, sonori o e-mail
  • Opzione filtro in modo da attivare il Forex EA solo in certi orari
  • Fornisce un controllo sui picchi di volumi per coppia di valute
  • Forex EA riprova l'esecuzione degli ordini, quando vengono rilevati errori del server 

Molanis – Semplice, Veloce, Gratuito 

Molanis Strategy Builder è probabilmente l'ambiente grafico più avanzato disponibile oggi per creare Forex Expert Advisor per MetaTrader. Semplicemente con pochi clic è possibile creare complesse strategie di trading sul Forex e trasformarle in Forex EA completamente funzionanti. Nessuna conoscenza di codice, programmazione o MQL è necessaria. Se sei nuovo del forex, questa è la migliore soluzione per il tuo trading. 

Scarica Gratis Molanis Strategy Builder Adesso!

Expert Advisor - My Picky Breakout

Expert Advisor My Picky Breakout Expert Advisor Forex è basato su una strategia di trading giornaliero breakout semplice. Entra posizione lunga se l ...

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; }

Expert Advisor - Phoenix-5-6-03

Expert Advisor Phoenix Expert Advisor Forex è molto complicato EA. Esso utilizza molti standard MetaTrader 4 indicatori (come le medie mobili e bust ...

Expert Advisor

Phoenix Expert Advisor Forex è molto complicato EA.
Esso utilizza molti standard MetaTrader 4 indicatori (come le medie mobili e buste) per determinare la posizione di entrata e di uscita così come i parametri di posizione.
Questo consulente esperto ha molti parametri di input e memorizzati internamente set di dati per ciascuna delle cinque coppie di valute può essere utilizzato per il commercio con.
L'abbondanza degli indicatori e dei controlli condizionale fare consulente esperto Phoenix un po 'più lenta della CPU per l'elaborazione.

La prova del MetaTrader Expert advisor Phoenix ha portato circa 6.400 dollari di profitto con GBP/USD su un time frame di 15 minuti con 1 lotto standard per aprire posizioni.
Il test è stato fatto nel corso di un periodo di un anno, con massimo drawdown un minimo di € 96.
Ho anche controllato su un periodo di tre anni e ha dimostrato le stesse prestazioni.

MiniFAQ
Quali sono gli stop-loss e take-profit utilizzato da questo EA?

Esso utilizza la variabile di stop-loss e take-profit, ma la media vincere e perdere la posizione resa pips 138 e 148, in media, rispettivamente.

Quanto spesso trada?

Il 15 minuti di GBP / USD grafico (le impostazioni ottimali) questo EA commercio 1 volta al giorno in media.

 


//+------------------------------------------------------------------+ //| Phoenix_5_6_03.mq4 | //| Copyright © 2006, Hendrick | //| | //+------------------------------------------------------------------+ #property copyright "Copyright © 2006, Hendrick." #define MAGICMA_A 20050610 #define MAGICMA_B 20060611 #define MAGICMA01 20050612 #define MAGICMA02 20060613 #define MAGICMA03 20060614 extern string GeneralSettings = "===== General Settings ============================"; extern int PhoenixMode = 3; extern double Lots = 1; extern double MaximumRisk = 0.05; extern int DecreaseFactor = 0; extern bool MM = true; extern bool AccountIsMicro = false; extern bool PrefSettings = true; extern int CloseAfterHours = 0; extern int BreakEvenAfterPips = 0; extern string Mode1 = "====== Phoenix Mode 1 (Classic) =================="; extern int TakeProfit = 0; extern int StopLoss = 0; extern int TrailingStop = 0; extern string Mode2 = "====== Phoenix Mode 2 (Second trade)=============="; extern int Mode2_OpenTrade_2 = 0; extern int Mode2_TakeProfit = 0; extern int Mode2_StopLoss = 0; extern bool Mode2_CloseFirstTrade = false; extern string Mode3 = "====== Phoenix Mode 3 (Three trades at once) ====="; extern int Mode3_CloseTrade2_3 = 0; extern int Mode3_TakeProfit = 0; extern int Mode3_StopLoss = 0; extern string Signal1 = "====== Signal 1 ==================================="; extern bool UseSignal1 = true; extern double Percent = 0; extern int EnvelopePeriod = 0; extern string Signal2 = "====== Signal 2 =================================="; extern bool UseSignal2 = true; extern int SMAPeriod = 0; extern int SMA2Bars = 0; extern string Signal3 = "====== Signal 3 =================================="; extern bool UseSignal3 = true; extern int OSMAFast = 0; extern int OSMASlow = 0; extern double OSMASignal = 0; extern string Signal4 = "====== Signal 4 =================================="; extern bool UseSignal4 = true; extern int Fast_Period = 0; extern int Fast_Price = PRICE_OPEN; extern int Slow_Period = 0; extern int Slow_Price = PRICE_OPEN; extern double DVBuySell = 0; extern double DVStayOut = 0; extern string Signal5 = "====== Signal 5 ================================="; extern bool UseSignal5 = true; extern int TradeFrom1 = 0; extern int TradeUntil1 = 24; extern int TradeFrom2 = 0; extern int TradeUntil2 = 0; extern int TradeFrom3 = 0; extern int TradeUntil3 = 0; extern int TradeFrom4 = 0; extern int TradeUntil4 = 0; double Poin; int init() { //Checking for unconvetional Point digits number if (Point == 0.00001) Poin = 0.0001; //5 digits else if (Point == 0.001) Poin = 0.01; //3 digits else Poin = Point; //Normal //+------------------------------------------------------------------+ //| START Preffered Settings | //+------------------------------------------------------------------+ if(PrefSettings == true) { if((Symbol() == "USDJPY") || (Symbol() == "USDJPYm")) { Mode2_OpenTrade_2 = 0; Mode2_TakeProfit = 50; Mode2_StopLoss = 60; Mode3_CloseTrade2_3 = 30; Mode3_TakeProfit = 100; Mode3_StopLoss = 55; Percent = 0.0032; EnvelopePeriod = 2; TakeProfit = 42; StopLoss = 84; TrailingStop = 0; SMAPeriod = 2; SMA2Bars = 18; OSMAFast = 5; OSMASlow = 22; OSMASignal = 2; Fast_Period = 25; Slow_Period = 15; DVBuySell = 0.0029; DVStayOut = 0.024; } if((Symbol() == "EURJPY") || (Symbol() == "EURJPYm")) { Mode2_OpenTrade_2 = 18; Mode2_TakeProfit = 70; Mode2_StopLoss = 30; Mode3_CloseTrade2_3 = 55; Mode3_TakeProfit = 70; Mode3_StopLoss = 80; Percent = 0.007; EnvelopePeriod = 2; TakeProfit = 42; StopLoss = 84; TrailingStop = 0; SMAPeriod = 4; SMA2Bars = 16; OSMAFast = 11; OSMASlow = 20; OSMASignal = 14; Fast_Period = 20; Slow_Period = 10; DVBuySell = 0.0078; DVStayOut = 0.026; } if((Symbol() == "GBPJPY") || (Symbol() == "GBPJPYm")) { Mode2_OpenTrade_2 = 2; Mode2_TakeProfit = 130; Mode2_StopLoss = 80; Mode3_CloseTrade2_3 = 40; Mode3_TakeProfit = 90; Mode3_StopLoss = 80; Percent = 0.0072; EnvelopePeriod = 2; TakeProfit = 42; StopLoss = 84; TrailingStop = 0; SMAPeriod = 8; SMA2Bars = 12; OSMAFast = 5; OSMASlow = 36; OSMASignal = 10; Fast_Period = 17; Slow_Period = 28; DVBuySell = 0.0034; DVStayOut = 0.063; } if((Symbol() == "USDCHF") || (Symbol() == "USDCHFm")) { Mode2_OpenTrade_2 = 10; Mode2_TakeProfit = 90; Mode2_StopLoss = 65; Mode3_CloseTrade2_3 = 85; Mode3_TakeProfit = 130; Mode3_StopLoss = 80; Percent = 0.0056; EnvelopePeriod = 10; TakeProfit = 42; StopLoss = 84; TrailingStop = 0; SMAPeriod = 5; SMA2Bars = 9; OSMAFast = 5; OSMASlow = 12; OSMASignal = 11; Fast_Period = 5; Slow_Period = 20; DVBuySell = 0.00022; DVStayOut = 0.0015; } if((Symbol() == "GBPUSD") || (Symbol() == "GBPUSDm")) { Mode2_OpenTrade_2 = 5; Mode2_TakeProfit = 95; Mode2_StopLoss = 90; Mode3_CloseTrade2_3 = 90; Mode3_TakeProfit = 110; Mode3_StopLoss = 80; Percent = 0.0023; EnvelopePeriod = 6; TakeProfit = 42; StopLoss = 84; TrailingStop = 0; SMAPeriod = 3; SMA2Bars = 14; OSMAFast = 23; OSMASlow = 17; OSMASignal = 15; Fast_Period = 25; Slow_Period = 37; DVBuySell = 0.00042; DVStayOut = 0.05; } } return(0); } //+------------------------------------------------------------------+ //| END Preffered Settings | //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ //| START EA | //+------------------------------------------------------------------+ void start() { if(Bars<100) { Print("bars less than 100"); return(0); } if(PhoenixMode==1)//Phoenix Classic { CheckOpenTrade(); if(CloseAfterHours != 0) CheckCloseAfterHours(); if(!StopLoss==0) CheckTrailingStop(); if(BreakEvenAfterPips != 0) CheckBreakEven(); } if(PhoenixMode==2)//Phoenix Second Trade { CheckOpenTrade(); if(CloseAfterHours != 0) CheckCloseAfterHours(); CheckSecondTrade(); } if(PhoenixMode==3)//Phoenix 123 { CheckOpenTradeMode123(); Mode3_MoveSL_Trade_2_3(); Mode3_MoveSL_Trade_3(); if(Mode3_CloseTrade2_3 != 0) CheckCloseTrade23(); } } //+------------------------------------------------------------------+ //| END EA | //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ //| START Function Calculate open positions | //+------------------------------------------------------------------+ int CalculateCurrentOrders(string symbol) { int count=0; for(int i=0;i<OrdersTotal();i++) { if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==false) break; if(OrderSymbol()==Symbol() && (OrderMagicNumber()==MAGICMA_A || OrderMagicNumber()==MAGICMA_B)) { count++; } } return(count); } //+------------------------------------------------------------------+ //| STOP Function Calculate open positions | //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ //| START Function Check Open Trade | //+------------------------------------------------------------------+ int CheckOpenTrade() { int Signal=0, err = 0, total = OrdersTotal(); if(CalculateCurrentOrders(Symbol()) < 1) { if(CheckSignal(Signal)==1) { if(OrderSend(Symbol(),OP_SELL,LotsOptimized(),Bid,3,Bid+StopLoss*Poin,Bid-TakeProfit*Poin,"FirstTrade",MAGICMA_A,0,Red) < 0) { err = GetLastError(); Print("Error Ordersend(",err,"): "); return(-1); } return(0); } if(CheckSignal(Signal)==2) { if(OrderSend(Symbol(),OP_BUY,LotsOptimized(),Ask,3,Ask-StopLoss*Poin,Ask+TakeProfit*Poin,"FirstTrade",MAGICMA_A,0,Blue) < 0) { err = GetLastError(); Print("Error Ordersend(",err,"): "); return(-1); } return(0); } } } //+------------------------------------------------------------------+ //| END Function Check Open Trade | //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ //| START MODE 3 Function Check Open Trade | //+------------------------------------------------------------------+ int CheckOpenTradeMode123() { int Signal = 0, err = 0, total = OrdersTotal(), decimalPlaces=1; if(AccountIsMicro==true) decimalPlaces=2; double lots123 = NormalizeDouble(LotsOptimized()/3,decimalPlaces); if(lots123 < 0.1 && AccountIsMicro==false) {lots123=0.1;} if(lots123 < 0.01 && AccountIsMicro==true) {lots123=0.01;} if(Mode3CalculateCurrentOrders(Symbol()) < 1) { if(CheckSignal(Signal)==1) { if(OrderSend(Symbol(),OP_SELL,lots123,Bid,3,Bid+Mode3_StopLoss*Poin,Bid-NormalizeDouble(Mode3_TakeProfit/2,0)*Poin,"Mode3_FirstTrade",MAGICMA01,0,Red)<0) { err = GetLastError(); Print("Error Ordersend(",err,"): "); return(-1); } if(OrderSend(Symbol(),OP_SELL,lots123,Bid,3,Bid+Mode3_StopLoss*Poin,Bid-Mode3_TakeProfit*Poin,"Mode3_SecondTrade",MAGICMA02,0,Red)<0) { err = GetLastError(); Print("Error Ordersend(",err,"): "); return(-1); } if(OrderSend(Symbol(),OP_SELL,lots123,Bid,3,Bid+Mode3_StopLoss*Poin,Bid-NormalizeDouble(Mode3_TakeProfit*1.5,0)*Poin,"Mode3_ThirdTrade",MAGICMA03,0,Red)<0) { err = GetLastError(); Print("Error Ordersend(",err,"): "); return(-1); } return(0); } if(CheckSignal(Signal)==2) { if(OrderSend(Symbol(),OP_BUY,lots123,Ask,3,Ask-Mode3_StopLoss*Poin,Ask+NormalizeDouble(Mode3_TakeProfit/2,0)*Poin,"Mode3_FirstTrade",MAGICMA01,0,Blue)<0) { err = GetLastError(); Print("Error Ordersend(",err,"): "); return(-1); } if(OrderSend(Symbol(),OP_BUY,lots123,Ask,3,Ask-Mode3_StopLoss*Poin,Ask+Mode3_TakeProfit*Poin,"Mode3_SecondTrade",MAGICMA02,0,Blue)<0) { err = GetLastError(); Print("Error Ordersend(",err,"): "); return(-1); } if(OrderSend(Symbol(),OP_BUY,lots123,Ask,3,Ask-Mode3_StopLoss*Poin,Ask+NormalizeDouble(Mode3_TakeProfit*1.5,0)*Poin,"Mode3_ThirdTrade",MAGICMA03,0,Blue)<0) { err = GetLastError(); Print("Error Ordersend(",err,"): "); return(-1); } return(0); } } } //+------------------------------------------------------------------+ //| END Function Check Open Trade | //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ //| START Function Check Second Trade | //+------------------------------------------------------------------+ void CheckSecondTrade() { int err = 0, total = OrdersTotal(); for(int z = total - 1; z >= 0; z --) { if(!OrderSelect( z, SELECT_BY_POS)) { err = GetLastError(); Print("OrderSelect( ", z, ", SELECT_BY_POS ) - Error #",err ); continue; } if(OrderSymbol() != Symbol()) continue; if(OrderMagicNumber() == MAGICMA_B) break; if(OrderMagicNumber() != MAGICMA_A) continue; if(OrderType() == OP_BUY && (Bid-OrderOpenPrice() > Poin*Mode2_OpenTrade_2)) { if(OrderSend(Symbol(),OP_BUY,LotsOptimized(),Ask,3,Ask - Mode2_StopLoss * Poin,Ask + Mode2_TakeProfit * Poin,"Mode2_SecondTrade",MAGICMA_B,0,Blue) < 0) { err = GetLastError(); Print("Error Ordersend(",err,"): "); return(-1); } if(Mode2_CloseFirstTrade==true) {CloseFirstTrade();} return(0); } if(OrderType() == OP_SELL && (OrderOpenPrice()-Ask > Poin*Mode2_OpenTrade_2)) { if(OrderSend(Symbol(),OP_SELL,LotsOptimized(),Bid,3,Bid + Mode2_StopLoss * Poin,Bid - Mode2_TakeProfit*Poin,"Mode2_SecondTrade",MAGICMA_B,0,Red) < 0) { err = GetLastError(); Print("Error Ordersend(",err,"): "); return(-1); } if(Mode2_CloseFirstTrade==true) {CloseFirstTrade();} return(0); } } } //+------------------------------------------------------------------+ //| END Function Check Second Trade | //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ //| START Function Check Close Trade 2 And 3 | //+------------------------------------------------------------------+ void CheckCloseTrade23() { int err = 0, total = OrdersTotal(); bool CloseTrade=false; for(int z = total - 1; z >= 0; z --) { if(!OrderSelect( z, SELECT_BY_POS)) { err = GetLastError(); Print("OrderSelect( ", z, ", SELECT_BY_POS ) - Error #",err ); continue; } if(OrderSymbol() != Symbol()) continue; if(OrderMagicNumber() != MAGICMA01) continue; if(OrderType() == OP_BUY && (OrderOpenPrice()-Bid > Poin * Mode3_CloseTrade2_3)) {CloseTrade=true;} if(OrderType() == OP_SELL && (Ask-OrderOpenPrice() > Poin * Mode3_CloseTrade2_3)) {CloseTrade=true;} if(CloseTrade) { for(int y = total - 1; y >= 0; y --) { if(!OrderSelect( y, SELECT_BY_POS)) { err = GetLastError(); Print("OrderSelect( ", y, ", SELECT_BY_POS ) - Error #",err ); continue; } if(OrderSymbol() != Symbol()) continue; if(OrderMagicNumber() == MAGICMA02 || OrderMagicNumber() == MAGICMA03) { if(OrderType() == OP_BUY) { if(OrderClose(OrderTicket(),OrderLots(),Bid,3,Violet)<0) { err = GetLastError(); Print("Error Ordersend(",err,"): "); return(-1); } return(0); } if(OrderType() == OP_SELL) { if(OrderClose(OrderTicket(),OrderLots(),Ask,3,Violet)<0) { err = GetLastError(); Print("Error Ordersend(",err,"): "); return(-1); } return(0); } } } } } } //+------------------------------------------------------------------+ //| END Function Check Close Trade 2 And 3 | //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ //| START Check First Trade Mode3 | //+------------------------------------------------------------------+ void Mode3_MoveSL_Trade_2_3() { int err = 0, total = OrdersTotal(), history = HistoryTotal(); bool ChangeStopLoss = false; for(int z = history - 1; z >= 0; z --) { if(!OrderSelect( z,SELECT_BY_POS,MODE_HISTORY)) { err = GetLastError(); Print("OrderSelect( ", z, ", SELECT_BY_POS ) - Error #",err ); continue; } if(OrderSymbol() != Symbol()) continue; if(OrderMagicNumber() == MAGICMA03) break; if(OrderMagicNumber() == MAGICMA02) break; if(OrderMagicNumber() != MAGICMA01) continue; if(OrderProfit() > 0) { ChangeStopLoss=true; break; } } if(ChangeStopLoss==true) { for(int y = total - 1; y >= 0; y --) { if(!OrderSelect(y,SELECT_BY_POS)) { err = GetLastError(); Print("OrderSelect( ", y, ", SELECT_BY_POS ) - Error #",err ); continue; } if(OrderSymbol() != Symbol()) continue; if(OrderMagicNumber() == MAGICMA02 || OrderMagicNumber() == MAGICMA03) { if(OrderType()==OP_BUY) { if(OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice(),OrderTakeProfit(),0,GreenYellow)<0) { err = GetLastError(); Print("OrderSelect( ", y, ", SELECT_BY_POS ) - Error #",err ); continue; } // return(0); } if(OrderType()==OP_SELL) { if(OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice(),OrderTakeProfit(),0,GreenYellow)<0) { err = GetLastError(); Print("OrderSelect( ", y, ", SELECT_BY_POS ) - Error #",err ); continue; } // return(0); } } } } } //} //+------------------------------------------------------------------+ //| END Check First Trade Mode 3 | //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ //| START Check Second Trade Mode3 | //+------------------------------------------------------------------+ void Mode3_MoveSL_Trade_3() { double NewSLTrade3B,NewSLTrade3S; int err = 0, total = OrdersTotal(), history = HistoryTotal(); bool ChangeStopLoss = false; for(int z = history - 1; z >= 0; z --) { if(!OrderSelect( z,SELECT_BY_POS,MODE_HISTORY)) { err = GetLastError(); Print("OrderSelect( ", z, ", SELECT_BY_POS ) - Error #",err ); continue; } if(OrderSymbol() != Symbol()) continue; if(OrderMagicNumber() == MAGICMA03) break; if(OrderMagicNumber() == MAGICMA01) break; if(OrderMagicNumber() != MAGICMA02) continue; if(OrderProfit() > 0) { for(int y = total - 1; y >= 0; y --) { if(!OrderSelect(y,SELECT_BY_POS)) { err = GetLastError(); Print("OrderSelect( ", y, ", SELECT_BY_POS ) - Error #",err ); continue; } if(OrderSymbol() != Symbol()) continue; if(OrderMagicNumber() == MAGICMA03) { if(OrderType()==OP_BUY) { NewSLTrade3B=OrderOpenPrice()+NormalizeDouble(((OrderTakeProfit()-OrderOpenPrice())/2),Digits); if(OrderModify(OrderTicket(),OrderOpenPrice(),NewSLTrade3B,OrderTakeProfit(),0,GreenYellow)<0) { err = GetLastError(); Print("OrderSelect( ", y, ", SELECT_BY_POS ) - Error #",err ); continue; } return(0); } if(OrderType()==OP_SELL) { NewSLTrade3S=OrderOpenPrice()-NormalizeDouble(((OrderOpenPrice()-OrderTakeProfit())/2),Digits); if(OrderModify(OrderTicket(),OrderOpenPrice(),NewSLTrade3S,OrderTakeProfit(),0,GreenYellow)<0) { err = GetLastError(); Print("OrderSelect( ", y, ", SELECT_BY_POS ) - Error #",err ); continue; } return(0); } } } } } } //+------------------------------------------------------------------+ //| END Check Second Trade Mode 3 | //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ //| START Function Diverge | //+------------------------------------------------------------------+ double divergence(int F_Period, int S_Period, int F_Price, int S_Price, int mypos) { int i; double maF1, maF2, maS1, maS2; maF2 = iMA(Symbol(), 0, F_Period, 0, MODE_SMA, F_Price, mypos + 1); maS2 = iMA(Symbol(), 0, S_Period, 0, MODE_SMA, S_Price, mypos + 1); return(maF2-maS2); } //+------------------------------------------------------------------+ //| END Function Diverge | //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ //| START Function Valid Trade Time | //+------------------------------------------------------------------+ bool F_ValidTradeTime (int iHour) { if(((iHour >= TradeFrom1) && (iHour <= (TradeUntil1-1)))||((iHour>= TradeFrom2) && (iHour <= (TradeUntil2-1)))||((iHour >= TradeFrom3)&& (iHour <= (TradeUntil3-1)))||((iHour >= TradeFrom4) && (iHour <=(TradeUntil4-1)))) { return (true); } else return (false); } //+------------------------------------------------------------------+ //| END Function Valid Trade Time | //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ //| START Check Close Trade After x Hours | //+------------------------------------------------------------------+ void CheckCloseAfterHours() { int total = OrdersTotal(); for(int cnt=0;cnt<total;cnt++) { OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES); if(OrderType()<=OP_SELL && OrderSymbol()==Symbol() && OrderMagicNumber()==MAGICMA_A) { if((CurTime()-OrderOpenTime())>(CloseAfterHours*3600) && OrderProfit()<0) { OrderClose(OrderTicket(),OrderLots(),Bid,10,Violet); } } } } //+------------------------------------------------------------------+ //| END Check Close Trade After x Hours | //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ //| START Function Check Signals | //+------------------------------------------------------------------+ //=====================SIGNAL1======================== int CheckSignal(int Signal) { Signal=0; bool BuySignal1=false, SellSignal1=false; double HighEnvelope1 = iEnvelopes(NULL,0,EnvelopePeriod,MODE_SMA,0,PRICE_CLOSE,Percent,MODE_UPPER,1); double LowEnvelope1 = iEnvelopes(NULL,0,EnvelopePeriod,MODE_SMA,0,PRICE_CLOSE,Percent,MODE_LOWER,1); double CloseBar1 = iClose(NULL,0,1); if(UseSignal1) { if(CloseBar1 > HighEnvelope1) {SellSignal1 = true;} if(CloseBar1 < LowEnvelope1) {BuySignal1 = true;} } else {SellSignal1=true;BuySignal1=true;} //=====================SIGNAL2======================== bool BuySignal2=false, SellSignal2=false; double SMA1=iMA(NULL,0,SMAPeriod,0,MODE_SMA,PRICE_CLOSE,1); double SMA2=iMA(NULL,0,SMAPeriod,0,MODE_SMA,PRICE_CLOSE,SMA2Bars); if(UseSignal2) { if(SMA2-SMA1>0) {BuySignal2 = true;} if(SMA2-SMA1<0) {SellSignal2 = true;} } else {SellSignal2=true;BuySignal2=true;} //=====================SIGNAL3======================== bool BuySignal3=false, SellSignal3=false; double OsMABar2=iOsMA(NULL,0,OSMASlow,OSMAFast,OSMASignal,PRICE_CLOSE,2); double OsMABar1=iOsMA(NULL,0,OSMASlow,OSMAFast,OSMASignal,PRICE_CLOSE,1); if(UseSignal3) { if(OsMABar2 > OsMABar1) {SellSignal3 = true;} if(OsMABar2 < OsMABar1) {BuySignal3 = true;} } else {SellSignal3=true;BuySignal3=true;} //=====================SIGNAL4======================== double diverge; bool BuySignal4=false,SellSignal4=false; diverge = divergence(Fast_Period, Slow_Period, Fast_Price, Slow_Price,0); if(UseSignal4) { if(diverge >= DVBuySell && diverge <= DVStayOut) {BuySignal4 = true;} if(diverge <= (DVBuySell*(-1)) && diverge >= (DVStayOut*(-1))) {SellSignal4 = true;} } else {SellSignal4=true;BuySignal4=true;} //=====================SIGNAL5======================= bool BuySignal5=false, SellSignal5=false; if(UseSignal5) { int iHour=TimeHour(LocalTime()); int ValidTradeTime = F_ValidTradeTime(iHour); if(ValidTradeTime==true) { BuySignal5=true; SellSignal5=true; } } else {SellSignal5=true;BuySignal5=true;} if((SellSignal1==true) && (SellSignal2==true) && (SellSignal3==true) && (SellSignal4==true) && (SellSignal5==true)) return(1); if((BuySignal1==true) && (BuySignal2==true) && (BuySignal3==true) && (BuySignal4==true) && (BuySignal5==true)) return(2); } //+------------------------------------------------------------------+ //| END Function Check Signals | //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ //| START Calculate optimal lot size | //+------------------------------------------------------------------+ double LotsOptimized() { if(MM==false) return(Lots); double lot=Lots; int orders=HistoryTotal(); int losses=0; int decimalPlaces=1; if(AccountIsMicro==true) decimalPlaces=2; lot=NormalizeDouble(AccountFreeMargin()*MaximumRisk/1000.0,decimalPlaces); if(DecreaseFactor>0) { for(int i=orders-1;i>=0;i--) { if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY)==false) { Print("Error in history!"); break; } if(OrderSymbol()!=Symbol() || OrderType()>OP_SELL) continue; //---- if(OrderProfit()>0) break; if(OrderProfit()<0) losses++; } if(losses>1) lot=NormalizeDouble(lot-lot*losses/DecreaseFactor,decimalPlaces); } if(lot<0.1 && AccountIsMicro==false) lot=0.1; if(lot<0.01 && AccountIsMicro==true) lot=0.01; if(lot>99) lot=99; return(lot); } //+------------------------------------------------------------------+ //| END Calculate optimal lot size | //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ //| START Function Check TrailingStop | //+------------------------------------------------------------------+ void CheckTrailingStop() { for(int i=0;i<OrdersTotal();i++) { if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==false) break; if(OrderMagicNumber()!=MAGICMA_A || OrderSymbol()!=Symbol()) continue; if(OrderType() == OP_BUY) { if(((Bid - OrderOpenPrice()) > (Poin * TrailingStop)) && (OrderStopLoss() < (Bid - Poin * TrailingStop))) OrderModify( OrderTicket(), OrderOpenPrice(), Bid - Poin * TrailingStop, OrderTakeProfit(), 0, GreenYellow); } if(OrderType() == OP_SELL) { if(((OrderOpenPrice() - Ask) > (Poin * TrailingStop)) && (OrderStopLoss() > (Ask + Poin * TrailingStop))) OrderModify( OrderTicket(), OrderOpenPrice(), Ask + Poin * TrailingStop, OrderTakeProfit(), 0, Red); } } } //+------------------------------------------------------------------+ //| END Function Check TrailingStop | //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ //| START Function Check BreakEven | //+------------------------------------------------------------------+ void CheckBreakEven() { for(int i=0;i<OrdersTotal();i++) { if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==false) break; if(OrderMagicNumber()!=MAGICMA_A || OrderSymbol()!=Symbol()) continue; if(OrderType() == OP_BUY) { if((Bid-OrderOpenPrice()) > (Poin*BreakEvenAfterPips)) OrderModify( OrderTicket(), OrderOpenPrice(), OrderOpenPrice(), OrderTakeProfit(), 0, GreenYellow); } if(OrderType() == OP_SELL) { if((OrderOpenPrice()-Ask) > (Poin*BreakEvenAfterPips)) OrderModify( OrderTicket(), OrderOpenPrice(), OrderOpenPrice(), OrderTakeProfit(), 0, Red); } } } //+------------------------------------------------------------------+ //| END Function Check BreakEven | //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ //| START Function Close First Trade | //+------------------------------------------------------------------+ int CloseFirstTrade() { for(int i=0;i<OrdersTotal();i++) { if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==false) break; if(OrderMagicNumber()!=MAGICMA_A || OrderSymbol()!=Symbol()) continue; OrderClose(OrderTicket(),OrderLots(),Bid,3,Violet); return(0); } } //+------------------------------------------------------------------+ //| END Function Close First Trade | //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ //| START Function Calculate Current Orders Mode 3 | //+------------------------------------------------------------------+ int Mode3CalculateCurrentOrders(string symbol) { int buys=0,sells=0; for(int i=0;i<OrdersTotal();i++) { if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==false) break; if( (OrderSymbol()==Symbol()) && ((OrderMagicNumber()==MAGICMA01) || (OrderMagicNumber()==MAGICMA02) || (OrderMagicNumber()==MAGICMA03))) { if(OrderType()==OP_BUY) buys++; if(OrderType()==OP_SELL) sells++; } } return(buys+sells); } //+------------------------------------------------------------------+ //| STOP Function Calculate Current Orders Mode 3 | //+------------------------------------------------------------------+
Expert Advisor.

Expert Advisor - Trading Automatico

Forex Expert Advisor - Trading System automatico. Trading System Automatico - Nel Mercato Forex la diffusione e la semplicità di applicazione degl ...

Expert Advisor.

Forex Expert Advisor - Trading System automatico.

Trading System Automatico - Nel Mercato Forex la diffusione e la semplicità di applicazione degli Expert Advisor sono sicuramente uno dei fattori che maggiormente attirano nuovi investitori sul mercato delle valute. Ma cosa sono? Gli Expert Advisor (EA) sono programmi che eseguono operazioni di trading in modo completamente automaticosulla piattaforma Metatrader. Il trader principiante chiede: che cosa è un Expert Advisor mt4, oppure un  Expert Advisor nel forex, o infine un robo forex o un Forex EA. Tutti questi sono trading system automatici, cioè un codice che inserito nel programma Metatrader4 consente acquisti e vendite  in modo automatico.  

Table of Contents:

Expert Advisor nel Trading

Perché usare un Expert Advisor nel Trading Forex. Un Expert Advisor non è altro che un software scritto specificamente per la piattaforma MetaTr ...

Perché usare un Expert Advisor nel Trading Forex.

Un Expert Advisor non è altro che un software scritto specificamente per la piattaforma MetaTrader. Un expert advisor può fare due cose: solo consigliare i trader che effettuano trading sui cambi, o puo essere programmato per eseguire automaticamente le vere, reali operazioni su un conto con soldi veri. 

Gli Expert Advisor sono piccoli software molto flessibili che possono tenere conto di qualsiasi informazione disponibile sulla piattaforma MetaTrader. Sono scritti nel loro linguaggio di programmazione proprietario chiamato MetaQuotes Language Version 4. Sono trading system automatici che facilitano il trading online.

Table of Contents:

FAQ  Expert Advisor

FAQ Expert Advisor

Le FAQ - Domande frequenti sugli Expert Advisor.  Le FAQ sono le domande più comuni che chi si avvicina al trading con gli Expert Advisor ed a ques ...

FAQ  Expert Advisor

Le FAQ - Domande frequenti sugli Expert Advisor. 

Le FAQ sono le domande più comuni che chi si avvicina al trading con gli Expert Advisor ed a questi argomenti, rivolge a chi ne sa di più di loro. Ecco le risposte alle domande più frequenti sugli expert advisor.

Contenuti:

Cosa sono i Forex Expert Advisor?

Gli Expert Advisor sono dei trading system che danno segnali di acquisto e vendita sul Forex. Gli Expert Advisor (EA - Forex Robot) servono ad automatizzare il processo di negoziazione nel Forex trading e consentono l'esclusione del trading manuale, l'osservazione continua e lo studio dei mercati. Molti trader professionisti utilizzano diversi sistemi di trading automatizzati che consentono di fare trading con strategie e condizioni diverse. Gli EA (Expert Advisor) sono script in linguaggio MQ4 e lavorano su MetaTrader 4 (MT4).

Cos'è il Forex?

Il mercato dei cambi (Forex, FX o mercato dei cambi) è un mercato finanziario decentralizzato mondiale over-the-counter (OTC) per fare trading con i cambi di valuta. Il Forex coinvolge ogni giorno milioni di investitori in tutto il mondo: dalle banche e dalle aziende ai piccoli risparmiatori.

Non ho esperienza con i robot Forex: è facile da usare?

Sì, è facile da usare. Forex Robot si basa su una tecnologia di nuova generazione che ti permette con pochi click di installare, eseguire e iniziare a tradare. Non c'è bisogno di essere professionali. Tutti possono farlo. È completamente automatico e l'intero processo è automatizzato al 100%.

Forex Robot può funzionare quando sono via?

Forex Robot può lavorare 24 ore al giorno dall'apertura del mercato del lunedì alla chiusura del mercato del venerdì. Non è necessario monitorare le tue operazioni. Il nostro Forex Robot lo farà per te. Monitorerà le negoziazioni, aprirà e chiuderà automaticamente le posizioni.

Posso usare Forex Robot con qualsiasi broker?

Puoi utilizzare qualsiasi broker che offre la piattaforma di trading Metatrader 4. Ma per il miglior risultato ti suggeriamo di fare trading con i broker più noti e affidabili.

Su quali piattaforme posso usare gli Expert Advisor?

Soltanto su MetaTrader 4 e MetaTrader 5. Non ci sono altre piattaforme che supportano questo linguaggio.

Quanto si guadagna con gli Expert Advisor?

Dipende dal mercato e dalla qualità del software; non c'è certezza.

Come si programmano gli Expert Advisor?

Si programmano con un linguaggio che si chiama MQL.

Si usa uno a più Expert advisor?

Normalmente ogni Expert Advisor è programmato per eseguire una singola strategia di trading. Spesso si usano più programma con strategie diverse nello stesso momento.

Questi programmi possono anche essere scambiati o venduti tra un trader e l’altro. Di conseguenza non è necessario saper programmare da zero un Expert Advisor per avvicinarsi a questo mondo.

Quanto costa un Expert Advisor? 

Questi programmi possono anche essere scambiati o venduti tra un trader e l’altro. Di conseguenza non è necessario saper programmare da zero un Expert Advisor per avvicinarsi a questo mondo. Il costo va da pochi euro a 700 euro circa secondo la complessità del programma software.

Quali sono i migliori Expert?

Tra i gratuiti: The Fibonacci Scalper / Larry Conners RSI / Aegis; tra quelli a pagamento:  Expert Advisor CAP / ADXPivot / Exclusive EA

Dove trovo degli Expert Advisor gratis?

Li potete trovare in questo sito in questo articolo: FREE EXPERT ADVISOR 

 

Leggi anche: 

Expert Advisor - Artificial Intelligence

Free Expert Advisor - Scalper GBP M5

Expert Advisor - Adjustable MA

Free Expert Advisor - Envelope Breakout System

Forex Expert Advisor - Tipologia Forex EA

Forex EA

I Forex EA, sono gli expert advisor applicati al Forex, cioè alle valute. 

I Forex EA, sono gli expert advisor applicati al Forex, cioè alle valute. 

Expert Advisor.

Forex Expert Advisor

Forex Expert Advisor, Trading System automatico. Forex robot o Forex EA cosa sono? I Forex Expert Advisor sono semplici trading software, cioè progr ...

Expert Advisor.

Forex Expert Advisor, Trading System automatico.

Forex robot o Forex EA cosa sono? I Forex Expert Advisor sono semplici trading software, cioè programmi che fanno trading seguendo rigidamente delle regole che voi impostate. Gli Expert Advisor (EA) sono programmi automatici, chiamati anche turbo robot che eseguono operazioni di trading in modo del tutto automatico con la piattaforma MetaTrader.

Forex Expert Advisor

Forex Expert Advisor Gratis - Forex Expert Advisor sono trading system automatici. Scopri qui un Forex Expert Advisor Gratis per iniziare e provare ...

Forex Expert Advisor per Metatrader.Forex Expert Advisor GratisForex Expert Advisor sono trading system automatici.
Scopri qui un Forex Expert Advisor Gratis per iniziare e provare su un "conto demo" che non comporta alcun rischio. 
Ti offriamo una risorsa gratuita al solo scopo di fare esperienza sul Forex, scegliendo cross di valute e condizioni di mercato ideali.
Possiamo inoltre fornirti Forex Expert Advisor su misura in base alle tue indicazioni.
Altri nostri Forex EA, ai quali ti puoi abbonare, sono testati da tempo ed ottengono ottimi risultati.
Per ulteriori informazioni Contattaci Adesso.

Forex Expert Advisor - Tipologia Forex EA

Forex Expert Advisor - Vari Tipi di Forex EA. Categorie di Forex Expert Advisor - Ci sono molti tipi differenti di Forex Expert Advisor disponibili ...

Forex Expert Advisor - Vari Tipi di Forex EA.

Categorie di Forex Expert Advisor - Ci sono molti tipi differenti di Forex Expert Advisor disponibili per la piattaforma MT4. In questa articolo spieghiamo la maggior parte dei tipi di Forex EA più noti. Questo non è un elenco definitivo, esaustivo perchè ogni anno decine di nuovi Forex Expert Advisore nuove strategie vengono rilasciati sul mercato.
Un Forex Expert Advisor può essere programmato per utilizzare molte strategie diverse o algoritmi matematici. Essi possono comprendere strategie di rete, strategie di copertura, martingala e per invertire le strategie di martingala, strategie che seguono il trend, le strategie di correlazione. Possono essere basate sulle notizie,  breakout, scalping o di adattive. Spesso un Forex Expert Advisor viene costruito con una combinazione di queste strategie.
Dopo aver studiato molti Forex Expert Advisor e le loro strategie, abbiamo trovato due diverse classificazioni. Una delle classificazioni è EA classico contro EA più avanzati. Un'altra classificazione è la divisione in notizie, breakout, siepe, scalper e adattivo. Vediamo questa ultima.


EA News - Scalper EA - Breakout EA Hedge - EA - EA Adaptive


News Expert Advisor- Questi Forex Expert Advisor sono un tipo di copertura con Expert Advisor. Gli Expert Advisor basati sulle news tenteranno di approfittare di news ed eventi dirompenti e cambiamenti forti in diverse cross che si verificano con comunicati stampa finanziari.


Scalper Forex Expert Advisor - In molti scenari questi tipi di Forex Expert Advisor sono limitati da un broker Forex - se utilizzato con un broker che non consente questo tipo di trading si può avere il conto cancellato. D'altra parte queste sono di solito i Forex Expert Advisorpiù redditizi. Essi mirano a prendere profitti piccoli non appena sono disponibili in base alle tendenze ricorrenti.


Breakout Forex Expert Advisor - Questi tipi di Forex Expert Advisor aprono un trading quando il prezzo di un cross rompe un supporto specifico ed un livello di resistenza .


Hedge Expert Advisor - Questa categoria include qualsiasi Forex Expert Advisor che apra due posizioni distinte e opposte durante il tentativo di minimizzare la perdita, oppure massimizzando il profitto in buona posizione.


Expert Advisor Adaptive - Questa categoria rappresenta una nuova generazione di Forex Expert Advisor. Questa seconda generazione di Forex Expert Advisor sono molto più adattabili al loro ambiente e possono reagire a diverse situazioni e ttrand. Molti di essi sono basati su reti neurali.

Prova ed Acquista i nostri Forex Expert Advisor Adesso

Classic EA - EA avanzata


Classic Expert Advisor - Questi Forex Expert Advisor tentano il trading sui rimbalzi dal supporto, sulla resistenza e le inversioni. Si aprirà una posizione quando arriva un pattern ad alta probabilità. Molti di questi Forex Expert Advisor si usano assieme ai trailing stop - una funzione che aiuta a garantire i profitti. Possono anche essere predefiniti per monitorare le condizioni di mercato diverse e quindi per chiudere immediatamente la vostra posizione se si verifica una improvvisa inversione.


Advanced Expert Advisor - Questi Forex Expert Advisor possono tradare cross multipli nello stesso momento, monitorando i crosss contemporaneamente. Questa capacità unica fornisce una vasta gamma di opzioni nella scelta di una tendenza, cosa che risparmia molto tempo rispetto al trading manuale.


Conto Demo per provare - Si dovrebbe scegliere un Forex Expert Advisor in linea con il tuo stile di trading. Prova a giocare con i vari parametri coinvolti nella configurazione del Forex Expert Advisor per conoscere meglio e trovare la combinazione che più vi si addice. Tutto questo può essere fatto su un conto demo con il tuo broker in modo da non rischiare un centesimo.

Prova ed Acquista i nostri Forex Expert Advisor Adesso

Leggi anche:

Forex Expert Advisor - Xtrader

Xtrader un Forex Expert Advisor semplice. X trader un Forex Expert semplice che utilizza l'incrocio di media mobile. Il Forex EA contiene filtro come ...

Xtrader un Forex Expert Advisor semplice.

X trader un Forex Expert semplice che utilizza l'incrocio di media mobile. Il Forex EA contiene filtro come una funzione aggiuntiva per aiutare a ottimizzare il vostro o ulteriori ricerche tempo. Le impostazioni predefinite non sono necessariamente le migliori. Ottimizzarle in MetaTrader 4 per ottenere le impostazioni migliori per il tuo calendario preferito e broker. Le impostazioni di inoltro sono illustrate di seguito:
CloseOnReverseSignal - impostata su true per chiudere mestieri del segnale precedente, quando si verifica un segnale oggetto dell'opposizione.
TimeSettings - impostare l'ora e i minuti di inizio / fine trade.

XTRADER v. 3

//+------------------------------------------------------------------+
//|                                                  X trader v3.mq4 |
//|                            Copyright © 2013, www.FxAutomated.com |
//|                                       http://www.FxAutomated.com |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2013, www.FxAutomated.com"
#property link      "http://www.FxAutomated.com"
 
//---- input parameters
extern double    Lots=0.1;
extern int       Slip=5;
extern string    StopSettings="Set stops below";
extern double    TakeProfit=150;
extern double    StopLoss=100;
extern bool      AllowBuy=true;
extern bool      AllowSell=true;
extern bool      CloseOnReverseSignal=true;
extern string    TimeSettings="Set the time range the EA should trade";
extern string    StartTime="00:00";
extern string    EndTime="23:59";
extern string    Ma1="First Ma settings";
extern int       Ma1Period=16;
extern int       Ma1Shift=8;
extern int       Ma1Method=MODE_SMA;
extern int       Ma1AppliedPrice=PRICE_MEDIAN;
extern string    Ma2="Second Ma settings";
extern int       Ma2Period=1;
extern int       Ma2Shift=0;
extern int       Ma2Method=MODE_SMA;
extern int       Ma2AppliedPrice=PRICE_MEDIAN;
extern string    MagicNumbers="Set different magicnumber for each timeframe of a pair";
extern int       MagicNumber=103;
 
 
string freeze;
 
 
int init()
{
return(0);
}
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
//----
 
int StopMultd=10;
int Slippage=Slip*StopMultd;
double PipsGained,PointsGained;
color CpColor;
 
int i,closesell=0,closebuy=0;
 
double  TP=NormalizeDouble(TakeProfit*StopMultd,Digits);
double  SL=NormalizeDouble(StopLoss*StopMultd,Digits);
 
 
//-------------------------------------------------------------------+
//Check open orders
//-------------------------------------------------------------------+
if(OrdersTotal()>0){
  for(i=1;i<=OrdersTotal();i++)          // Cycle searching in orders
     {
      if (OrderSelect(i-1,SELECT_BY_POS)==true) // If the next is available
        {
          if(OrderMagicNumber()==MagicNumber&&OrderSymbol()==Symbol()&&OrderType()==OP_BUY) {int haltbuy=1;}
          if(OrderMagicNumber()==MagicNumber&&OrderSymbol()==Symbol()&&OrderType()==OP_SELL) {int haltsell=1;}
                  
          if((OrderType()==OP_BUY)&&(OrderMagicNumber()==MagicNumber)){
          double difference=Bid-OrderOpenPrice();
         PointsGained=NormalizeDouble(difference/Point,Digits);
         PipsGained=PointsGained/10;
         }
          
          if((OrderType()==OP_SELL)&&(OrderMagicNumber()==MagicNumber)){
          difference=OrderOpenPrice()-Ask;
         PointsGained=NormalizeDouble(difference/Point,Digits);
         PipsGained=PointsGained/10;
         }
          
        }
     }
}
 
//-------------------------------------------------------------------+
// time check
//-------------------------------------------------------------------
if((TimeCurrent()>=StrToTime(StartTime))&&(TimeCurrent()<=StrToTime(EndTime)))
{
int TradeTimeOk=1;
}
else
{ TradeTimeOk=0;}  
//-----------------------------------------------------------------
// indicator checks
//-----------------------------------------------------------------
 
// Ma strategy one
double MA1_bc=iMA(NULL,0,Ma1Period,Ma1Shift,Ma1Method,Ma1AppliedPrice,0);
double MA1_bp=iMA(NULL,0,Ma1Period,Ma1Shift,Ma1Method,Ma1AppliedPrice,1);
double MA1_bl=iMA(NULL,0,Ma1Period,Ma1Shift,Ma1Method,Ma1AppliedPrice,2);
 
 
 
// Ma strategy two
double MA2_bc=iMA(NULL,0,Ma2Period,Ma2Shift,Ma2Method,Ma2AppliedPrice,0);
double MA2_bp=iMA(NULL,0,Ma2Period,Ma2Shift,Ma2Method,Ma2AppliedPrice,1);
double MA2_bl=iMA(NULL,0,Ma2Period,Ma2Shift,Ma2Method,Ma2AppliedPrice,2);
 
 
 
 //------------------opening criteria------------------------
if((MA1_bc<MA2_bc)&&(MA1_bp<MA2_bp)&&(MA1_bl>MA2_bl))
{ bool buysignal=true;}else{ buysignal=false;}
 
if((MA1_bc>MA2_bc)&&(MA1_bp>MA2_bp)&&(MA1_bl<MA2_bl))
{ bool sellsignal=true;}else{ sellsignal=false;}
 
 
//------------------------------closing criteria--------------
if((MA1_bc>MA2_bc)&&(MA1_bp>MA2_bp)&&(MA1_bl<MA2_bl)){closebuy=1;}else{ closebuy=0;}
if((MA1_bc<MA2_bc)&&(MA1_bp<MA2_bp)&&(MA1_bl>MA2_bl)){closesell=1;}else{ closesell=0;}
 
 
 
 
//-----------------------------------------------------------------------------------------------------
// Opening criteria
//-----------------------------------------------------------------------------------------------------
 
 
// Open buy
 if((buysignal==true)&&(closebuy!=1)&&(freeze!="Buying trend")&&(TradeTimeOk==1)){
 
   if(AllowBuy==true&&haltbuy!=1)int openbuy=OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,0,0,"Stochastic rsi buy order",MagicNumber,0,Blue);
 
}
 
 
// Open sell
 if((sellsignal==true)&&(closesell!=1)&&(freeze!="Selling trend")&&(TradeTimeOk==1)){
 
 if(AllowSell==true&&haltsell!=1) int opensell=OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,0,0,"Stochastic rsi sell order",MagicNumber,0,Red);
 
}
 
 
 
if(buysignal==true){freeze="Buying trend";}
if(sellsignal==true){freeze="Selling trend";}
 
 
//-------------------------------------------------------------------------------------------------
// Closing criteria
//-------------------------------------------------------------------------------------------------
 
if(closesell==1||closebuy==1||openbuy<1||opensell<1){// start
if(OrdersTotal()>0){
  for(i=1;i<=OrdersTotal();i++){          // Cycle searching in orders
  
      if (OrderSelect(i-1,SELECT_BY_POS)==true){ // If the next is available
          if(CloseOnReverseSignal==true){
          if(OrderMagicNumber()==MagicNumber&&closebuy==1&&OrderType()==OP_BUY&&OrderSymbol()==Symbol()) { OrderClose(OrderTicket(),OrderLots(),Bid,Slippage,CLR_NONE);}
          if(OrderMagicNumber()==MagicNumber&&closesell==1&&OrderType()==OP_SELL&&OrderSymbol()==Symbol()) { OrderClose(OrderTicket(),OrderLots(),Ask,Slippage,CLR_NONE);}
          }
          // set stops
          
                // Calculate take profit
                double tpb=NormalizeDouble(OrderOpenPrice()+TP*Point,Digits);
               double tps=NormalizeDouble(OrderOpenPrice()-TP*Point,Digits);
               // Calculate stop loss
                double slb=NormalizeDouble(OrderOpenPrice()-SL*Point,Digits);
               double sls=NormalizeDouble(OrderOpenPrice()+SL*Point,Digits);
 
          
         if(TakeProfit>0){// if tp not 0
          if((OrderMagicNumber()==MagicNumber)&&(OrderTakeProfit()==0)&&(OrderSymbol()==Symbol())&&(OrderType()==OP_BUY)){ OrderModify(OrderTicket(),0,OrderStopLoss(),tpb,0,CLR_NONE);}
          if((OrderMagicNumber()==MagicNumber)&&(OrderTakeProfit()==0)&&(OrderSymbol()==Symbol())&&(OrderType()==OP_SELL)){ OrderModify(OrderTicket(),0,OrderStopLoss(),tps,0,CLR_NONE);}
          }
          
          if(StopLoss>0){// if sl not 0
          if((OrderMagicNumber()==MagicNumber)&&(OrderStopLoss()==0)&&(OrderSymbol()==Symbol())&&(OrderType()==OP_BUY)){ OrderModify(OrderTicket(),0,slb,OrderTakeProfit(),0,CLR_NONE); }
          if((OrderMagicNumber()==MagicNumber)&&(OrderStopLoss()==0)&&(OrderSymbol()==Symbol())&&(OrderType()==OP_SELL)){ OrderModify(OrderTicket(),0,sls,OrderTakeProfit(),0,CLR_NONE); }
          }
          
 
          
        } // if available
     } // cycle
}// orders total
 
 
}// stop
 
 
 
//----
int Error=GetLastError();
 if(Error==130){Alert("Wrong stops. Retrying.");RefreshRates();}
  if(Error==133){Alert("Trading prohibited.");}
  if(Error==2){Alert("Common error.");}
  if(Error==146){Alert("Trading subsystem is busy. Retrying.");Sleep(500);RefreshRates();}
 
//----
 
//-------------------------------------------------------------------
   return(0);
 }
//+--------------------------------End----------------------------------+
  
  
 
int deinit()
{
  Alert("Visit www.fxautomated.com for more forex tools");
 return;
}

 

Forex Expert Advisor Edger

Forex Expert Advisor long e short EDGER - Un nuovo Forex EA doppio, cioè con una parte Long ed una Short che aiuta il trader a piazzare lo stoploss. ...

Forex Expert Advisor long e short

EDGER - Un nuovo Forex EA doppio, cioè con una parte Long ed una Short che aiuta il trader a piazzare lo stoploss. Che cosa questo Forex Expert Advisor non è? Non è un metodo garantito per il successo! Ovviamente le perdite ci sono come sempre. Non è un sistema per le coperture o hedging. Questo Forex EA è uno strumento per piazzare ordini. Tuttavia, questo EA non effettuare ordini in base a qualsiasi altra cosa. Fermerà il suo lavoro dopo che questo scambio è finito. Quello che cerca questo tool.

Forex trading.

Forex Trading - I Guadagni

Nel Forex Trading quali sono i guadagni dei Trader? Il Forex Trading online è difficile e rischioso ed i guadagni non sono certi. Quindi non bisogna ...

Forex trading.

Nel Forex Trading quali sono i guadagni dei Trader?

Il Forex Trading online è difficile e rischioso ed i guadagni non sono certi. Quindi non bisogna porre attenzione ai guadagni ma piuttosto alle perdite. I trader sul Forex, cioè sul mercato valutario, possono avere guadagni molto diversi; dipende dal tipo di trading online e strategie applicate per non parlare della esperienza maturata che permette di evitare errori grossolani. Da cosa dipenderanno i guadagni che si potranno fare  tradando nel Forex? Certamente dipenderanno dalle coppie di valute scelte, dalla leva usata nelle operazioni e da quanto capitale ho a disposizione per il trading sul Forex. Infine dal tipo di trading praticato: discrezionale o trading system cioè un expert advisor?

Table of Contents:

Expert Advisor.

Forex Trading ed Expert Advisor

Trading system e Forex EA. Il mercato Forex  è il terreno ideale per gli expert advisor, i trading system, il trading automatico, che ormai è pr ...

Expert Advisor.

Trading system e Forex EA.

Il mercato Forex  è il terreno ideale per gli expert advisor, i trading system, il trading automatico, che ormai è praticato da molti anni. L'utilizzo dei trading system diventa sempre più diffuso ed applicato sistematicamente. I trader si affidano sempre più a soluzioni automatizzate per garantire la precisione e aumentare le loro possibilità di successo. Il Forex expert advisor non ha emozioni e segue le regole.

Table of Contents:

Expert advisor gratis

Free Expert Advisor

Free Expert Advisor - Scarica Gratis il tuo Forex Expert Advisor. Un Free Forex Expert Advisor gratis per iniziare e provare il tuo sistema su un c ...

Expert advisor gratis

Free Expert Advisor - Scarica Gratis il tuo Forex Expert Advisor.

Un Free Forex Expert Advisor gratis per iniziare e provare il tuo sistema su un conto demo. Forex EA per il trading automatico sul Forex. Risorsa gratuita quindi per fare esperienza senza alcuna garanzia su rendimento ed affidabilità di questi 25 Expert Advisor Gratis. Si deve prestare attenzione a capire l'indicatore tecnico, quali coppie di valute dovrebbero essere usate, e quali condizioni di mercato sono ideali. Chi utilizza gratis questi Expert Advisorcon denaro reale, benchè siano stati costruiti con la massima attenzione ed impegno, lo fa a proprio rischio e pericolo. Il Forex ed i mercati finanziari comportano sempre una componente di rischio. Si consiglia quindi di usarli come palestra con la possibilità di modificarli secondo le proprie strategie di trading.  

Puoi provare i  i nostri Forex Expert Advisor o chiederne uno su misura in base ai tuoi sistemi di trading.

Contenuti:

Free Expert Advisor - Correlation-Hedge

Expert Advisor//+------------------------------------------------------------------+ //| Hedging ...

Expert Advisor

//+------------------------------------------------------------------+ //| Hedging.mq4 | //| Coders Guru | //| http://www.forex-tsd.com | //+------------------------------------------------------------------+ #property copyright "Coders Guru" #property link "http://www.forex-tsd.com" extern string Sym_1 = "EURUSD"; extern string Sym_2 = "USDCHF"; extern double Lots = 1; extern int Slippage = 5; bool Sell = true; //+------------------------------------------------------------------+ int start() { int cnt,total; if(Bars<100) {Print("bars less than 100"); return(0);} total = OrdersTotal(); if(total < 1) { if(Sell==0) { RefreshRates(); OrderSend(Sym_1,OP_BUY,Lots,MarketInfo(Sym_1,MODE_ASK),Slippage,0,MarketInfo(Sym_1,MODE_ASK)+1000*Point,"Hedging",1234,0,Green); RefreshRates(); OrderSend(Sym_2,OP_BUY,Lots,MarketInfo(Sym_2,MODE_ASK),Slippage,0,MarketInfo(Sym_2,MODE_ASK)+1000*Point,"Hedging",1234,0,Green); } else { RefreshRates(); OrderSend(Sym_1,OP_SELL,Lots,MarketInfo(Sym_1,MODE_BID),Slippage,0,MarketInfo(Sym_1,MODE_BID)-1000*Point,"Hedging",1234,0,Red); RefreshRates(); OrderSend(Sym_2,OP_SELL,Lots,MarketInfo(Sym_2,MODE_BID),Slippage,0,MarketInfo(Sym_2,MODE_BID)-1000*Point,"Hedging",1234,0,Red); } return(0); } return(0); }

Free Expert Advisor - e-BrainTrend

Expert Advisor//+------------------------------------------------------------------+ //| e-BrainTrend ...

Expert Advisor

//+------------------------------------------------------------------+ //| e-BrainTrend.mq4 | //| Copyright © 2005, MetaQuotes Software Corp. | //| http://www.metaquotes.net | //+------------------------------------------------------------------+ #property copyright "Copyright © 2005, MetaQuotes Software Corp." #property link "http://www.metaquotes.net" //1é Ñèãíàë extern int BR1TF = 15; extern int BR1Bars = 500; extern int ShftBR1 = 0; //2é Ñèãíàë extern int BR2TF = 15; extern int BR2Bars = 500; extern int ShftBR2 = 0; //Ìåíüøèé TF Ñèãíàë extern int BRLowTF = 5; extern int BRLowBars = 500; extern int ShftBRLow = 0; //TRStop Ñèãíàë extern int BRTRStopTF = 1; extern int BRTRStopBars = 500; extern int ShftBRTRStop = 0; //Äîïîëíèòåëüíûé ôèëüòð extern int TF2Signal = 15; extern int Period2Signal = 14; extern int Shft0 = 0; extern int Shft1 = 1; extern int TPext = 0; extern int SLext = 0; extern int MagicNumber = 20051029; int handle; int trCount; //+------------------------------------------------------------------+ //| expert initialization function | //+------------------------------------------------------------------+ int init() { //---- trCount = 0; /* handle = FileOpen("BrainTrendDebug.csv", FILE_CSV|FILE_WRITE); FileWrite(handle, "CurTime", "Ask", "Bid", "BR1Bar1", "BR1Bar2", "BR1Sig1", "BR1Sig2", "BR1Stop1", "BR1Stop2", "BR2Bar1", "BR2Bar2", "BR2Sig1", "BR2Sig2", "BR2Stop1", "BR2Stop2", "BRLowBar1", "BRLowBar2", "BRLowSig1", "BRLowSig2", "BRLowStop1", "BRLowStop2", "BRTRBar1", "BRTRBar2", "BRTRSig1", "BRTRSig2", "BRTRStop1", "BRTRStop2", "ADXADXCurr", "ADXADXPrev", "ADXPlsCurr", "ADXMnsCurr", "ADXPlsPrev", "ADXMnsPrev"); FileFlush(handle); */ //---- return(0); } //+------------------------------------------------------------------+ //| expert deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- FileClose(handle); //---- return(0); } //+------------------------------------------------------------------+ //| expert start function | //+------------------------------------------------------------------+ int start() { //---- double BR1Bar1, BR1Bar2; double BR1Sig1, BR1Sig2; double BR1Stop1, BR1Stop2; double BR2Bar1, BR2Bar2; double BR2Sig1, BR2Sig2; double BR2Stop1, BR2Stop2; double BRLowBar1, BRLowBar2; double BRLowSig1, BRLowSig2; double BRLowStop1, BRLowStop2; double BRTRBar1, BRTRBar2; double BRTRSig1, BRTRSig2; double BRTRStop1, BRTRStop2; double ADXADXCurr, ADXADXPrev, ADXPlsCurr, ADXMnsCurr, ADXPlsPrev, ADXMnsPrev; double TP, SL; int TradeType, RealTotal, total, cnt, iModFlag; //---- //1é Èíäèêàòîð if(TimeHour(CurTime()) < 7 || TimeDayOfWeek(CurTime()) == 5 || TimeDayOfWeek(CurTime()) == 6 || TimeDayOfWeek(CurTime()) == 0) return(0); BR1Bar1 = iCustom(NULL, BR1TF, "BrainTrend1", BR1Bars, 0, ShftBR1); BR1Bar2 = iCustom(NULL, BR1TF, "BrainTrend1", BR1Bars, 1, ShftBR1); BR1Sig1 = iCustom(NULL, BR1TF, "BrainTrend1Sig", BR1Bars, 0, 0, 0, ShftBR1); BR1Sig2 = iCustom(NULL, BR1TF, "BrainTrend1Sig", BR1Bars, 0, 0, 1, ShftBR1); BR1Stop1 = iCustom(NULL, BR1TF, "BrainTrend1Stop", BR1Bars, 0, 0, 0, ShftBR1); BR1Stop2 = iCustom(NULL, BR1TF, "BrainTrend1Stop", BR1Bars, 0, 0, 1, ShftBR1); //2é Èíäèêàòîð BR2Bar1 = iCustom(NULL, BR2TF, "BrainTrend2", BR2Bars, 0, ShftBR2); BR2Bar2 = iCustom(NULL, BR2TF, "BrainTrend2", BR2Bars, 1, ShftBR2); BR2Sig1 = iCustom(NULL, BR2TF, "BrainTrend2Sig", BR2Bars, 0, 0, 0, ShftBR2); BR2Sig2 = iCustom(NULL, BR2TF, "BrainTrend2Sig", BR2Bars, 0, 0, 1, ShftBR2); BR2Stop1 = iCustom(NULL, BR2TF, "BrainTrend2Stop", BR2Bars, 0, 0, 0, ShftBR2); BR2Stop2 = iCustom(NULL, BR2TF, "BrainTrend2Stop", BR2Bars, 0, 0, 1, ShftBR2); //Ìëàäøèé TF Èíäèêàòîð // BRLowBar1 = iCustom(NULL, BRLowTF, "BrainTrend2", BRLowBars, 0, ShftBRLow); // BRLowBar2 = iCustom(NULL, BRLowTF, "BrainTrend2", BRLowBars, 1, ShftBRLow); BRLowSig1 = iCustom(NULL, BRLowTF, "BrainTrend2Sig", BRLowBars, 0, 0, 0, ShftBRLow); BRLowSig2 = iCustom(NULL, BRLowTF, "BrainTrend2Sig", BRLowBars, 0, 0, 1, ShftBRLow); BRLowStop1 = iCustom(NULL, BRLowTF, "BrainTrend2Stop", BRLowBars, 0, 0, 0, ShftBRLow); BRLowStop2 = iCustom(NULL, BRLowTF, "BrainTrend2Stop", BRLowBars, 0, 0, 1, ShftBRLow); //TRStop TF Èíäèêàòîð // BRTRBar1 = iCustom(NULL, BRTRStopTF, "BrainTrend2", BRTRStopBars, 0, ShftBRTRStop); // BRTRBar2 = iCustom(NULL, BRTRStopTF, "BrainTrend2", BRTRStopBars, 1, ShftBRTRStop); BRTRSig1 = iCustom(NULL, BRTRStopTF, "BrainTrend2Sig", BRTRStopBars, 0, 0, 0, ShftBRTRStop); BRTRSig2 = iCustom(NULL, BRTRStopTF, "BrainTrend2Sig", BRTRStopBars, 0, 0, 1, ShftBRTRStop); BRTRStop1 = iCustom(NULL, BRTRStopTF, "BrainTrend2Stop", BRTRStopBars, 0, 0, 0, ShftBRTRStop); BRTRStop2 = iCustom(NULL, BRTRStopTF, "BrainTrend2Stop", BRTRStopBars, 0, 0, 1, ShftBRTRStop); //Âòîðè÷íûé ôèëüòð ADXADXCurr = iADX(NULL, TF2Signal, Period2Signal, PRICE_MEDIAN, MODE_MAIN, Shft0); ADXADXPrev = iADX(NULL, TF2Signal, Period2Signal, PRICE_MEDIAN, MODE_MAIN, Shft1); ADXPlsCurr = iADX(NULL, TF2Signal, Period2Signal, PRICE_MEDIAN, MODE_PLUSDI, Shft0); ADXPlsPrev = iADX(NULL, TF2Signal, Period2Signal, PRICE_MEDIAN, MODE_PLUSDI, Shft1); ADXMnsCurr = iADX(NULL, TF2Signal, Period2Signal, PRICE_MEDIAN, MODE_MINUSDI, Shft0); ADXMnsPrev = iADX(NULL, TF2Signal, Period2Signal, PRICE_MEDIAN, MODE_MINUSDI, Shft1); TradeType = 0; //Ïðîäàæà if(//Ñîáñòâåííî ñèãíàë (BR1Sig2 > 0 && BR1Sig2 < 1000) //1é èíäèêàòîð äàë ñèãíàë && //Ïîäòâåðæäåíèå 2ì èíäèêàòîðîì ( (BR2Sig2 > 0 && BR2Sig2 < 1000) //2é èíäèêàòîð äàë ñèãíàë || (BR2Stop2 > 0 && BR2Stop2 < 1000) //2é èíäèêàòîð ñòîï íå ïðîòèâ ) && //Ïîäòâåðæäåíèå ìëàäøèì TF ( (BRLowSig2 > 0 && BRLowSig2 < 1000) //LowTFé èíäèêàòîð äàë ñèãíàë || (BRLowStop2 > 0 && BRLowStop2 < 1000) //LowTFé èíäèêàòîð ñòîï íå ïðîòèâ ) /* && //Ïîäòâåðæäåíèå òðåéëèíãîì TF ( (BRTRSig2 > 0 && BRTRSig2 < 1000) //LowTFé èíäèêàòîð äàë ñèãíàë || (BRTRStop2 > 0 && BRTRStop2 < 1000) //LowTFé èíäèêàòîð ñòîï íå ïðîòèâ ) */ /* && //Öâåò áàðà ( (BR1Bar1 > BR1Bar2) ) */ && //Âòîðè÷íûé ôèëüòð ( (ADXADXCurr > ADXPlsCurr) // && // (ADXPlsCurr > ADXMnsCurr) // && // (ADXADXCurr > ADXADXPrev) // && // (ADXPlsCurr > ADXPlsPrev) ) ) { TradeType = -1; if(SLext == 0) SL = BR1Sig2; else SL = Ask + SLext*Point; } //Ïîêóïêà if(//Ñîáñòâåííî ñèãíàë (BR1Sig1 > 0 && BR1Sig1 < 1000) //1é èíäèêàòîð äàë ñèãíàë && //Ïîäòâåðæäåíèå 2ì èíäèêàòîðîì ( (BR2Sig1 > 0 && BR2Sig1 < 1000) //2é èíäèêàòîð äàë ñèãíàë || (BR2Stop1 > 0 && BR2Stop1 < 1000) //2é èíäèêàòîð ñòîï íå ïðîòèâ ) && //Ïîäòâåðæäåíèå ìëàäøèì TF ( (BRLowSig1 > 0 && BRLowSig1 < 1000) //LowTFé èíäèêàòîð äàë ñèãíàë || (BRLowStop1 > 0 && BRLowStop1 < 1000) //LowTFé èíäèêàòîð ñòîï íå ïðîòèâ ) /* && //Ïîäòâåðæäåíèå òðåéëèíãîì TF ( (BRTRSig1 > 0 && BRTRSig1 < 1000) //LowTFé èíäèêàòîð äàë ñèãíàë || (BRTRStop1 > 0 && BRTRStop1 < 1000) //LowTFé èíäèêàòîð ñòîï íå ïðîòèâ ) */ /* && //Öâåò áàðà ( (BR1Bar2 > BR1Bar1) ) */ && //Âòîðè÷íûé ôèëüòð ( (ADXADXCurr > ADXMnsCurr) // && // (ADXMnsCurr > ADXPlsCurr) // && // (ADXADXCurr > ADXADXPrev) // && // (ADXMnsCurr > ADXMnsPrev) ) ) { TradeType = 1; if(SLext == 0) SL = BR2Stop1; else SL = Bid - SLext*Point; } /* FileWrite(handle, TimeToStr(CurTime()), Ask, Bid, BR1Bar1, BR1Bar2, BR1Sig1, BR1Sig2, BR1Stop1, BR1Stop2, BR2Bar1, BR2Bar2, BR2Sig1, BR2Sig2, BR2Stop1, BR2Stop2, BRLowBar1, BRLowBar2, BRLowSig1, BRLowSig2, BRLowStop1, BRLowStop2, BRTRBar1, BRTRBar2, BRTRSig1, BRTRSig2, BRTRStop1, BRTRStop2, ADXADXCurr, ADXADXPrev, ADXPlsCurr, ADXMnsCurr, ADXPlsPrev, ADXMnsPrev, TradeType); FileFlush(handle); */ TP = 0.0; RealTotal = 0; total = OrdersTotal(); //Èùåì ðåàëüíîå ÷èëî òðãîâûõ îðäåðîâ for (cnt = 0; cnt < total; cnt++) { OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES); if (OrderMagicNumber() == MagicNumber && OrderSymbol() == Symbol()) { RealTotal = RealTotal + 1; iModFlag = 0; //Âåäåì ïîçèöèþ if(OrderType() == OP_BUY) { // if(TradeType == -1) // { // OrderClose(OrderTicket(), OrderLots(), Bid, 3, Yellow); // return(0); // } if(BRTRStop1 > OrderOpenPrice() && BRTRStop1 > OrderStopLoss()) { //Åñëè ïîòåíöèàëüíûé áåçóáûòîê - âåäåì ïî BRTRStop SL = BRTRStop1; iModFlag = 1; } else if(OrderStopLoss() < MathMin(BR1Sig1, MathMin(BR2Stop1, BRLowStop1))) { //Ïðîñòî ïîäòÿãèâàåì SL SL = MathMin(BR1Sig1, MathMin(BR2Stop1, BRLowStop1)); iModFlag = 1; } else return(0); if((Ask - SL)*Point > MarketInfo(Symbol(), MODE_STOPLEVEL) || SL == 0.0) SL = Ask - MarketInfo(Symbol(), MODE_STOPLEVEL)*Point; } else { // if(TradeType == 1) // { // OrderClose(OrderTicket(), OrderLots(), Ask, 3, Yellow); // return(0); // } if(BRTRStop2 < OrderOpenPrice() && BRTRStop2 < OrderStopLoss()) { //Åñëè ïîòåíöèàëüíûé áåçóáûòîê - âåäåì ïî BRTRStop SL = BRTRStop2; iModFlag = 1; } else if(OrderStopLoss() > MathMax(BR1Sig2, MathMax(BR2Stop2, BRLowStop2))) { //Ïðîñòî ïîäòÿãèâàåì SL SL = MathMax(BR1Sig2, MathMin(BR2Stop2, BRLowStop2)); iModFlag = 1; } else return(0); if((SL - Bid)*Point > MarketInfo(Symbol(), MODE_STOPLEVEL) || SL == 0.0) SL = Bid + (MarketInfo(Symbol(), MODE_STOPLEVEL)+1)*Point; } if(iModFlag == 1) IMod(OrderTicket(), 0.0, SL); return(0); } } if(RealTotal == 0) { if(TradeType == 1) { if(TPext != 0) TP = Ask + TPext*Point; else TP = 0.0; IBuy(TP, SL); } if(TradeType == -1) { if(TPext != 0) TP = Bid - TPext*Point; else TP = 0.0; ISell(TP, SL); } } return(0); } void IMod(int OrderTicketPar, double TPPar, double SLPar) { ShowIndicator("Buy", OBJ_ARROW, Yellow, SYMBOL_CHECKSIGN, 5); OrderModify(OrderTicketPar, 0.0, SLPar, TPPar, 0, Yellow); } void IBuy(double TPPar, double SLPar) { ShowIndicator("Buy", OBJ_ARROW, Magenta, SYMBOL_THUMBSUP, 5); OrderSend(Symbol(), OP_BUY, 0.1, Ask, 3, SLPar, TPPar, "e-BrainTrend", MagicNumber, 0, Blue); } void ISell(double TPPar, double SLPar) { ShowIndicator("Sell", OBJ_ARROW, Yellow, SYMBOL_THUMBSDOWN, 5); OrderSend(Symbol(), OP_SELL, 0.1, Bid, 3, SLPar, TPPar, "e-BrainTrend", MagicNumber, 0, Red); } //+------------------------------------------------------------------+ //| Èíäèêàòîð "÷åãî-òî" //+------------------------------------------------------------------+ void ShowIndicator(string TextPr, int TypeIndic, int ColorShow, int SymbolShow, int Width) { ObjectCreate(TextPr+trCount,TypeIndic,0,Time[0],Ask); ObjectSet(TextPr+trCount,OBJPROP_ARROWCODE,SymbolShow); ObjectSet(TextPr+trCount,OBJPROP_WIDTH,Width); ObjectSet(TextPr+trCount,OBJPROP_COLOR,ColorShow); ObjectSetText(TextPr+trCount,TextPr,10); trCount++; } //+------------------------------------------------------------------+

Free Expert Advisor - Envelope Breakout System

EXPERT ADVISOR//+------------------------------------------------------------------+ //| Envelope ...

EXPERT ADVISOR
//+------------------------------------------------------------------+ //| Envelope.mq4 | //| Copyright © 2005,tageiger aka Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo. | //| http://www.metaquotes.net | //+------------------------------------------------------------------+ #property copyright "Copyright © 2005,tageiger aka Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo." #property link "http://www.metaquotes.net" extern int EnvTimeFrame =5; //envelope time frame: 0=chart,60=1hr,240=4hr, etc. extern int EnvelopePeriod =144; //moving average length extern int EnvMaMethod =1; //0=sma,1=ema,2=smma,3=lwma. extern int MaShift =0; //shift relative to current bar indicator data is posted extern double EnvelopeDeviation =0.4; //envelope width extern bool UseMaElineTSL? =true; //enable moving average or Opposite Envelope line trailing SL extern int MaElineTSL =0; //see notes below /*0=iMA trailing SL 1=Opposite Envelope line trailing SL 2=Near Envelope line trailing SL (for 15m or greater periods, when price breaks out of the envelopes)*/ extern bool BreakEvenTSL? =false; //enable break even trailing stoploss extern int BreakEvenPips =1; //pips above/below OrderOpenPrice for breakeven SL extern bool FastMaTSL? =false; //enable fast ma trailing stoploss extern int FastMaPeriod =55; //FastMaTSL moving average length extern int FastMaMethod =0; //0=sma,1=ema,2=smma,3=lwma. extern int FastMaShift =0; //shift relative to current bar indicator data is posted extern bool FixedPipTSL? =false; //enable fixed pip trailing stoploss extern int FixedPipTSLPips =0; //pips to trail extern int FixedPipTSLTrigger=0; //pips in profit before trailing stoploss is triggered extern int TimeBegin =0; //server time order placement begins extern int TimeEnd =18; //server time order placement ends extern double TimeDelete =23; //server time unexecuted orders deleted extern double FirstTP =21.0; //1st TP in pips extern double SecondTP =34.0; //2nd TP in pips extern double ThirdTP =55.0; //3rd TP in pips extern int Lot.Margin =1000; //Margin for 1 lot traded extern double MaximumRisk =0.02; //%account balance to risk per position extern double DecreaseFactor =3; //lot size divisor(reducer) during loss streak extern bool DeleteOrders? =false; //deletes pending stop orders if true extern bool CloseOrders? =false; //closes open orders if true, regardless of profit status. extern int Slippage =2; //applies to closeorders() int b1,b2,b3,s1,s2,s3; double ssl,bsl,TSL; string comment ="m e.3.03"; string TradeSymbol; TradeSymbol=Symbol(); int init(){return(0);} int deinit(){return(0);} int start() { double btp1,btp2,btp3,stp1,stp2,stp3; double bline=0,sline=0,ma=0; int cnt, ticket,total=OrdersTotal(); ma=iMA(NULL,EnvTimeFrame,EnvelopePeriod,MaShift,EnvMaMethod,PRICE_CLOSE,0); bline=iEnvelopes(NULL,EnvTimeFrame,EnvelopePeriod,EnvMaMethod,0,PRICE_CLOSE,EnvelopeDeviation,MODE_UPPER,0); sline=iEnvelopes(NULL,EnvTimeFrame,EnvelopePeriod,EnvMaMethod,0,PRICE_CLOSE,EnvelopeDeviation,MODE_LOWER,0); if(TotalTradesThisSymbol(TradeSymbol)==0) { b1=0;b2=0;b3=0;s1=0;s2=0;s3=0; } if(TotalTradesThisSymbol(TradeSymbol)>0) { for(cnt=0;cnt<total;cnt++) { OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES); if(OrderSymbol()==TradeSymbol) { if(OrderMagicNumber()==21) {b1=OrderTicket(); } if(OrderMagicNumber()==41) {b2=OrderTicket(); } if(OrderMagicNumber()==61) {b3=OrderTicket(); } if(OrderMagicNumber()==11) {s1=OrderTicket(); } if(OrderMagicNumber()==31) {s2=OrderTicket(); } if(OrderMagicNumber()==51) {s3=OrderTicket(); } } } } if(DeleteOrders?) deleteorders(); if(CloseOrders?) closeorders(); if(b1==0) { if(Hour()>=TimeBegin && Hour()<TimeEnd) { if(bline>Close[0] && sline<Close[0]) { btp1=(NormalizeDouble(bline,Digits))+(FirstTP*Point); ticket=OrderSend(Symbol(), OP_BUYSTOP, LotsOptimized(), (NormalizeDouble(bline,Digits)), 0, (NormalizeDouble(sline,Digits)), btp1, Period()+comment+"btp1", 21, timedelete(), Aqua); if(ticket>0) { if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) { b1=ticket; Print(ticket); } else Print("Error Opening BuyStop Order: ",GetLastError()); return(0); } } } } if(b2==0) { if(Hour()>=TimeBegin && Hour()<TimeEnd) { if(bline>Close[0] && sline<Close[0]) { btp2=(NormalizeDouble(bline,Digits))+(SecondTP*Point); ticket=OrderSend(Symbol(), OP_BUYSTOP, LotsOptimized(), (NormalizeDouble(bline,Digits)), 0, (NormalizeDouble(sline,Digits)), btp2, Period()+comment+"btp2", 41, timedelete(), Aqua); if(ticket>0) { if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) { b2=ticket; Print(ticket); } else Print("Error Opening BuyStop Order: ",GetLastError()); return(0); } } } } if(b3==0) { if(Hour()>=TimeBegin && Hour()<TimeEnd) { if(bline>Close[0] && sline<Close[0]) { btp3=(NormalizeDouble(bline,Digits))+(ThirdTP*Point); ticket=OrderSend(Symbol(), OP_BUYSTOP, LotsOptimized(), (NormalizeDouble(bline,Digits)), 0, (NormalizeDouble(sline,Digits)), btp3, Period()+comment+"btp3", 61, timedelete(), Aqua); if(ticket>0) { if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) { b3=ticket; Print(ticket); } else Print("Error Opening BuyStop Order: ",GetLastError()); return(0); } } } } if(s1==0) { if(Hour()>=TimeBegin && Hour()<TimeEnd) { if(bline>Close[0] && sline<Close[0]) { stp1=NormalizeDouble(sline,Digits)-(FirstTP*Point); ticket=OrderSend(Symbol(), OP_SELLSTOP, LotsOptimized(), (NormalizeDouble(sline,Digits)), 0, (NormalizeDouble(bline,Digits)), stp1, Period()+comment+"stp1", 11, timedelete(), HotPink); if(ticket>0) { if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) { s1=ticket; Print(ticket); } else Print("Error Opening SellStop Order: ",GetLastError()); return(0); } } } } if(s2==0) { if(Hour()>=TimeBegin && Hour()<TimeEnd) { if(bline>Close[0] && sline<Close[0]) { stp2=NormalizeDouble(sline,Digits)-(SecondTP*Point); ticket=OrderSend(Symbol(), OP_SELLSTOP, LotsOptimized(), (NormalizeDouble(sline,Digits)), 0, (NormalizeDouble(bline,Digits)), stp2, Period()+comment+"stp2", 31, timedelete(), HotPink); if(ticket>0) { if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) { s2=ticket; Print(ticket); } else Print("Error Opening SellStop Order: ",GetLastError()); return(0); } } } } if(s3==0) { if(Hour()>=TimeBegin && Hour()<TimeEnd) { if(bline>Close[0] && sline<Close[0]) { stp3=NormalizeDouble(sline,Digits)-(ThirdTP*Point); ticket=OrderSend(Symbol(), OP_SELLSTOP, LotsOptimized(), (NormalizeDouble(sline,Digits)), 0, (NormalizeDouble(bline,Digits)), stp3, Period()+comment+"stp3", 51, timedelete(), HotPink); if(ticket>0) { if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) { s3=ticket; Print(ticket); } else Print("Error Opening SellStop Order: ",GetLastError()); return(0); } } } } for(cnt=0;cnt<total;cnt++) { OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES); if(OrderType()==OP_BUY && IsTradeAllowed() && OrderSymbol()==Symbol() && (OrderMagicNumber()==21 || OrderMagicNumber()==41 || OrderMagicNumber()==61)) { if(BreakEvenTSL?) {TSL=breakevenTSL();} if(FastMaTSL?) {TSL=fastmaTSL();} if(FixedPipTSL?) {TSL=fixedpipTSL();} if(UseMaElineTSL?) { if(MaElineTSL==0) {TSL=NormalizeDouble(ma,Digits);} if(MaElineTSL==1) {TSL=NormalizeDouble(sline,Digits);} if(MaElineTSL==2) {TSL=NormalizeDouble(bline,Digits);}} if(Bid>OrderOpenPrice() && TSL>OrderStopLoss()) { bsl=TSL; if(bsl==0 || bsl<OrderStopLoss()) {return(0);} OrderModify(OrderTicket(), OrderOpenPrice(), bsl, OrderTakeProfit(), OrderExpiration(), Green); } } if(OrderType()==OP_SELL && IsTradeAllowed() && OrderSymbol()==Symbol() && (OrderMagicNumber()==11 || OrderMagicNumber()==31 || OrderMagicNumber()==51)) { if(BreakEvenTSL?) {TSL=breakevenTSL();} if(FastMaTSL?) {TSL=fastmaTSL();} if(FixedPipTSL?) {TSL=fixedpipTSL();} if(UseMaElineTSL?) { if(MaElineTSL==0) {TSL=NormalizeDouble(ma,Digits);} if(MaElineTSL==1) {TSL=NormalizeDouble(bline,Digits);} if(MaElineTSL==2) {TSL=NormalizeDouble(sline,Digits);}} if(Ask<OrderOpenPrice() && TSL<OrderStopLoss()) { ssl=TSL; if(ssl==0 || ssl>OrderStopLoss()) {return(0);} OrderModify(OrderTicket(), OrderOpenPrice(), ssl, OrderTakeProfit(), OrderExpiration(), Red); } } OrderSelect(b1,SELECT_BY_TICKET); if(OrderCloseTime()>0) {b1=0; SendMail(Symbol()+" "+OrderComment(),"$"+DoubleToStr(OrderProfit(),2)); } OrderSelect(b2,SELECT_BY_TICKET); if(OrderCloseTime()>0) {b2=0; SendMail(Symbol()+" "+OrderComment(),"$"+DoubleToStr(OrderProfit(),2)); } OrderSelect(b3,SELECT_BY_TICKET); if(OrderCloseTime()>0) {b3=0; SendMail(Symbol()+" "+OrderComment(),"$"+DoubleToStr(OrderProfit(),2)); } OrderSelect(s1,SELECT_BY_TICKET); if(OrderCloseTime()>0) {s1=0; SendMail(Symbol()+" "+OrderComment(),"$"+DoubleToStr(OrderProfit(),2)); } OrderSelect(s2,SELECT_BY_TICKET); if(OrderCloseTime()>0) {s2=0; SendMail(Symbol()+" "+OrderComment(),"$"+DoubleToStr(OrderProfit(),2)); } OrderSelect(s3,SELECT_BY_TICKET); if(OrderCloseTime()>0) {s3=0; SendMail(Symbol()+" "+OrderComment(),"$"+DoubleToStr(OrderProfit(),2)); } } if(!IsTesting()) { PrintComments(); } return(0); } //Functions double LotsOptimized() { double lot; int orders=HistoryTotal(); int losses=0; lot=NormalizeDouble(AccountFreeMargin()*MaximumRisk/Lot.Margin,2); if(DecreaseFactor>0) { for(int i=orders-1;i>=0;i--) { if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY)==false) { Print("Error in history!"); break; } if(OrderSymbol()!=Symbol() || OrderType()>OP_SELL) continue; if(OrderProfit()>0) break; if(OrderProfit()<0) losses++; } if(losses>1) lot=NormalizeDouble(lot-lot*losses/DecreaseFactor,2); } if(lot<0.05) lot=0.05; return(lot); }//end LotsOptimized int TotalTradesThisSymbol(string TradeSymbol) { int i, TradesThisSymbol=0; for(i=0;i<OrdersTotal();i++) { OrderSelect(i,SELECT_BY_POS); if(OrderSymbol()==TradeSymbol && (OrderMagicNumber()==11 || OrderMagicNumber()==21 || OrderMagicNumber()==31 || OrderMagicNumber()==41 || OrderMagicNumber()==51 || OrderMagicNumber()==61)) { TradesThisSymbol++; } } return(TradesThisSymbol); }//end TotalTradesThisSymbol void PrintComments() { Comment("Current Time: ",TimeToStr(CurTime(),TIME_DATE|TIME_SECONDS),"\n", "Delete Time: ",TimeToStr(timedelete(),TIME_DATE|TIME_MINUTES)); } int deleteorders() { int d; TimeBegin=Hour()+1; for(d=0;d<OrdersTotal();d++) { OrderSelect(d,SELECT_BY_POS); if(OrderType()==OP_BUYSTOP && OrderSymbol()==Symbol() && IsTradeAllowed() && (OrderMagicNumber()==21 || OrderMagicNumber()==41 || OrderMagicNumber()==61)) { OrderDelete(OrderTicket()); if(OrderTicket()==b1) {b1=0; return;} if(OrderTicket()==b2) {b2=0; return;} if(OrderTicket()==b3) {b3=0; return;} } if(OrderType()==OP_SELLSTOP && OrderSymbol()==Symbol() && IsTradeAllowed() && (OrderMagicNumber()==11 || OrderMagicNumber()==31 || OrderMagicNumber()==51)) { OrderDelete(OrderTicket()); if(OrderTicket()==s1) {s1=0; return;} if(OrderTicket()==s2) {s2=0; return;} if(OrderTicket()==s3) {s3=0; return;} } } return(0);}//end delete orders int closeorders() { int c; TimeBegin=Hour()+1; for(c=0;c<OrdersTotal();c++) { OrderSelect(c,SELECT_BY_POS); if(OrderType()==OP_BUY && OrderSymbol()==Symbol() && IsTradeAllowed() && (OrderMagicNumber()==21 || OrderMagicNumber()==41 || OrderMagicNumber()==61)) { OrderClose(OrderTicket(),OrderLots(),Bid,Slippage,DarkOrchid); if(OrderTicket()==b1) {b1=0; return;} if(OrderTicket()==b2) {b2=0; return;} if(OrderTicket()==b3) {b3=0; return;} } if(OrderType()==OP_SELL && OrderSymbol()==Symbol() && IsTradeAllowed() && (OrderMagicNumber()==11 || OrderMagicNumber()==31 || OrderMagicNumber()==51)) { OrderClose(OrderTicket(),OrderLots(),Ask,Slippage,DarkOrange); if(OrderTicket()==s1) {s1=0; return;} if(OrderTicket()==s2) {s2=0; return;} if(OrderTicket()==s3) {s3=0; return;} } } return(0);}//end closeorders datetime timedelete() { string date=TimeToStr(CurTime(),TIME_DATE); string hour=DoubleToStr(TimeDelete,0); string minutes=":00"; return(StrToTime(date+" "+hour+minutes));}//end timedelete double breakevenTSL() { double beTSL; for(int cnt=0;cnt<OrdersTotal();cnt++) { OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES); if(OrderType()==OP_BUY && OrderSymbol()==Symbol() && (OrderMagicNumber()==21 || OrderMagicNumber()==41 || OrderMagicNumber()==61)) { if(Bid-OrderOpenPrice()>=Point*FirstTP) { beTSL=OrderOpenPrice()+(BreakEvenPips*Point);}} if(OrderType()==OP_SELL && OrderSymbol()==Symbol() && (OrderMagicNumber()==11 || OrderMagicNumber()==31 || OrderMagicNumber()==51)) { if(OrderOpenPrice()-Ask>=Point*FirstTP) { beTSL=OrderOpenPrice()-(BreakEvenPips*Point);}}} return(beTSL);} double fastmaTSL() { double fmaTSL; fmaTSL=iMA(Symbol(),EnvTimeFrame,FastMaPeriod,FastMaShift,FastMaMethod,PRICE_CLOSE,0); return(NormalizeDouble(fmaTSL,Digits));} double fixedpipTSL() { double fpTSL; for(int cnt=0;cnt<OrdersTotal();cnt++) { OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES); if(OrderType()==OP_BUY && OrderSymbol()==Symbol() && (OrderMagicNumber()==21 || OrderMagicNumber()==41 || OrderMagicNumber()==61)) { if(Bid-OrderOpenPrice()>(FixedPipTSLTrigger*Point) && OrderStopLoss()<Bid-Point*FixedPipTSLPips) { fpTSL=Bid-Point*FixedPipTSLPips;}} if(OrderType()==OP_SELL && OrderSymbol()==Symbol() && (OrderMagicNumber()==11 || OrderMagicNumber()==31 || OrderMagicNumber()==51)) { if(OrderOpenPrice()-Ask>(FixedPipTSLTrigger*Point) && OrderStopLoss()>Ask+Point*FixedPipTSLPips) { fpTSL=Ask+Point*FixedPipTSLPips;}}} return(fpTSL);}

Free Expert Advisor - KSRobot 1 5

/* * Kijun Sen Robot * * Copyright ® 2005 Noam Koren (Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per ...

/*
 * Kijun Sen Robot
 *
 * Copyright ® 2005 Noam Koren (Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo.)
 *
 * o Based on Akash discussion at Moneytech ("Great technique for beginners")
 *
 * o Disclaimer :   Distributed for forward testing purposes.
 *                  This expert was never tested on a live account - use at your own risk! 
 *                  In other words - DO NOT USE ON A LIVE ACCOUNT !
 *
 * o Attach to 30 Minute chart
 *
 *
 * $Log: KSRobot.mq4,v $
 * Revision 1.5  2005/10/18 11:10:09  noam
 * 1) Added alerts
 *
 * 2) Modified S/L rules to reduce average S/L size - if a bar closes with MA in the wrong direction exit if B/E was not hit yet.
 *
 * 3) Modified Entry rule - Wait for BID to cross KS for Long and ASK to cross down for Short. This helps to filter out faulty signals.
 *
 * 4) Modified Entry rule - only enter if KS is Horizontal OR in the same direction of entry.
 *
 * Revision 1.4  2005/10/08 18:19:58  noam
 * 1) Added slope: allows filtering out trades if the slope of KS line is too vertical (too = defined by user)
 * 2) Added optimized values per currency. This can be overrider by setting UseOptimizedValues to false.
 * 3) Added a comment to provide some information to the user while the expert is attached.
 *
 * Experimental
 * E1) Added two experimental stop loss tactics (not used unless by default):
 * 	a) PSAR
 * 	b) Exit if not at BE after X bars
 *
 * Revision 1.3  2005/09/21 01:00:47  noam
 * Use limit order / market order depending on current price
 * Do not clear cross value until order is sent
 * Added some printouts
 *
 * Revision 1.2  2005/09/20 17:11:12  noam
 * Added disclaimer
 * Added price normalization
 * Adjusted time limits to fit MT4 time
 *
 * Revision 1.1  2005/09/19 20:34:57  noam
 * Initial Kijun Sen Robot version
 * Backtested on 30M GBP/USD
 *
 */

/*
 * TODO: 
 * 
 * 1) Find a way to improve profit taking - TS is good but misses much of trendy moves. Maybe 
 *    switch to EMA signal once X pips are secure?
 * 
 * 2) Find out why entering only once per bar hits performance.
 *
 * 3) Add 2% money management rule.
 *
 */

#property copyright "Noam Koren"

/* expert specific parameters */
#define EXPERT_COLOR    Yellow 
#define EXPERT_STRING   "Kijun Sen Robot"
#define EXPERT_MAGIC    13

#define UP      1
#define DOWN    -1
#define NEUTRAL 0

/*  
    Optimized results 
    
    GBP/USD:
    4.38	1000.00	8.38%	StopLoss=50 	BreakEven=9 TrailingStop=10 	MAfilter=6 	TakeProfit=120
    
    EUR/USD:
    2.68	1520.00	12.24%	StopLoss=60 	BreakEven=9 TrailingStop=6 	   MAfilter=6 	TakeProfit=120
        
*/

int      MaxOpenPositions = 1;

/* Default parameters. */
int      TakeProfit      = 120;  /* default 120 */
extern int      StopLoss        = 50;   /* 50  very imporant to allow for a substaintial movement in the other direction */
extern int      BreakEven       = 9;    /* default = 9 */
extern int      TrailingStop    = 10;   /* default 10 */
extern int      MAfilter        = 6;    /* MA must be at least 6 pips away from KS in order to be valid */

extern bool     UseOptimizedValues = true;

/* MM */
extern double   Lots    = 1;

int TenkanSen           = 9;
int KijunSen            = 26;
int Senkou              = 52;

/* globals */

double lastbid          =   0.0;
double lastask          =   0.0;

double longcross        =   0.0;
double shortcross       =   0.0;

double longentry        =   0.0;
double shortentry       =   0.0;

int daystart            = 7; /* 5AM GMT */
int dayend              = 19;/* 5PM GMT */

int MAdir               = NEUTRAL;
int precision           = 4;
int lastbar             = 0;
bool newbar             = false;


/* generic init functions */
int init()  {


    if (UseOptimizedValues == true){
        /* set parameters based on pair */
        if (Symbol()=="GBPUSD")  {StopLoss=50; BreakEven=9; TrailingStop=10; MAfilter=6;}    
        if (Symbol()=="EURUSD")  {StopLoss=60; BreakEven=9; TrailingStop=6;  MAfilter=6;}      
    }
    precision = SymbolPrecision();
    lastbar = Time[0];
    return(0);  
}
int deinit(){   return(0);  }

/* expert specific utility functions */

int SymbolPrecision() {
    return (MarketInfo(Symbol(), MODE_DIGITS));
}

int OpenPosition()
{        

    double KS       = iIchimoku(NULL, 0, TenkanSen, KijunSen, Senkou, MODE_KIJUNSEN, 0);
    double KS1      = iIchimoku(NULL, 0, TenkanSen, KijunSen, Senkou, MODE_KIJUNSEN, 1);
    double KS2      = iIchimoku(NULL, 0, TenkanSen, KijunSen, Senkou, MODE_KIJUNSEN, 2);
    
    double Ema20    = iMA(NULL,0,20,0,MODE_LWMA,PRICE_CLOSE,0);
    double PEma20   = iMA(NULL,0,20,0,MODE_LWMA,PRICE_CLOSE,1);

    double PSAR     = iSAR(NULL, 0, 0.02, 0.2, 0); /* fast parabolic for tight exits */
        
    if (lastbid == 0.0) lastbid = Bid;
    if (lastask == 0.0) lastask = Ask;

    /* Make sure the time is right */
    if ( Hour() < daystart || Hour() > dayend-1 ) return (0);
            
    /* KS cross */
    if ( Open[0] < KS && lastbid < KS && Bid > KS && longcross == 0 && KS >= KS2) {

        /* the cross is only interesting if the KS line is above the MA  */  
        if ( Ema20 < KS - MAfilter * Point ) {
                longcross = KS;
                shortcross = 0;
         }
    }
    
    if ( Open[0] > KS && lastask > KS && Ask < KS && shortcross == 0 && KS <= KS2) {
        /* the cross is only interesting if the KS line is under the MA  */
        if ( Ema20 > KS + MAfilter * Point ) { 
            shortcross = KS;
            longcross = 0;
        }

    }
    
    /* check MA direction */
    if ( PEma20 < Ema20 ){
        MAdir = UP;            
    }
    
    if ( PEma20 > Ema20 ){
        MAdir = DOWN;
    }

    
    /* once the MA is pointing in the right direction set the the entry price to be the current KS */
    if (MAdir == UP && longcross != 0 && longentry == 0){
        longentry = NormalizeDouble( KS, precision );      
        return (1);
    }       


    /* once the MA is pointing in the right direction set the the entry price to be the current KS */
    if (MAdir == DOWN && shortcross != 0 && shortentry == 0){
        shortentry = NormalizeDouble( KS, precision );
        return (-1);
    }
    
    lastbid = Bid;
    lastask = Ask;
    return (0);

}

int ClosePosition() 
{
    
    double PEma20   = iMA(NULL,0,20,0,MODE_LWMA,PRICE_CLOSE,1);
    double PPEma20  = iMA(NULL,0,20,0,MODE_LWMA,PRICE_CLOSE,2);

    
    if ( OrderType() == OP_BUY ){
        if (newbar && PEma20 < PPEma20 && OrderStopLoss() < OrderOpenPrice() ){
            return (1);
        }
    } 

    if ( OrderType() == OP_SELL ){
        if (newbar && PEma20 > PPEma20 && OrderStopLoss() > OrderOpenPrice() ){
            return (-1);
        }
    } 

    return (0);
}


/* The expert logic */
int start()
{
    int cnt, experttickets, ticket, total, i, pos, action=0, method;
    double hardstop;
    datetime ticketexpiration = 0;

    /* make sure that the char is valid */
    if (Bars<100){
        Print("Invalid chart: less than 100 bars!");
        return (-1);
    }

    if ( ( Hour() < daystart || Hour() > dayend-1 ) ){
        Comment("\nTrading halted. (will start again at ", daystart, " AM )\n");
    } else {
        Comment("\nExpert is active. (will halt at ", dayend, " PM )\n");
        Comment("\nTS = ", TrailingStop, " BE = ", BreakEven, " SL = ", StopLoss, " MAfilter  = ", MAfilter,"\n");
    }
    total=OrdersTotal();

    if (Time[0] == lastbar) {
        newbar = false;
    } else {
        lastbar = Time[0];
        newbar = true;
    }

    /* Only allow one open position at a time (per expert)- so if there is an open position - do not open another one. */
   
    for(cnt=0,experttickets=0;cnt<total;cnt++) {
        OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
        if ( OrderSymbol()==Symbol() && OrderMagicNumber() == EXPERT_MAGIC) {
            experttickets=experttickets+1;
        }   
    }
    
   
    if(experttickets<MaxOpenPositions) {
     
        /* Set the number of lots - or exit if there is not enough margin */
        Lots = Lots;
        
        ticketexpiration = CurTime() + PERIOD_M30 * 60; /* orders are valid for half an hour */
     
        /* OpenPosition() has state so calling it again will mess up the results - this is why I call it
         * once and remember the return value before acting 
         */
         
        action = OpenPosition();

        /* check for long position (BUY) possibility */
      
        if ( action == 1 ) {
            if (Ask > longentry + 4 * Point)    method = OP_BUYLIMIT;
            if (Ask == longentry)   method = OP_BUY;
            if (Ask < longentry) {
                longentry = Ask;
                method = OP_BUY;
            }
            
            hardstop = NormalizeDouble( (longentry-StopLoss*Point), precision) ;
            Alert("KSRobot ", Symbol(), " Go Long @ ", longentry, "!");
            ticket=OrderSend(Symbol(),method,Lots,longentry,4,hardstop,Ask+TakeProfit*Point,EXPERT_STRING,EXPERT_MAGIC,ticketexpiration,White);            

            if(ticket>0) {
                if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) {
                    Print("BUY LIMIT  order sent : ",OrderOpenPrice(), "Ask = ", Ask, "\n" );
                }

                longcross = 0;


            } else {
                Print("Error opening BUY LIMIT order : ",GetLastError(), " SL = ", hardstop, " Ask = ", Ask, " Entry = ", longentry, " TP =",Ask+TakeProfit*Point, " Method = ", method,  "\n"); 
            }

            longentry = 0;
            
            return(0); 
        }
      
        /* check for short position (SELL) possibility */
        
        if ( action == -1  ) {
            hardstop = NormalizeDouble( (shortentry+StopLoss*Point), precision) ;
            Alert("KSRobot ", Symbol(), " KS Go Short @ ", shortentry, "!");

            if (Bid < shortentry - 4 * Point)   method = OP_SELLLIMIT;
            if (Bid == shortentry)  method = OP_SELL;
            if (Bid > shortentry) {
                shortentry = Bid;
                method = OP_SELL;
            }
            
            ticket=OrderSend(Symbol(),method,Lots,shortentry,4,hardstop,Bid-TakeProfit*Point,EXPERT_STRING,EXPERT_MAGIC,ticketexpiration,Red);
         
            if(ticket>0) {
                if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) {
                    Print("SELL LIMIT order sent : ",OrderOpenPrice(), "Bid = ", Bid, "\n");
                }

                shortcross = 0;


            } else { 
                Print("Error opening SELL LIMIT order : ",GetLastError(), " SL = ", hardstop, " Bid = ", Bid, " Entry = ", shortentry, " TP =",Bid-TakeProfit*Point, "method = ", method, "\n" ); 
            }

            shortentry = 0;
         
            return(0); 
        }
   
        /* do nothing */
        return(0);
    }
   
    /* if there are open positions - check if they need to be closed */
    for(cnt=0;cnt<total;cnt++) {
      
        lastbid = Bid;
        lastask = Ask;
        
        OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
        
        /* Check if there are positions that were opened by this expert for this symbol */
        if( OrderType()<=OP_SELL && OrderSymbol()==Symbol() && OrderMagicNumber() == EXPERT_MAGIC ) { 

            /* handle long position */
            if(OrderType()==OP_BUY) {            
            
                /* close if condition met */
                if ( ClosePosition()==1 ) {
                    OrderClose(OrderTicket(),OrderLots(),Bid,3,EXPERT_COLOR);
                    return (0);
                }

                /* set BreakEven if set */
                if (BreakEven>0){
                    if(Bid-OrderOpenPrice()>Point*BreakEven) {
                        if(OrderStopLoss()<OrderOpenPrice()) {
                            OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()+Point*1,OrderTakeProfit(),0,Gray);
                        }
                    }
                }

                /* update trailing stop */

                if(TrailingStop>0) {
                    
                    if(Bid-OrderOpenPrice()>Point*(TrailingStop)) {
                        if(OrderStopLoss()<Bid-Point*TrailingStop) {
                            OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TrailingStop,OrderTakeProfit(),0,Gray);
                            return(0);
                        }
                    }
               
                }
            } else {
            
            /* handle short position */

                /* close if condition met */            
                if (ClosePosition()==-1) {
                    OrderClose( OrderTicket(),OrderLots(),Ask,3,EXPERT_COLOR );
                    return (0);
                }

                /* set BreakEven if set */
                if (BreakEven>0){
                    
                    if(OrderOpenPrice()-Ask>Point*BreakEven) {
                        if(OrderStopLoss()>OrderOpenPrice()) {
                            OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()-Point*1,OrderTakeProfit(),0,Gray);
                        }
                    } 

                }
 
                /* update trailing stop */
                if(TrailingStop>0) {                 

                    if(OrderOpenPrice()-Ask>Point*(TrailingStop)) {
                        if(OrderStopLoss()>Ask+Point*TrailingStop) {
                            OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*TrailingStop,OrderTakeProfit(),0,Gray);
                            return(0);
                        }
                    } 
                } 
            } 
        } 
    } 

   return(0);
}

Free Expert Advisor - KSRobot 1 5

Expert Advisor/* * Kijun Sen Robot * * Copyright ® 2005 Noam Koren (Questo indirizzo email è protetto dagli spambots. È necessario abilitare ...

Expert Advisor


/* * Kijun Sen Robot * * Copyright ® 2005 Noam Koren (Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo.) * * o Based on Akash discussion at Moneytech ("Great technique for beginners") * * o Disclaimer : Distributed for forward testing purposes. * This expert was never tested on a live account - use at your own risk! * In other words - DO NOT USE ON A LIVE ACCOUNT ! * * o Attach to 30 Minute chart * * * $Log: KSRobot.mq4,v $ * Revision 1.5 2005/10/18 11:10:09 noam * 1) Added alerts * * 2) Modified S/L rules to reduce average S/L size - if a bar closes with MA in the wrong direction exit if B/E was not hit yet. * * 3) Modified Entry rule - Wait for BID to cross KS for Long and ASK to cross down for Short. This helps to filter out faulty signals. * * 4) Modified Entry rule - only enter if KS is Horizontal OR in the same direction of entry. * * Revision 1.4 2005/10/08 18:19:58 noam * 1) Added slope: allows filtering out trades if the slope of KS line is too vertical (too = defined by user) * 2) Added optimized values per currency. This can be overrider by setting UseOptimizedValues to false. * 3) Added a comment to provide some information to the user while the expert is attached. * * Experimental * E1) Added two experimental stop loss tactics (not used unless by default): * a) PSAR * b) Exit if not at BE after X bars * * Revision 1.3 2005/09/21 01:00:47 noam * Use limit order / market order depending on current price * Do not clear cross value until order is sent * Added some printouts * * Revision 1.2 2005/09/20 17:11:12 noam * Added disclaimer * Added price normalization * Adjusted time limits to fit MT4 time * * Revision 1.1 2005/09/19 20:34:57 noam * Initial Kijun Sen Robot version * Backtested on 30M GBP/USD * */ /* * TODO: * * 1) Find a way to improve profit taking - TS is good but misses much of trendy moves. Maybe * switch to EMA signal once X pips are secure? * * 2) Find out why entering only once per bar hits performance. * * 3) Add 2% money management rule. * */ #property copyright "Noam Koren" /* expert specific parameters */ #define EXPERT_COLOR Yellow #define EXPERT_STRING "Kijun Sen Robot" #define EXPERT_MAGIC 13 #define UP 1 #define DOWN -1 #define NEUTRAL 0 /* Optimized results GBP/USD: 4.38 1000.00 8.38% StopLoss=50 BreakEven=9 TrailingStop=10 MAfilter=6 TakeProfit=120 EUR/USD: 2.68 1520.00 12.24% StopLoss=60 BreakEven=9 TrailingStop=6 MAfilter=6 TakeProfit=120 */ int MaxOpenPositions = 1; /* Default parameters. */ int TakeProfit = 120; /* default 120 */ extern int StopLoss = 50; /* 50 very imporant to allow for a substaintial movement in the other direction */ extern int BreakEven = 9; /* default = 9 */ extern int TrailingStop = 10; /* default 10 */ extern int MAfilter = 6; /* MA must be at least 6 pips away from KS in order to be valid */ extern bool UseOptimizedValues = true; /* MM */ extern double Lots = 1; int TenkanSen = 9; int KijunSen = 26; int Senkou = 52; /* globals */ double lastbid = 0.0; double lastask = 0.0; double longcross = 0.0; double shortcross = 0.0; double longentry = 0.0; double shortentry = 0.0; int daystart = 7; /* 5AM GMT */ int dayend = 19;/* 5PM GMT */ int MAdir = NEUTRAL; int precision = 4; int lastbar = 0; bool newbar = false; /* generic init functions */ int init() { if (UseOptimizedValues == true){ /* set parameters based on pair */ if (Symbol()=="GBPUSD") {StopLoss=50; BreakEven=9; TrailingStop=10; MAfilter=6;} if (Symbol()=="EURUSD") {StopLoss=60; BreakEven=9; TrailingStop=6; MAfilter=6;} } precision = SymbolPrecision(); lastbar = Time[0]; return(0); } int deinit(){ return(0); } /* expert specific utility functions */ int SymbolPrecision() { return (MarketInfo(Symbol(), MODE_DIGITS)); } int OpenPosition() { double KS = iIchimoku(NULL, 0, TenkanSen, KijunSen, Senkou, MODE_KIJUNSEN, 0); double KS1 = iIchimoku(NULL, 0, TenkanSen, KijunSen, Senkou, MODE_KIJUNSEN, 1); double KS2 = iIchimoku(NULL, 0, TenkanSen, KijunSen, Senkou, MODE_KIJUNSEN, 2); double Ema20 = iMA(NULL,0,20,0,MODE_LWMA,PRICE_CLOSE,0); double PEma20 = iMA(NULL,0,20,0,MODE_LWMA,PRICE_CLOSE,1); double PSAR = iSAR(NULL, 0, 0.02, 0.2, 0); /* fast parabolic for tight exits */ if (lastbid == 0.0) lastbid = Bid; if (lastask == 0.0) lastask = Ask; /* Make sure the time is right */ if ( Hour() < daystart || Hour() > dayend-1 ) return (0); /* KS cross */ if ( Open[0] < KS && lastbid < KS && Bid > KS && longcross == 0 && KS >= KS2) { /* the cross is only interesting if the KS line is above the MA */ if ( Ema20 < KS - MAfilter * Point ) { longcross = KS; shortcross = 0; } } if ( Open[0] > KS && lastask > KS && Ask < KS && shortcross == 0 && KS <= KS2) { /* the cross is only interesting if the KS line is under the MA */ if ( Ema20 > KS + MAfilter * Point ) { shortcross = KS; longcross = 0; } } /* check MA direction */ if ( PEma20 < Ema20 ){ MAdir = UP; } if ( PEma20 > Ema20 ){ MAdir = DOWN; } /* once the MA is pointing in the right direction set the the entry price to be the current KS */ if (MAdir == UP && longcross != 0 && longentry == 0){ longentry = NormalizeDouble( KS, precision ); return (1); } /* once the MA is pointing in the right direction set the the entry price to be the current KS */ if (MAdir == DOWN && shortcross != 0 && shortentry == 0){ shortentry = NormalizeDouble( KS, precision ); return (-1); } lastbid = Bid; lastask = Ask; return (0); } int ClosePosition() { double PEma20 = iMA(NULL,0,20,0,MODE_LWMA,PRICE_CLOSE,1); double PPEma20 = iMA(NULL,0,20,0,MODE_LWMA,PRICE_CLOSE,2); if ( OrderType() == OP_BUY ){ if (newbar && PEma20 < PPEma20 && OrderStopLoss() < OrderOpenPrice() ){ return (1); } } if ( OrderType() == OP_SELL ){ if (newbar && PEma20 > PPEma20 && OrderStopLoss() > OrderOpenPrice() ){ return (-1); } } return (0); } /* The expert logic */ int start() { int cnt, experttickets, ticket, total, i, pos, action=0, method; double hardstop; datetime ticketexpiration = 0; /* make sure that the char is valid */ if (Bars<100){ Print("Invalid chart: less than 100 bars!"); return (-1); } if ( ( Hour() < daystart || Hour() > dayend-1 ) ){ Comment("\nTrading halted. (will start again at ", daystart, " AM )\n"); } else { Comment("\nExpert is active. (will halt at ", dayend, " PM )\n"); Comment("\nTS = ", TrailingStop, " BE = ", BreakEven, " SL = ", StopLoss, " MAfilter = ", MAfilter,"\n"); } total=OrdersTotal(); if (Time[0] == lastbar) { newbar = false; } else { lastbar = Time[0]; newbar = true; } /* Only allow one open position at a time (per expert)- so if there is an open position - do not open another one. */ for(cnt=0,experttickets=0;cnt<total;cnt++) { OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES); if ( OrderSymbol()==Symbol() && OrderMagicNumber() == EXPERT_MAGIC) { experttickets=experttickets+1; } } if(experttickets<MaxOpenPositions) { /* Set the number of lots - or exit if there is not enough margin */ Lots = Lots; ticketexpiration = CurTime() + PERIOD_M30 * 60; /* orders are valid for half an hour */ /* OpenPosition() has state so calling it again will mess up the results - this is why I call it * once and remember the return value before acting */ action = OpenPosition(); /* check for long position (BUY) possibility */ if ( action == 1 ) { if (Ask > longentry + 4 * Point) method = OP_BUYLIMIT; if (Ask == longentry) method = OP_BUY; if (Ask < longentry) { longentry = Ask; method = OP_BUY; } hardstop = NormalizeDouble( (longentry-StopLoss*Point), precision) ; Alert("KSRobot ", Symbol(), " Go Long @ ", longentry, "!"); ticket=OrderSend(Symbol(),method,Lots,longentry,4,hardstop,Ask+TakeProfit*Point,EXPERT_STRING,EXPERT_MAGIC,ticketexpiration,White); if(ticket>0) { if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) { Print("BUY LIMIT order sent : ",OrderOpenPrice(), "Ask = ", Ask, "\n" ); } longcross = 0; } else { Print("Error opening BUY LIMIT order : ",GetLastError(), " SL = ", hardstop, " Ask = ", Ask, " Entry = ", longentry, " TP =",Ask+TakeProfit*Point, " Method = ", method, "\n"); } longentry = 0; return(0); } /* check for short position (SELL) possibility */ if ( action == -1 ) { hardstop = NormalizeDouble( (shortentry+StopLoss*Point), precision) ; Alert("KSRobot ", Symbol(), " KS Go Short @ ", shortentry, "!"); if (Bid < shortentry - 4 * Point) method = OP_SELLLIMIT; if (Bid == shortentry) method = OP_SELL; if (Bid > shortentry) { shortentry = Bid; method = OP_SELL; } ticket=OrderSend(Symbol(),method,Lots,shortentry,4,hardstop,Bid-TakeProfit*Point,EXPERT_STRING,EXPERT_MAGIC,ticketexpiration,Red); if(ticket>0) { if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) { Print("SELL LIMIT order sent : ",OrderOpenPrice(), "Bid = ", Bid, "\n"); } shortcross = 0; } else { Print("Error opening SELL LIMIT order : ",GetLastError(), " SL = ", hardstop, " Bid = ", Bid, " Entry = ", shortentry, " TP =",Bid-TakeProfit*Point, "method = ", method, "\n" ); } shortentry = 0; return(0); } /* do nothing */ return(0); } /* if there are open positions - check if they need to be closed */ for(cnt=0;cnt<total;cnt++) { lastbid = Bid; lastask = Ask; OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES); /* Check if there are positions that were opened by this expert for this symbol */ if( OrderType()<=OP_SELL && OrderSymbol()==Symbol() && OrderMagicNumber() == EXPERT_MAGIC ) { /* handle long position */ if(OrderType()==OP_BUY) { /* close if condition met */ if ( ClosePosition()==1 ) { OrderClose(OrderTicket(),OrderLots(),Bid,3,EXPERT_COLOR); return (0); } /* set BreakEven if set */ if (BreakEven>0){ if(Bid-OrderOpenPrice()>Point*BreakEven) { if(OrderStopLoss()<OrderOpenPrice()) { OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()+Point*1,OrderTakeProfit(),0,Gray); } } } /* update trailing stop */ if(TrailingStop>0) { if(Bid-OrderOpenPrice()>Point*(TrailingStop)) { if(OrderStopLoss()<Bid-Point*TrailingStop) { OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TrailingStop,OrderTakeProfit(),0,Gray); return(0); } } } } else { /* handle short position */ /* close if condition met */ if (ClosePosition()==-1) { OrderClose( OrderTicket(),OrderLots(),Ask,3,EXPERT_COLOR ); return (0); } /* set BreakEven if set */ if (BreakEven>0){ if(OrderOpenPrice()-Ask>Point*BreakEven) { if(OrderStopLoss()>OrderOpenPrice()) { OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()-Point*1,OrderTakeProfit(),0,Gray); } } } /* update trailing stop */ if(TrailingStop>0) { if(OrderOpenPrice()-Ask>Point*(TrailingStop)) { if(OrderStopLoss()>Ask+Point*TrailingStop) { OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*TrailingStop,OrderTakeProfit(),0,Gray); return(0); } } } } } } return(0); }

Free Expert Advisor - MakeGrid193

Expert Advisor //+------------------------------------------------------------------+ //| MakeGrid1 ...

Expert Advisor


//+------------------------------------------------------------------+ //| MakeGrid193.mq4 | //| Copyright © 2005, hdb | //| http://www.dubois1.net/hdb | //+------------------------------------------------------------------+ #property copyright "Copyright © 2005, hdb" #property link "http://www.dubois1.net/hdb" //#property version "1.93" // DISCLAIMER ***** IMPORTANT NOTE ***** READ BEFORE USING ***** // This expert advisor can open and close real positions and hence do real trades and lose real money. // This is not a 'trading system' but a simple robot that places trades according to fixed rules. // The author has no pretentions as to the profitability of this system and does not suggest the use // of this EA other than for testing purposes in demo accounts. // Use of this system is free - but u may not resell it - and is without any garantee as to its // suitability for any purpose. // By using this program you implicitly acknowledge that you understand what it does and agree that // the author bears no responsibility for any losses. // Before using, please also check with your broker that his systems are adapted for the frequest trades // associated with this expert. // 1.8 changes // made wantLongs and wantShorts into local variables. Previously, if u set UseMACD to true, // it did longs and shorts and simply ignored the wantLongs and wantShorts flags. // Now, these flags are not ignored. // added a loop to check if there are 'illicit' open orders above or below the EMA when the limitEMA34 // flag is used. These accumulate over time and are never removed and is due to the EMA moving. // removed the switch instruction as they dont seem to work - replaced with if statements // made the EMA period variable // // 1.9 changes - as per kind suggestions of Gideon // Added a routine to delete orders and positions if they are older than keepOpenTimeLimit hours. // Added OsMA as a possible filter. Acts exactly like MACD. // Added 4 parameters for MACD or OsMA so that we can optimise // Also cleaned up the code a bit. // 1.92 changes by dave // added function openPOsitions to count the number of open positions // modified the order logic so that openPOsitions is not > GridMaxOpen // 1.93 added long term direction indicator // Added tradeForMinutes - will only trade for this time then stop till EA is reset. // // modified by cori. Using OrderMagicNumber to identify the trades of the grid extern int uniqueGridMagic = 11190; // Magic number of the trades. must be unique to identify // the trades of one grid extern double Lots = 0.01; // extern double GridSize = 25; // pips between orders - grid or mesh size extern double GridSteps = 10; // total number of orders to place extern double TakeProfit = 15 ; // number of ticks to take profit. normally is = grid size but u can override extern double StopLoss = 28; // if u want to add a stop loss. normal grids dont use stop losses extern int trailStop = 0; // will trail if > 0 extern double UpdateInterval = 1; // update orders every x minutes extern bool wantLongs = true; // do we want long positions extern bool wantShorts = true; // do we want short positions extern bool wantBreakout = true; // do we want longs above price, shorts below price extern bool wantCounter = true; // do we want longs below price, shorts above price extern bool limitEMA = true; // do we want longs above ema only, shorts below ema only extern int EMAperiod = 200; // the length of the EMA.. was previously fixed at 34 extern double GridMaxOpen = 0; // maximum number of open positions : implemented in v1.92 extern bool UseMACD = true; // if true, will use macd >0 for longs only, macd <0 for shorts only // on crossover, will cancel all pending orders. Works in conjunction with wantLongs and wantShorts. extern bool UseOsMA = false; // if true, will use OSMA > 0 for longs only, OSMA <0 for shorts only. used in same way as MACD. // If both UseMACD and UseOSMA atr true, OSMA is taken. extern bool CloseOpenPositions = false;// if UseMACD, do we also close open positions with a loss? extern bool doHouseKeeping = true; // this will remove long orders below the 34 ema and vv if limitEMA flag is true extern double keepOpenTimeLimit = 0; // in hours - if > 0, all open orders or positions will be closed after this period. fractions are permitted extern int emaFast = 20; // parameters for MACD and OSMA extern int emaSlow = 200; // parameters for MACD and OSMA extern int signalPeriod = 9; // parameters for MACD and OSMA extern int timeFrame = 0; // parameters for MACD and OSMA extern int minFromPrice = 0; // minimum distance from price to place trades. extern int tradeForMinutes=0; // will trade for this number of minutes after being initialised. // add/readd the EA before news and it will trade for these minutes then close out all positions at end extern int gridOffset = 0; // positions are opened at price modulo GridSize and offset with this parameter. // used essentially to enter at non round numbers // the following flags set bounds on the prices at which orders may be placed // this code was developed for and is kindly made public by Exc_ite2 extern double longGridCenter = 0; // defines the center point of a fixed width long grid extern double shortGridCenter = 0; // defines the center point of a fixed width short grid extern double longGridLow = 0; // defines the bottom of a fixed width long grid extern double longGridHigh = 0; // defines the top of a fixed width long grid extern double shortGridLow = 0; // defines the bottom of a fixed width short grid extern double shortGridHigh = 0; // defines the top of a fixed width short grid extern double profitTarget = 15000; // if > 0, will close out all positions once the $ target has been met extern bool suspendGrid = false; // if set to true, will close all unfilled Orders extern bool shutdownGrid = false; // if set to true, will close all orders and positions. // modified by cori. internal variables only string GridName = "MG200"; // identifies the grid. allows for several co-existing grids - old variable.. shold not use any more double LastUpdate = 0; // counter used to note time of last update double startTime = 0; // counter to note trade start time. double closedProfit = 0; // counts closed p&l double openProfit = 0; // counts open p&l double accumulatedProfit = 0; // for back testing only bool haveHitTarget = false; // if there is a target, this flag says we have hit it int openLongs = 0; // how many longs are open int openShorts = 0; // how many shorts are open bool gridActive = true; // is the grid active bool gridOneShot = false; // is this a one shot? if so, it stops after the profitTarget has been reached //+------------------------------------------------------------------+ //| expert initialization function | //+------------------------------------------------------------------+ int init() { //---- #property show_inputs // shows the parameters - thanks Slawa... //---- GridName = StringConcatenate( "MG200-", Symbol(),"-",uniqueGridMagic ); return(0); } //+------------------------------------------------------------------------+ //| tests if there is an open position or order in the region of atRate | //| will check for longs if checkLongs is true, else will check | //| for shorts | //+------------------------------------------------------------------------+ bool IsPosition(double atRate, double inRange, bool checkLongs ) { int totalorders = OrdersTotal(); for(int i=0;i<totalorders;i++) // scan all orders and positions... { OrderSelect(i, SELECT_BY_POS); // modified by cori. Using OrderMagicNumber to identify the trades of the grid // hdb added or gridname for compatibility if ( OrderSymbol()==Symbol() && ( (OrderMagicNumber() == uniqueGridMagic) || (OrderComment() == GridName)) ) // only look if mygrid and symbol... { int type = OrderType(); if (MathAbs( OrderOpenPrice() - atRate ) < (inRange*0.9)) // dont look for exact price but price proximity (less than gridsize) - added 0.9 because of floating point errors { if ( ( checkLongs && ( type == OP_BUY || type == OP_BUYLIMIT || type == OP_BUYSTOP ) ) || (!checkLongs && ( type == OP_SELL || type == OP_SELLLIMIT || type == OP_SELLSTOP ) ) ) { return(true); } } } } return(false); } //+------------------------------------------------------------------+ //| Delete order after x hours | //+------------------------------------------------------------------+ void DeleteAfter( double xHours ) // delete pending orders or open positions after x hours { int totalorders = OrdersTotal(); for(int i=totalorders-1;i>=0;i--) OrderSelect(i, SELECT_BY_POS, MODE_TRADES); // we use iTime so it works in backtesting if ( OrderSymbol()==Symbol() && ( (OrderMagicNumber() == uniqueGridMagic) || (OrderComment() == GridName)) ) // only look if mygrid and symbol... { if (( MathAbs(iTime(Symbol(),5,0)-OrderOpenTime()) >= xHours*60*60 ) && (iTime(Symbol(),5,0)>0)) { bool result = false; //Close opened long position if ( OrderType() == OP_BUY ) result = OrderClose( OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_BID), 5, Red ); //Close opened short position if ( OrderType() == OP_SELL ) result = OrderClose( OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_ASK), 5, Red ); //Close pending order if ( OrderType() > 1 ) result = OrderDelete( OrderTicket() ); } } } // proc DeleteAfter() //+------------------------------------------------------------------------+ //| cancells all pending orders | //+------------------------------------------------------------------------+ void CloseAllPendingOrders( ) { int totalorders = OrdersTotal(); for(int i=totalorders-1;i>=0;i--) // scan all orders and positions... { OrderSelect(i, SELECT_BY_POS); // modified as per cori. Using OrderMagicNumber to identify the trades of the grid // hdb added or gridname for compatibility if ( OrderSymbol()==Symbol() && ( (OrderMagicNumber() == uniqueGridMagic) || (OrderComment() == GridName)) ) // only look if mygrid and symbol... { if ( OrderType() > 1 ) bool result = OrderDelete( OrderTicket() ); } } return; } //+------------------------------------------------------------------------+ //| cancells all pending orders and closes open positions | //+------------------------------------------------------------------------+ void ClosePendingOrdersAndPositions() { int totalorders = OrdersTotal(); for(int i=totalorders-1;i>=0;i--) { OrderSelect(i, SELECT_BY_POS); bool result = false; // modified by cori. Using OrderMagicNumber to identify the trades of the grid // hdb added or gridname for compatibility if ( OrderSymbol()==Symbol() && ( (OrderMagicNumber() == uniqueGridMagic) || (OrderComment() == GridName)) ) // only look if mygrid and symbol... { //Close opened long positions if ( OrderType() == OP_BUY ) result = OrderClose( OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_BID), 5, Red ); //Close opened short positions if ( OrderType() == OP_SELL ) result = OrderClose( OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_ASK), 5, Red ); //Close pending orders if ( OrderType() > 1 ) result = OrderDelete( OrderTicket() ); } } return; } //+------------------------------------------------------------------------+ //| cancells all open orders which fall on the wrong side of the EMA | //+------------------------------------------------------------------------+ void CloseOrdersfromEMA( double theEMAValue ) { int totalorders = OrdersTotal(); for(int i=totalorders-1;i>=0;i--) // scan all orders and positions... { OrderSelect(i, SELECT_BY_POS); if ( OrderSymbol()==Symbol() && ( (OrderMagicNumber() == uniqueGridMagic) || (OrderComment() == GridName)) ) // only look if mygrid and symbol... { int type = OrderType(); bool result = false; //if (type > 1) Print(type," ",theEMAValue," ",OrderOpenPrice()); if ( type == OP_BUYLIMIT && OrderOpenPrice() <= theEMAValue ) result = OrderDelete( OrderTicket() ); if ( type == OP_BUYSTOP && OrderOpenPrice() <= theEMAValue ) result = OrderDelete( OrderTicket() ); if ( type == OP_SELLLIMIT && OrderOpenPrice() >= theEMAValue ) result = OrderDelete( OrderTicket() ); if ( type == OP_SELLSTOP && OrderOpenPrice() >= theEMAValue ) result = OrderDelete( OrderTicket() ); } } return; } //+------------------------------------------------------------------------+ //| counts the number of open positions | //+------------------------------------------------------------------------+ int openPositions( ) { int op =0; int totalorders = OrdersTotal(); for(int i=totalorders-1;i>=0;i--) // scan all orders and positions... { OrderSelect(i, SELECT_BY_POS); if ( OrderSymbol()==Symbol() && ( (OrderMagicNumber() == uniqueGridMagic) || (OrderComment() == GridName)) ) // only look if mygrid and symbol... { int type = OrderType(); if ( type == OP_BUY ) {op=op+1;} if ( type == OP_SELL ) {op=op+1;} } } return(op); } //+------------------------------------------------------------------+ //| Close on profit target | //+------------------------------------------------------------------+ void TestForProfit( int forMagic, double profittarget, bool testOpen, bool testHistory ) // based on trailing stop code from MT site... but modified as per Hiro { if (profittarget > 0 ) { closedProfit = 0; // counts closed p&l if (testHistory == true) { int total = HistoryTotal(); for(int i=0;i<total;i++) // scan all closed / cancelled transactions { OrderSelect(i, SELECT_BY_POS, MODE_HISTORY ); if ( OrderSymbol() == Symbol() && OrderMagicNumber() == forMagic ) // only look if mygrid and symbol... { closedProfit = closedProfit + OrderProfit(); } } } else { accumulatedProfit =0; } openProfit = 0; // counts open p&l if (testOpen == true) { total = OrdersTotal(); openLongs = 0; openShorts = 0; for(i=0;i<total;i++) // scan all open orders and positions { OrderSelect(i, SELECT_BY_POS ); if ( OrderSymbol() == Symbol() && OrderMagicNumber() == forMagic ) // only look if mygrid and symbol... { openProfit = openProfit + OrderProfit(); int type = OrderType(); if ( type == OP_BUY ) {openLongs=openLongs+1;} if ( type == OP_SELL ) {openShorts=openShorts+1;} } } } if ( ( closedProfit + openProfit) >= (profittarget + accumulatedProfit) ) { Print("Closing grid due to profit target"); ClosePendingOrdersAndPositions(); accumulatedProfit = accumulatedProfit + closedProfit + openProfit; haveHitTarget = true; if (gridOneShot==true) { gridActive = false; } } } } //+------------------------------------------------------------------+ //| Trailing stop procedure | //+------------------------------------------------------------------+ void TrailIt( int byPips ) // based on trailing stop code from MT site... thanks MT! { if (byPips >=5) { for (int i = 0; i < OrdersTotal(); i++) { OrderSelect(i, SELECT_BY_POS, MODE_TRADES); if ( OrderSymbol()==Symbol() && ( (OrderMagicNumber() == uniqueGridMagic) || (OrderComment() == GridName)) ) // only look if mygrid and symbol... { if (OrderType() == OP_BUY) { //if (Bid > (OrderValue(cnt,VAL_OPENPRICE) + TrailingStop * Point)) { // OrderClose(OrderTicket(), OrderLots(), Bid, 3, Violet); // break; //} if (Bid - OrderOpenPrice() > byPips * MarketInfo(OrderSymbol(), MODE_POINT)) { if (OrderStopLoss() < Bid - byPips * MarketInfo(OrderSymbol(), MODE_POINT)) { OrderModify(OrderTicket(), OrderOpenPrice(), Bid - byPips * MarketInfo(OrderSymbol(), MODE_POINT), OrderTakeProfit(), Red); } } } else if (OrderType() == OP_SELL) { if (OrderOpenPrice() - Ask > byPips * MarketInfo(OrderSymbol(), MODE_POINT)) { if ((OrderStopLoss() > Ask + byPips * MarketInfo(OrderSymbol(), MODE_POINT)) || (OrderStopLoss() == 0)) { OrderModify(OrderTicket(), OrderOpenPrice(), Ask + byPips * MarketInfo(OrderSymbol(), MODE_POINT), OrderTakeProfit(), Red); } } } } } } } // proc TrailIt() //+------------------------------------------------------------------+ //| script program start function | //+------------------------------------------------------------------+ int start() { //---- int i, j,k, ticket, entermode, totalorders; bool doit; double point, startrate, traderate, temp; //---- setup parameters if ( TakeProfit <= 0 ) // { TakeProfit = GridSize; } bool myWantLongs = wantLongs; bool myWantShorts = wantShorts; //---- test if we want to shutdown or suspend if (suspendGrid == true) { // close unfilled orders and then test if profit target CloseAllPendingOrders(); } if (shutdownGrid == true) { // close all positions and orders. then exit.. there is nothing more to do ClosePendingOrdersAndPositions(); return(0); } if (haveHitTarget == true) { // in case we hit target and there are still some open orders and positions ClosePendingOrdersAndPositions(); if (gridOneShot==true) { gridActive = false; } } //---- if (gridActive == false) { // if grid not active, do nothing. return(0); } //---- if (MathAbs(CurTime()-LastUpdate)> UpdateInterval*60) // we update the first time it is called and every UpdateInterval minutes { if (profitTarget >0) { TestForProfit(uniqueGridMagic, profitTarget, true, false ); if (!IsTesting()) { Comment(" v 1.93 "," Server time is ",TimeToStr(CurTime( )), "\n", // "\n"," Closed p&l = ",closedProfit, "\n"," Open p&l = ",openProfit, // "\n"," Total p&l = ",closedProfit + openProfit, "\n"," Long, Short = ",openLongs," ",openShorts, "\n"," Net pos = ",openLongs-openShorts, "\n", "\n"," Balance = ",AccountBalance(), "\n"," Equity = ",AccountEquity(), "\n"," Margin = ",AccountMargin(), "\n"," Free mrg = ",AccountFreeMargin(), ); } } LastUpdate = CurTime(); point = MarketInfo(Symbol(),MODE_POINT); startrate = ( Ask + point*GridSize/2 ) / point / GridSize; // round to a number of ticks divisible by GridSize k = startrate ; k = k * GridSize ; startrate = k * point - GridSize*GridSteps/2*point ; // calculate the lowest entry point double myEMA=iMA(NULL,0,EMAperiod,0,MODE_EMA,PRICE_CLOSE,0); int currentOpen = 0; if ( GridMaxOpen > 0 ) { currentOpen = openPositions(); if (currentOpen >= GridMaxOpen) {CloseAllPendingOrders(); } } if (limitEMA) { if (doHouseKeeping) CloseOrdersfromEMA(myEMA);} if (keepOpenTimeLimit > 0) DeleteAfter(keepOpenTimeLimit); if (trailStop >0) TrailIt(trailStop); if ( UseMACD || UseOsMA) { if ( UseMACD ) { double Trigger0=iMACD(NULL,timeFrame,emaFast,emaSlow,signalPeriod,PRICE_CLOSE,MODE_MAIN,0); //MACD CURRENT double Trigger1=iMACD(NULL,timeFrame,emaFast,emaSlow,signalPeriod,PRICE_CLOSE,MODE_MAIN,1); //MACD PREVIOUS double Trigger2=iMACD(NULL,timeFrame,emaFast,emaSlow,signalPeriod,PRICE_CLOSE,MODE_MAIN,2); //MACD "EXTRA" double Trigger3=iMACD(NULL,timeFrame,emaFast,emaSlow,signalPeriod,PRICE_CLOSE,MODE_SIGNAL,0); //MACD SIGNAL CURRENT double Trigger4=iMACD(NULL,timeFrame,emaFast,emaSlow,signalPeriod,PRICE_CLOSE,MODE_SIGNAL,1); //MACD SIGNAL PREVIOUS } if ( UseOsMA ) { Trigger0=iOsMA(NULL,timeFrame,emaFast,emaSlow,signalPeriod,PRICE_CLOSE,0); Trigger1=iOsMA(NULL,timeFrame,emaFast,emaSlow,signalPeriod,PRICE_CLOSE,1); Trigger2=iOsMA(NULL,timeFrame,emaFast,emaSlow,signalPeriod,PRICE_CLOSE,2); } if( (Trigger0 > 0) && (Trigger1 > 0) && (Trigger2 < 0 ) && (Trigger3 > Trigger0) && (Trigger4 < Trigger0)) // cross up { CloseAllPendingOrders(); if ( CloseOpenPositions == true ) { ClosePendingOrdersAndPositions(); } } if( (Trigger0<0) && (Trigger1<0) && (Trigger2>0) && (Trigger3 < Trigger0) && (Trigger4 > Trigger0)) // cross down { CloseAllPendingOrders(); if ( CloseOpenPositions == true ) { ClosePendingOrdersAndPositions(); } } myWantLongs = false; myWantShorts = false; if( (Trigger0>0) && (Trigger1>0) && (Trigger2>0) && (Trigger3>Trigger0) && (Trigger4<Trigger0) && (wantLongs==true) ) // is well above zero { myWantLongs = true; } if( (Trigger0<0) && (Trigger1<0) && (Trigger2<0) && (Trigger3<Trigger0) && (Trigger4>Trigger0) && (wantShorts== true) ) // is well below zero { myWantShorts = true; } } int myGridSteps = GridSteps; if (( GridMaxOpen > 0 ) && (currentOpen >= GridMaxOpen)) { myGridSteps = 0; } if (suspendGrid == true) { //profit target and exit conditions tested so finished return(0); } Print("Trigs ", Trigger0," ",Trigger1," ",Trigger2," ",Trigger3," ",Trigger4," ",myWantLongs," ",myWantShorts," ",myGridSteps," ema ",myEMA," price ",Bid ); //Print("start 1 ",startrate); for( i=0;i<myGridSteps;i++) { startrate = ( Ask + point*GridSize/2 ) / point / GridSize; // round to a number of ticks divisible by GridSize k = startrate ; k = k * GridSize ; startrate = k * point - GridSize*GridSteps/2*point ; // calculate the lowest entry point traderate = startrate + i*point*GridSize + gridOffset*point; if ( myWantLongs && (!limitEMA || traderate > myEMA)) { if (longGridCenter > point) { temp = GridSteps / 2; k = temp; startrate = longGridCenter - k * GridSize * point; } else { startrate = ( Ask + point*GridSize/2 ) / point / GridSize; // round to a number of ticks divisible by GridSize k = startrate ; k = k * GridSize ; startrate = k * point - GridSize*GridSteps/2*point ; // calculate the lowest entry point } traderate = startrate + i*point*GridSize + gridOffset*point; // now test if traderate within limits doit = true; if (traderate < longGridLow) {doit = false;} if ((traderate > longGridHigh) && (longGridHigh > point)) {doit = false;} if (( IsPosition(traderate,point*GridSize,true) == false ) && (doit == true)) // test if i have no open orders close to my price: if so, put one on { double myStopLoss = 0; if ( StopLoss > 0 ) { myStopLoss = traderate-point*StopLoss ; } if ( traderate > Ask ) { entermode = OP_BUYSTOP; } else { entermode = OP_BUYLIMIT ; } if ( ((traderate > (Ask +minFromPrice*Point) ) && (wantBreakout)) || ((traderate <= (Ask-minFromPrice*Point) ) && (wantCounter)) ) { // modified by cori. Using OrderMagicNumber to identify the trades of the grid ticket=OrderSend(Symbol(),entermode,Lots,traderate,0,myStopLoss,traderate+point*TakeProfit,GridName,uniqueGridMagic,0,Green); } } } if ( myWantShorts && (!limitEMA || traderate < myEMA)) { if (shortGridCenter > point) { temp = GridSteps / 2; k = temp; startrate = shortGridCenter - k * GridSize * point ; } else { startrate = ( Ask + point*GridSize/2 ) / point / GridSize; // round to a number of ticks divisible by GridSize k = startrate ; k = k * GridSize ; startrate = k * point - GridSize*GridSteps/2*point ; // calculate the lowest entry point } traderate = startrate + i*point*GridSize + gridOffset*point; // now test if traderate within limits doit = true; if (traderate < shortGridLow) {doit = false;} if ((traderate > shortGridHigh) && (shortGridHigh > point)) {doit = false;} if ((IsPosition(traderate,point*GridSize,false)== false ) && (doit == true)) // test if i have no open orders close to my price: if so, put one on { myStopLoss = 0; if ( StopLoss > 0 ) { myStopLoss = traderate+point*StopLoss ; } if ( traderate > Bid ) { entermode = OP_SELLLIMIT; } else { entermode = OP_SELLSTOP ; } if ( ((traderate < (Bid -minFromPrice*Point) ) && (wantBreakout)) || ((traderate >= (Bid+minFromPrice*Point) ) && (wantCounter)) ) { // modified by cori. Using OrderMagicNumber to identify the trades of the grid ticket=OrderSend(Symbol(),entermode,Lots,traderate,0,myStopLoss,traderate-point*TakeProfit,GridName,uniqueGridMagic,0,Red); } } } } } return(0); } //+------------------------------------------------------------------+

Free Expert Advisor - 10points 3

Expert Advisor//+------------------------------------------------------------------+ //| 10points 3 ...

Expert Advisor

//+------------------------------------------------------------------+ //| 10points 3.mq4 | //| Copyright © 2005, Alejandro Galindo | //| http://elCactus.com | //+------------------------------------------------------------------+ #property copyright "Copyright © 2005, Alejandro Galindo" #property link "http://elCactus.com" extern double TakeProfit = 40; extern double Lots = 0.1; extern double InitialStop = 0; extern double TrailingStop = 20; extern int MaxTrades=10; extern int Pips=15; extern int SecureProfit=10; extern int AccountProtection=1; extern int OrderstoProtect=3; extern int ReverseCondition=0; extern double EURUSDPipValue=10; extern double GBPUSDPipValue=10; extern double USDCHFPipValue=10; extern double USDJPYPipValue=9.715; extern int StartYear=2005; extern int StartMonth=1; extern int EndYear=2005; extern int EndMonth=12; extern int EndHour=22; extern int EndMinute=30; extern int mm=0; extern int risk=12; extern int AccountisNormal=0; int OpenOrders=0, cnt=0; int slippage=5; double sl=0, tp=0; double BuyPrice=0, SellPrice=0; double lotsi=0, mylotsi=0; int mode=0, myOrderType=0; bool ContinueOpening=True; double LastPrice=0; int PreviousOpenOrders=0; double Profit=0; int LastTicket=0, LastType=0; double LastClosePrice=0, LastLots=0; double Pivot=0; double PipValue=0; string text="", text2=""; //+------------------------------------------------------------------+ //| expert initialization function | //+------------------------------------------------------------------+ int init() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| expert deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| expert start function | //+------------------------------------------------------------------+ int start() { //---- if (AccountisNormal==1) { if (mm!=0) { lotsi=MathCeil(AccountBalance()*risk/10000); } else { lotsi=Lots; } } else { // then is mini if (mm!=0) { lotsi=MathCeil(AccountBalance()*risk/10000)/10; } else { lotsi=Lots; } } if (lotsi>100){ lotsi=100; } OpenOrders=0; for(cnt=0;cnt<OrdersTotal();cnt++) { OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES); if (OrderSymbol()==Symbol()) { OpenOrders++; } } if (OpenOrders<1) { if (TimeYear(CurTime())<StartYear) { return(0); } if (TimeMonth(CurTime())<StartMonth) { return(0); } if (TimeYear(CurTime())>EndYear) { return(0); } if (TimeMonth(CurTime())>EndMonth ) { return(0); } } if (Symbol()=="EURUSD") { PipValue=EURUSDPipValue; } if (Symbol()=="GBPUSD") { PipValue=GBPUSDPipValue; } if (Symbol()=="USDJPY") { PipValue=USDJPYPipValue; } if (Symbol()=="USDCHF") { PipValue=USDCHFPipValue; } if (PipValue==0) { PipValue=5; } if (PreviousOpenOrders>OpenOrders) { for(cnt=OrdersTotal();cnt>=0;cnt--) { OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES); mode=OrderType(); if (OrderSymbol()==Symbol()) { if (mode==OP_BUY) { OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),slippage,Blue); } if (mode==OP_SELL) { OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),slippage,Red); } return(0); } } } PreviousOpenOrders=OpenOrders; if (OpenOrders>=MaxTrades) { ContinueOpening=False; } else { ContinueOpening=True; } if (LastPrice==0) { for(cnt=0;cnt<OrdersTotal();cnt++) { OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES); mode=OrderType(); if (OrderSymbol()==Symbol()) { LastPrice=OrderOpenPrice(); if (mode==OP_BUY) { myOrderType=2; } if (mode==OP_SELL) { myOrderType=1; } } } } if (OpenOrders<1) { myOrderType=3; //if (iMACD(14,26,9,MODE_MAIN,0)>0 and iMACD(14,26,9,MODE_MAIN,0)>iMACD(14,26,9,MODE_MAIN,1)) then OrderType=2; if (iMACD(NULL,0,14,26,9,PRICE_CLOSE,MODE_MAIN,0)>iMACD(NULL,0,14,26,9,PRICE_CLOSE,MODE_MAIN,1)) { myOrderType=2; } //if (iMACD(14,26,9,MODE_MAIN,0)<0 and iMACD(14,26,9,MODE_MAIN,0)<iMACD(14,26,9,MODE_MAIN,1)) then OrderType=1; if (iMACD(NULL,0,14,26,9,PRICE_CLOSE,MODE_MAIN,0)<iMACD(NULL,0,14,26,9,PRICE_CLOSE,MODE_MAIN,1)) { myOrderType=1; } if (ReverseCondition==1) { if (myOrderType==1) { myOrderType=2; } else { if (myOrderType==2) { myOrderType=1; } } } } // if we have opened positions we take care of them for(cnt=OrdersTotal();cnt>=0;cnt--) { OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES); if (OrderSymbol() == Symbol()) { if (OrderType()==OP_SELL) { if (TrailingStop>0) { if (OrderOpenPrice()-Ask>=(TrailingStop+Pips)*Point) { if (OrderStopLoss()>(Ask+Point*TrailingStop)) { OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*TrailingStop,OrderClosePrice()-TakeProfit*Point-TrailingStop*Point,800,Purple); return(0); } } } } if (OrderType()==OP_BUY) { if (TrailingStop>0) { if (Bid-OrderOpenPrice()>=(TrailingStop+Pips)*Point) { if (OrderStopLoss()<(Bid-Point*TrailingStop)) { OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TrailingStop,OrderClosePrice()+TakeProfit*Point()+TrailingStop*Point(),800,Yellow); return(0); } } } } } } Profit=0; LastTicket=0; LastType=0; LastClosePrice=0; LastLots=0; for(cnt=0;cnt<OrdersTotal();cnt++) { OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES); if (OrderSymbol()==Symbol()) { LastTicket=OrderTicket(); if (OrderType()==OP_BUY) { LastType=OP_BUY; } if (OrderType()==OP_SELL) { LastType=OP_SELL; } LastClosePrice=OrderClosePrice(); LastLots=OrderLots(); if (LastType==OP_BUY) { //Profit=Profit+(Ord(cnt,VAL_CLOSEPRICE)-Ord(cnt,VAL_OPENPRICE))*PipValue*Ord(cnt,VAL_LOTS); if (OrderClosePrice()<OrderOpenPrice()) { Profit=Profit-(OrderOpenPrice()-OrderClosePrice())*OrderLots()/Point; } if (OrderClosePrice()>OrderOpenPrice()) { Profit=Profit+(OrderClosePrice()-OrderOpenPrice())*OrderLots()/Point; } } if (LastType==OP_SELL) { //Profit=Profit+(Ord(cnt,VAL_OPENPRICE)-Ord(cnt,VAL_CLOSEPRICE))*PipValue*Ord(cnt,VAL_LOTS); if (OrderClosePrice()>OrderOpenPrice()) { Profit=Profit-(OrderClosePrice()-OrderOpenPrice())*OrderLots()/Point; } if (OrderClosePrice()<OrderOpenPrice()) { Profit=Profit+(OrderOpenPrice()-OrderClosePrice())*OrderLots()/Point; } } //Print(Symbol,":",Profit,",",LastLots); } } Profit=Profit*PipValue; text2="Profit: $"+DoubleToStr(Profit,2)+" +/-"; if (OpenOrders>=(MaxTrades-OrderstoProtect) && AccountProtection==1) { //Print(Symbol,":",Profit); if (Profit>=SecureProfit) { OrderClose(LastTicket,LastLots,LastClosePrice,slippage,Yellow); ContinueOpening=False; return(0); } } if (!IsTesting()) { if (myOrderType==3) { text="No conditions to open trades"; } else { text=" "; } Comment("LastPrice=",LastPrice," Previous open orders=",PreviousOpenOrders,"\nContinue opening=",ContinueOpening," OrderType=",myOrderType,"\n",text2,"\nLots=",lotsi,"\n",text); } if (myOrderType==1 && ContinueOpening) { if ((Bid-LastPrice)>=Pips*Point || OpenOrders<1) { SellPrice=Bid; LastPrice=0; if (TakeProfit==0) { tp=0; } else { tp=SellPrice-TakeProfit*Point; } if (InitialStop==0) { sl=0; } else { sl=SellPrice+InitialStop*Point; } if (OpenOrders!=0) { mylotsi=lotsi; for(cnt=1;cnt<=OpenOrders;cnt++) { if (MaxTrades>12) { mylotsi=NormalizeDouble(mylotsi*1.5,1); } else { mylotsi=NormalizeDouble(mylotsi*2,1); } } } else { mylotsi=lotsi; } if (mylotsi>100) { mylotsi=100; } OrderSend(Symbol(),OP_SELL,mylotsi,SellPrice,slippage,sl,tp,NULL,0,0,Red); return(0); } } if (myOrderType==2 && ContinueOpening) { if ((LastPrice-Ask)>=Pips*Point || OpenOrders<1) { BuyPrice=Ask; LastPrice=0; if (TakeProfit==0) { tp=0; } else { tp=BuyPrice+TakeProfit*Point; } if (InitialStop==0) { sl=0; } else { sl=BuyPrice-InitialStop*Point; } if (OpenOrders!=0) { mylotsi=lotsi; for(cnt=1;cnt<=OpenOrders;cnt++) { if (MaxTrades>12) { mylotsi=NormalizeDouble(mylotsi*1.5,1); } else { mylotsi=NormalizeDouble(mylotsi*2,1); } } } else { mylotsi=lotsi; } if (mylotsi>100) { mylotsi=100; } OrderSend(Symbol(),OP_BUY,mylotsi,BuyPrice,slippage,sl,tp,NULL,0,0,Blue); return(0); } } //---- return(0); } //+------------------------------------------------------------------+

Free Expert Advisor - Ema Cross

Expert Advisor//+------------------------------------------------------------------+ //| EMA_CROSS ...

Expert Advisor

//+------------------------------------------------------------------+ //| EMA_CROSS.mq4 | //| Coders Guru | //| http://www.forex-tsd.com | //+------------------------------------------------------------------+ #property copyright "Coders Guru" #property link "http://www.forex-tsd.com" //---- input parameters extern double TakeProfit=100; extern double Lots=1; extern double TrailingStop=35; extern int ShortEma = 10; extern int LongEma = 80; //+------------------------------------------------------------------+ //| expert initialization function | //+------------------------------------------------------------------+ int init() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| expert deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } int Crossed (double line1 , double line2) { static int last_direction = 0; static int current_direction = 0; if(line1>line2)current_direction = 1; //up if(line1<line2)current_direction = 2; //down if(current_direction != last_direction) //changed { last_direction = current_direction; return (last_direction); } else { return (0); } } //+------------------------------------------------------------------+ //| expert start function | //+------------------------------------------------------------------+ int start() { //---- //LotCalc(1); int cnt, ticket, total; double SEma, LEma; if(Bars<100) { Print("bars less than 100"); return(0); } if(TakeProfit<10) { Print("TakeProfit less than 10"); return(0); // check TakeProfit } SEma = iMA(NULL,0,ShortEma,0,MODE_EMA,PRICE_CLOSE,0); LEma = iMA(NULL,0,LongEma,0,MODE_EMA,PRICE_CLOSE,0); int isCrossed = 0; isCrossed = Crossed (LEma,SEma); total = OrdersTotal(); if(total < 1) { if(isCrossed == 1) { ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,0,Ask+TakeProfit*Point,"My EA",12345,0,Green); if(ticket>0) { if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("BUY order opened : ",OrderOpenPrice()); } else Print("Error opening BUY order : ",GetLastError()); return(0); } if(isCrossed == 2) { ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,0,Bid-TakeProfit*Point,"My EA",12345,0,Red); if(ticket>0) { if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("SELL order opened : ",OrderOpenPrice()); } else Print("Error opening SELL order : ",GetLastError()); return(0); } return(0); } for(cnt=0;cnt<total;cnt++) { OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES); OrderPrint(); if(OrderType()<=OP_SELL && OrderSymbol()==Symbol()) { if(OrderType()==OP_BUY) // long position is opened { // should it be closed? if(isCrossed == 2) { OrderClose(OrderTicket(),OrderLots(),Bid,3,Violet); // close position return(0); // exit } // check for trailing stop if(TrailingStop>0) { if(Bid-OrderOpenPrice()>Point*TrailingStop) { if(OrderStopLoss()<Bid-Point*TrailingStop) { OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TrailingStop,OrderTakeProfit(),0,Green); return(0); } } } } else // go to short position { // should it be closed? if(isCrossed == 1) { OrderClose(OrderTicket(),OrderLots(),Ask,3,Violet); // close position return(0); // exit } // check for trailing stop if(TrailingStop>0) { if((OrderOpenPrice()-Ask)>(Point*TrailingStop)) { if((OrderStopLoss()>(Ask+Point*TrailingStop)) || (OrderStopLoss()==0)) { OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*TrailingStop,OrderTakeProfit(),0,Red); return(0); } } } } } } return(0); } //+------------------------------------------------------------------+

Free Expert Advisor - eVolatility-Expansion

Expert Advisor//+------------------------------------------------------------------+ //| eVolatility-Expansion ...

Expert Advisor

//+------------------------------------------------------------------+ //| eVolatility-Expansion.mq4 | //| v0.1 27.01.2006 | //+------------------------------------------------------------------+ #property copyright "Alex.Piech.FinGeR" #property link "" #define MAGIC 203210243676574 extern string Parameters_1 = ""; extern double Lots = 0.1; extern int TakeProfit = 100; extern string TimeSetOrders = "00:01"; extern string TimeDelOrders = "23:59"; extern string Parameters_2 = "% of yesterdays range"; extern int DistanceEntry = 70; extern int DistanceStop = 50; extern string Parameters_3 = ""; extern bool UseTrailing = true; extern bool ProfitTrailing = true; extern int TrailingStop = 25; extern int TrailingStep = 5; extern int Slippage = 3; extern string _Parameters_Expert = ""; extern bool UseOneAccount = False; extern int NumberAccount = 11111; extern string Name_Expert = "eVolatility-Expansion"; extern bool UseSound = True; extern string NameFileSound = "expert.wav"; extern color clOpenBuy = LightBlue; extern color clOpenSell = LightCoral; extern color clModifyBuy = Aqua; extern color clModifySell = Tomato; extern color clCloseBuy = Blue; extern color clCloseSell = Red; int prevBar; //+------------------------------------------------------------------+ //| expert deinitialization function | //+------------------------------------------------------------------+ void deinit() { Comment(""); } //+------------------------------------------------------------------+ //| expert start function | //+------------------------------------------------------------------+ void start() { if (TimeToStr(CurTime(), TIME_MINUTES)==TimeSetOrders) SetOrders(); DeleteOppositeOrders(); if (UseTrailing) TrailingPositions(); if (TimeToStr(CurTime(), TIME_MINUTES)==TimeDelOrders) { DeleteAllOrders(); } prevBar=Bars; } void SetOrders() { double ldStop=0, ldTake=0; double a=iHigh(NULL,1440,1)-iLow(NULL,1440,1); double c=a/Point; double St=MathRound((c/100)*DistanceStop); double bs=MathRound((c/100)*DistanceEntry); int spr=MarketInfo(Symbol(), MODE_SPREAD); double pAsk=Ask+(bs+spr)*Point; double pBid=Bid-bs*Point; if (!ExistOrder(1)) { if (DistanceStop!=0) ldStop=pAsk-St*Point; if (TakeProfit!=0) ldTake=pAsk+TakeProfit*Point; SetOrder(OP_BUYSTOP, pAsk, ldStop, ldTake, 1); } if (!ExistOrder(2)) { if (DistanceStop!=0) ldStop=pBid+St*Point; if (TakeProfit!=0) ldTake=pBid-TakeProfit*Point; SetOrder(OP_SELLSTOP, pBid, ldStop, ldTake, 2); } } bool ExistOrder(int mn) { bool Exist=False; for (int i=0; i<OrdersTotal(); i++) { if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { if (OrderSymbol()==Symbol() && OrderMagicNumber()==MAGIC+mn) { Exist=True; break; } } } return(Exist); } bool ExistPosition(int mn) { bool Exist=False; for (int i=0; i<OrdersTotal(); i++) { if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { if (OrderSymbol()==Symbol() && OrderMagicNumber()==MAGIC+mn) { if (OrderType()==OP_BUY || OrderType()==OP_SELL) { Exist=True; break; } } } } return(Exist); } void SetOrder(int op, double pp, double ldStop, double ldTake, int mn) { color clOpen; string lsComm=GetCommentForOrder(); if (op==OP_BUYSTOP) clOpen=clOpenBuy; else clOpen=clOpenSell; OrderSend(Symbol(),op,Lots,pp,Slippage,ldStop,ldTake,lsComm,MAGIC+mn,0,clOpen); if (UseSound) PlaySound(NameFileSound); } string GetCommentForOrder() { return(Name_Expert); } void DeleteAllOrders() { bool fd; for (int i=OrdersTotal()-1; i>=0; i--) { if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { if (OrderMagicNumber()>MAGIC && OrderMagicNumber()<=MAGIC+2) { if (OrderSymbol()==Symbol()) { if (OrderType()==OP_BUYSTOP || OrderType()==OP_SELLSTOP) { fd=OrderDelete(OrderTicket()); if (fd && UseSound) PlaySound(NameFileSound); } } } } } } void DeleteOppositeOrders() { bool fd, fep1, fep2; fep1=ExistPosition(1); fep2=ExistPosition(2); for (int i=OrdersTotal()-1; i>=0; i--) { if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { if (OrderSymbol()==Symbol()) { fd=False; if (OrderType()==OP_BUYSTOP && OrderMagicNumber()==MAGIC+1) { if (fep2) fd=OrderDelete(OrderTicket()); } if (OrderType()==OP_SELLSTOP && OrderMagicNumber()==MAGIC+2) { if (fep1) fd=OrderDelete(OrderTicket()); } if (fd && UseSound) PlaySound(NameFileSound); } } } } void TrailingPositions() { for (int i=0; i<OrdersTotal(); i++) { if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { if (OrderMagicNumber()>MAGIC && OrderMagicNumber()<=MAGIC+2) { if (OrderSymbol()==Symbol()) { if (OrderType()==OP_BUY) { if (!ProfitTrailing || (Bid-OrderOpenPrice())>TrailingStop*Point) { if (OrderStopLoss()<Bid-(TrailingStop+TrailingStep-1)*Point) { ModifyStopLoss(Bid-TrailingStop*Point, clModifyBuy); } } } if (OrderType()==OP_SELL) { if (!ProfitTrailing || OrderOpenPrice()-Ask>TrailingStop*Point) { if (OrderStopLoss()>Ask+(TrailingStop+TrailingStep-1)*Point || OrderStopLoss()==0) { ModifyStopLoss(Ask+TrailingStop*Point, clModifySell); } } } } } } } } void ModifyStopLoss(double ldStop, color clModify) { bool fm; double ldOpen=OrderOpenPrice(); double ldTake=OrderTakeProfit(); fm=OrderModify(OrderTicket(), ldOpen, ldStop, ldTake, 0, clModify); if (fm && UseSound) PlaySound(NameFileSound); } // regards // Alex.Piech.FinGeR // big thanks KimIV

Free Expert Advisor - Fibo Pivot and RSI

Expert Advisor//+------------------------------------------------------------------+ //| FiboPivotandRSI ...

Expert Advisor

//+------------------------------------------------------------------+ //| FiboPivotandRSI.mq4 | //| Copyright © 2005 H.Bartz | //| Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo. | //+------------------------------------------------------------------+ #property copyright "Copyright © 2005 H.Bartz" #property link "Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo." extern double StopLoss = 20; extern double TakeProfit = 21; extern double TrailingStop = 20; extern double Lots = 0.10; extern double ProfitShield = 7; extern int TimeZone=0; extern color clOpenBuy = Blue; extern color clCloseBuy = Aqua; extern color clOpenSell = Red; extern color clCloseSell = Violet; extern color clModiBuy = Blue; extern color clModiSell = Red; extern string Name_Expert = "FiboPivotandRSI"; extern int Slippage = 4; extern bool UseSound = False; extern string NameFileSound = "alert.wav"; int prevCountBars; double diRSI0, diRSI6, d1, d7 ; double R1=0, R2=0, R3=0, F24=0, F38=0, F62=0, F76=0, S1=0, S2=0, S3=0,DH=0,DL=0; double day_high=0, day_low=0, yesterday_high=0, yesterday_open=0, yesterday_low=0, yesterday_close=0, today_open=0, today_high=0, today_low=0, P=0, Q=0, nQ=0, nD=0, D=0, rates_h1[2][6], rates_d1[2][6],Bound[13]; double Buy_TP=0, Sell_TP=0, Sup=0, Res=0, ticket, SL,Tradingpoint; int cnt,dif1,dif2,HL; //+------------------------------------------------------------------+ //| expert initialization function | //+------------------------------------------------------------------+ int init() { return(0); } //+------------------------------------------------------------------+ //| expert deinitialization function | //+------------------------------------------------------------------+ int deinit() { return(0); } //+------------------------------------------------------------------+ //| expert start function | //+------------------------------------------------------------------+ /// Initial Data Checks int start() { if(Bars<150) { Print("bars less than 100"); return(0); } // Delete Old Pivot Lines to Draw the New Lines ObjectDelete("R1 Label"); ObjectDelete("R1 Line"); ObjectDelete("R2 Label"); ObjectDelete("R2 Line"); ObjectDelete("R3 Label"); ObjectDelete("R3 Line"); ObjectDelete("S1 Label"); ObjectDelete("S1 Line"); ObjectDelete("S2 Label"); ObjectDelete("S2 Line"); ObjectDelete("S3 Label"); ObjectDelete("S3 Line"); ObjectDelete("P Label"); ObjectDelete("P Line"); ObjectDelete("F24 Label"); ObjectDelete("F24 Line"); ObjectDelete("F38 Label"); ObjectDelete("F38 Line"); ObjectDelete("F62 Label"); ObjectDelete("F62 Line"); ObjectDelete("F76 Label"); ObjectDelete("F76 Line"); ObjectDelete("DH Label"); ObjectDelete("DH Line"); ObjectDelete("DL Label"); ObjectDelete("DL Line"); /// PIVOT POINT CALCULATIONS int i=0, j=0; if(Period() > 1440) { Comment("Error - Chart period is greater than 1 day."); return(-1); } ArrayCopyRates(rates_d1, Symbol(), PERIOD_D1); yesterday_high = rates_d1[1][3]; yesterday_low = rates_d1[1][2]; day_high = rates_d1[0][3]; day_low = rates_d1[0][2]; ArrayCopyRates(rates_h1, Symbol(), PERIOD_H1); for (i=0;i<=25;i++) { if (TimeMinute(rates_h1[i][0])==0 && (TimeHour(rates_h1[i][0])-TimeZone)==0) { yesterday_close = rates_h1[i+1][4]; yesterday_open = rates_h1[i+24][1]; today_open = rates_h1[i][1]; break; } } // Calculate Pivots D = (day_high - day_low); Q = (yesterday_high - yesterday_low); P = (yesterday_high + yesterday_low + yesterday_close) / 3; R1 = (2*P)-yesterday_low; S1 = (2*P)-yesterday_high; R2 = P+(yesterday_high - yesterday_low); S2 = P-(yesterday_high - yesterday_low); R3 = (2*P)+(yesterday_high-(2*yesterday_low)); S3 = (2*P)-((2* yesterday_high)-yesterday_low); F24 = day_low-((day_low-day_high)*0.24); F38 = day_low-((day_low-day_high)*0.38); F62 = day_low-((day_low-day_high)*0.62); F76 = day_low-((day_low-day_high)*0.76); DH = yesterday_high; DL = yesterday_low; // Pivot Lines Labeling if(ObjectFind("R1 label") != 0) { ObjectCreate("R1 label", OBJ_TEXT, 0, Time[20], R1); ObjectSetText("R1 label", " R1", 8, "Arial", Yellow); } else { ObjectMove("R1 label", 0, Time[20], R1); } if(ObjectFind("R2 label") != 0) { ObjectCreate("R2 label", OBJ_TEXT, 0, Time[20], R2); ObjectSetText("R2 label", " R2", 8, "Arial", Orange); } else { ObjectMove("R2 label", 0, Time[20], R2); } if(ObjectFind("R3 label") != 0) { ObjectCreate("R3 label", OBJ_TEXT, 0, Time[20], R3); ObjectSetText("R3 label", " R3", 8, "Arial", Red); } else { ObjectMove("R3 label", 0, Time[20], R3); } if(ObjectFind("P label") != 0) { ObjectCreate("P label", OBJ_TEXT, 0, Time[20], P); ObjectSetText("P label", "Pivot", 8, "Arial", DeepPink); } else { ObjectMove("P label", 0, Time[20], P); } if(ObjectFind("S1 label") != 0) { ObjectCreate("S1 label", OBJ_TEXT, 0, Time[20], S1); ObjectSetText("S1 label", "S1", 8, "Arial", Yellow); } else { ObjectMove("S1 label", 0, Time[20], S1); } if(ObjectFind("S2 label") != 0) { ObjectCreate("S2 label", OBJ_TEXT, 0, Time[20], S2); ObjectSetText("S2 label", "S2", 8, "Arial", Orange); } else { ObjectMove("S2 label", 0, Time[20], S2); } if(ObjectFind("S3 label") != 0) { ObjectCreate("S3 label", OBJ_TEXT, 0, Time[20], S3); ObjectSetText("S3 label", "S3", 8, "Arial", Red); } else { ObjectMove("S3 label", 0, Time[20], S3); } // Drawing Pivot lines if(ObjectFind("S1 line") != 0) { ObjectCreate("S1 line", OBJ_HLINE, 0, Time[40], S1); ObjectSet("S1 line", OBJPROP_STYLE, STYLE_SOLID); ObjectSet("S1 line", OBJPROP_COLOR, Yellow); } else { ObjectMove("S1 line", 0, Time[40], S1); } if(ObjectFind("S2 line") != 0) { ObjectCreate("S2 line", OBJ_HLINE, 0, Time[40], S2); ObjectSet("S2 line", OBJPROP_STYLE, STYLE_SOLID); ObjectSet("S2 line", OBJPROP_COLOR, Orange); } else { ObjectMove("S2 line", 0, Time[40], S2); } if(ObjectFind("S3 line") != 0) { ObjectCreate("S3 line", OBJ_HLINE, 0, Time[40], S3); ObjectSet("S3 line", OBJPROP_STYLE, STYLE_SOLID); ObjectSet("S3 line", OBJPROP_COLOR, Red); } else { ObjectMove("S3 line", 0, Time[40], S3); } if(ObjectFind("P line") != 0) { ObjectCreate("P line", OBJ_HLINE, 0, Time[40], P); ObjectSet("P line", OBJPROP_STYLE, STYLE_SOLID); ObjectSet("P line", OBJPROP_COLOR, DeepPink); } else { ObjectMove("P line", 0, Time[40], P); } if(ObjectFind("R1 line") != 0) { ObjectCreate("R1 line", OBJ_HLINE, 0, Time[40], R1); ObjectSet("R1 line", OBJPROP_STYLE, STYLE_SOLID); ObjectSet("R1 line", OBJPROP_COLOR, Yellow); } else { ObjectMove("R1 line", 0, Time[40], R1); } if(ObjectFind("R2 line") != 0) { ObjectCreate("R2 line", OBJ_HLINE, 0, Time[40], R2); ObjectSet("R2 line", OBJPROP_STYLE, STYLE_SOLID); ObjectSet("R2 line", OBJPROP_COLOR, Orange); } else { ObjectMove("R2 line", 0, Time[40], R2); } if(ObjectFind("R3 line") != 0) { ObjectCreate("R3 line", OBJ_HLINE, 0, Time[40], R3); ObjectSet("R3 line", OBJPROP_STYLE, STYLE_SOLID); ObjectSet("R3 line", OBJPROP_COLOR, Red); } else { ObjectMove("R3 line", 0, Time[40], R3); } // Fibonacci Labeling if(ObjectFind("F24 line") != 0) { ObjectCreate("F24 line", OBJ_HLINE, 0, Time[40], F24); ObjectSet("F24 line", OBJPROP_STYLE, STYLE_DOT); ObjectSet("F24 line", OBJPROP_COLOR, White); } else { ObjectMove("F24 line", 0, Time[40], F24); } if(ObjectFind("F38 line") != 0) { ObjectCreate("F38 line", OBJ_HLINE, 0, Time[40], F38); ObjectSet("F38 line", OBJPROP_STYLE, STYLE_DOT); ObjectSet("F38 line", OBJPROP_COLOR, White); } else { ObjectMove("F38 line", 0, Time[40], F38); } if(ObjectFind("F62 line") != 0) { ObjectCreate("F62 line", OBJ_HLINE, 0, Time[40], F62); ObjectSet("F62 line", OBJPROP_STYLE, STYLE_DOT); ObjectSet("F62 line", OBJPROP_COLOR, White); } else { ObjectMove("F62 line", 0, Time[40], F62); } if(ObjectFind("F76 line") != 0) { ObjectCreate("F76 line", OBJ_HLINE, 0, Time[40], F76); ObjectSet("F76 line", OBJPROP_STYLE, STYLE_DOT); ObjectSet("F76 line", OBJPROP_COLOR, White); } else { ObjectMove("F76 line", 0, Time[40], F76); } //yesterday high and low if(ObjectFind("DH line") != 0) { ObjectCreate("DH line", OBJ_HLINE, 0, Time[40], DH); ObjectSet("DH line", OBJPROP_STYLE, STYLE_DOT); ObjectSet("DH line", OBJPROP_COLOR, White); } else { ObjectMove("DH line", 0, Time[40], DH); } if(ObjectFind("DL line") != 0) { ObjectCreate("DL line", OBJ_HLINE, 0, Time[40], DL); ObjectSet("DL line", OBJPROP_STYLE, STYLE_DOT); ObjectSet("DL line", OBJPROP_COLOR, White); } else { ObjectMove("DL line", 0, Time[40], DL); } // Indicator Calculations double diRSI0 = iRSI(NULL,15,9,PRICE_CLOSE,0); double d1 = (30); double diRSI6 = iRSI(NULL,15,9,PRICE_CLOSE,0); double d7 = (70); //Entrypoint long Tradingpoint=Ask==P; Tradingpoint=Ask==R1; Tradingpoint=Ask==R2; Tradingpoint=Ask==R3; Tradingpoint=Ask==S1; Tradingpoint=Ask==S2; Tradingpoint=Ask==S3; Tradingpoint=Ask==F24; Tradingpoint=Ask==F38; Tradingpoint=Ask==F62; Tradingpoint=Ask==F76; Tradingpoint=Ask==DH; Tradingpoint=Ask==DL; //entrypoint short Tradingpoint=Bid==P; Tradingpoint=Bid==R1; Tradingpoint=Bid==R2; Tradingpoint=Bid==R3; Tradingpoint=Bid==S1; Tradingpoint=Bid==S2; Tradingpoint=Bid==S3; Tradingpoint=Bid==F24; Tradingpoint=Bid==F38; Tradingpoint=Bid==F62; Tradingpoint=Bid==F76; Tradingpoint=Bid==DH; Tradingpoint=Bid==DL; // Checking Account Free Margin int total=OrdersTotal(); if(total<1) { if(AccountFreeMargin()<(1000*Lots)) { Print("We have no money. Free Margin = ", AccountFreeMargin()); } // Check for long positions (if you have money and no more than 1 order open) if(diRSI0<d1&& Tradingpoint) { SL = Ask - StopLoss * Point; ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,SL,Buy_TP,"MoStAsHaR15 FoReX",16384,0,White); if(ticket>0) { if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Comment("BUY order opened : ",OrderOpenPrice()); } else Comment("Error opening BUY order : ",GetLastError()); return(0); } // Check for short positions (if you have money and no more than 2 orders open) if(diRSI6>d7 && Tradingpoint ) { SL = Bid + StopLoss * Point; ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,SL,Sell_TP,"MoStAsHaR15 FoReX",16384,0,White); if(ticket>0) { if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Comment("SELL order opened : ",OrderOpenPrice()); } else Comment ("Error opening SELL order : ",GetLastError()); return(0); } return(0); } // Open Trades Management for(cnt=0;cnt<total;cnt++) { OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES); if(OrderType()<=OP_SELL && OrderSymbol()==Symbol()) { if(OrderType()==OP_BUY) // long position is opened { // Profit Shield (LONG) if((OrderOpenPrice()-Bid)/Point > ProfitShield) { SL = OrderOpenPrice(); OrderModify(OrderTicket(),OrderOpenPrice(),SL,OrderTakeProfit(),0,Green); } // Trailing Stop Managment if(TrailingStop>0) { if(Bid-OrderOpenPrice()>Point*TrailingStop) { if(OrderStopLoss()<Bid-Point*TrailingStop) { OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TrailingStop,OrderTakeProfit(),0,Green); return(0); } } } } else // go to short position // Profit Shield (SHORT) if((OrderOpenPrice()-Ask)/Point > ProfitShield) { SL = OrderOpenPrice(); OrderModify(OrderTicket(),OrderOpenPrice(),SL,OrderTakeProfit(),0,Green); } if(TrailingStop>0) { if((OrderOpenPrice()-Ask)>(Point*TrailingStop)) { if((OrderStopLoss()>(Ask+Point*TrailingStop)) || (OrderStopLoss()==0)) { OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*TrailingStop,OrderTakeProfit(),0,Red); return(0); } } } } return(0); } }

Free Expert Advisor - Price Channel

Expert Advisor Free //+------------------------------------------------------------------+ //| Price ...

Expert Advisor Free


//+------------------------------------------------------------------+ //| Price Channel.mq4 | //| Copyright © 2004, Poul_Trade_Forum | //| Aborigen | //| http://forex.kbpauk.ru/ | //+------------------------------------------------------------------+ #property link "http://forex.kbpauk.ru/" #property indicator_chart_window #property indicator_buffers 3 #property indicator_color1 DodgerBlue #property indicator_color2 DodgerBlue #property indicator_color3 DodgerBlue //---- input parameters extern int ChannelPeriod=14; extern int Shift=0; //---- buffers double UpBuffer[]; double DnBuffer[]; double MdBuffer[]; double Up[],Dn[],Md[]; ArraySetAsSeries(Up,true); ArraySetAsSeries(Dn,true); ArraySetAsSeries(Md,true); //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { string short_name; //---- indicator line SetIndexStyle(0,DRAW_LINE); SetIndexStyle(1,DRAW_LINE); SetIndexStyle(2,DRAW_LINE,2); SetIndexBuffer(0,UpBuffer); SetIndexBuffer(1,DnBuffer); SetIndexBuffer(2,MdBuffer); //---- name for DataWindow and indicator subwindow label short_name="Price Channel("+ChannelPeriod+")"; IndicatorShortName(short_name); SetIndexLabel(0,"Up Channel"); SetIndexLabel(1,"Down Channel"); SetIndexLabel(2,"Middle Channel"); //---- SetIndexDrawBegin(0,ChannelPeriod+Shift); SetIndexDrawBegin(1,ChannelPeriod+Shift); SetIndexDrawBegin(2,ChannelPeriod+Shift); SetIndexEmptyValue(0,0); SetIndexEmptyValue(1,0); SetIndexEmptyValue(2,0); //---- return(0); } //+------------------------------------------------------------------+ //| Price Channel | //+------------------------------------------------------------------+ int start() { int i,counted_bars=IndicatorCounted(); int k; double high,low,price; //---- if(Bars<=ChannelPeriod) return(0); //---- initial zero if(counted_bars<1) for(i=1;i<=ChannelPeriod;i++) UpBuffer[Bars-i]=0.0; ArrayResize(Up, Bars); ArrayResize(Dn, Bars); ArrayResize(Md, Bars); //---- i=Bars-ChannelPeriod-1; if(counted_bars>=ChannelPeriod) i=Bars-counted_bars; while(i>=0) { high=High[i]; low=Low[i]; k=i-1+ChannelPeriod; while(k>=i) { price=High[k]; if(high<price) high=price; price=Low[k]; if(low>price) low=price; k--; } Up[i]=high; Dn[i]=low; Md[i]=(high+low)/2; UpBuffer[i]=Up[i+Shift]; DnBuffer[i]=Dn[i+Shift]; MdBuffer[i]=Md[i+Shift]; i--; } return(0); } //+------------------------------------------------------------------+
Expert Advisor
/* +------------------------------------+ | TRUE_SCALPER | +------------------------------------+ Theory of operation Based on MA3 of Bar[1] being higher or lower than MA7 of Bar[1] AND RSI2 of Bar[2] transitioning to RSI of Bar[1] ProfitMade and StopLosses are optimized per pair TIME FRAME ========== Place on 5 minute chart PAIRS ===== As optimized. It will NOT work well on every pair ENTRY LONG ========== MA3(Bar[1]) is greater than MA7(Bar[1]) by at least 1 pip RSI(2-period Bar[2]) less than RSI_Neg and RSI Bar[1] greater than RSI_Pos2 ENTRY SHORT =========== MA3(Bar[1]) is less than than MA7(Bar[1]) by at least 1 pip RSI(2-period Bar[2]) greater than RSI_Pos and RSI Bar[1] less than RSI_Neg2 EXIT ==== ProfitMade or TP/SL if internet fails or computer crashed MONEY MANAGEMENT ================ -none- RISK MANAGEMENT =============== -none- FAILURE MANAGEMENT ================== Fairly complete, as most failures will be resolved on the next tick. Comments written to log VERSION HISTORY =============== v2a - This is the one used successfully by Jean-François (if you call TP of 9 and SL of 175 a 'success') Ron converted from MT3 to MT4 and released into the wild. Designed for M5 but I attached it to M15 and it worked fine. long if EMA3>EMA7:::EMA3<EMA7<0 Code Adapted from Scalper EAs to use EMA and RSI and multiple currencies v4 - Fixed a couple of ELSE statements that should NOT have been there Spent a LOT of time debugging the backtester v11- added sell-&-hedge added abandon-after-#-of-ticks added init() section to load optimized symbol info Spent a lot of time gathering comments and testing various stratigies v37(11)- - reverted to v2a - upgraded to include improved theory of operation - changed bull & bear to slow & fast - added debug Print() for good/bad transactions - added debug File() for tracking bars-per-trade v38(11)- - tried and rejected - close on next cross - tried and only marginal - move SL to BE at some profit level - tried TradeAllowed holdoff till next cross (misses LOTS of profit) - found that gbpusd likes RSINEG and RSIPOS at differing levels (EUREKA!) - profit levels MUST be - % of volitility and stop loss at volitility + % (double EUREKA!) v39(11)- - tried seedling code and reverted to 38 v40(11)- - trying 2 or 3 orders open at once (linear gain, like trading 0.1 vs 1.0) - added magic number - modified multiple-order-open to work with TradeAllowed - finally understand that the retracement needs to be optimized, not the profit v40-43 - - tried several other indicators to escape the bad trades, reverted to v11 to clear the confusion so it's now v11+proper ProfitMade setting and proprt RSI optimization for the profit level v44(11)- - back to v11 with profitmade at 1/4 volitility and optimized StopLoss and RSI - removed commented old "abandon" code - removed ordernum code - tried and discarded 2nd MA and 2nd RSI from multiple periods v45 - - fixed chart time at 15Min, so accidental timeframe won't mess up again - added RSI transition code that wasn't in the old MQL script, looks promising v46 - - added TradeAllowed back in, only trade once right after MA cross and all RSI are at 50 v47 - - moved TradeAllowed to bartick, so ANY valid trade is taken regardless of number open v48 - - Added some switches to the externs so people can test in various states of variables when released into the wild - Added multi-orders so we can hedge some, and do some discretionary trading - Optimized GBPUSD for multiple trades v49 - - Removed to hihi and lolo tracking code v49c - - Released to group */ // variables declared here are GLOBAL in scope #property copyright "Ron Thompson & Jacob Yego" #property link "http://www.lightpatch.com/forex/TrueScalper49+" // user input extern double Lots=0.5; extern int Slippage=2; extern int NumberOfOrders=9; extern bool UseOpts=true; // these two lines are over-ridden my UseOpts extern int ProfitMade=90; // how much money do you want ( see init() section ) extern int StopLoss=102; // optimized per pair (see init() section) // More testing entries int RSI_Pos =50; int RSI_Neg =50; int RSI_Pos2=50; int RSI_Neg2=50; // only used in case computer or internet fails int TakeProfit=100; // naming and numbering int MagicNumber = 200510301113; string TradeComment = "TrueScalper_49_"; // Bar handling datetime bartime=0; int bartick=0; // one trade per cross control bool TradeAllowed=false; //+-------------+ //| Custom init | //|-------------+ // Called ONCE when EA is added to chart or recompiled int init() { Print ("Init happened ",CurTime()); // 20 day volitility, // VERY close when doing 1-month optimizations // //AUDUSD- 66 //EURAUD-106 //EURCHF- 43 //EURGBP- 35 //EURJPY- 92 //EURUSD-105 //GBPCHF- ? //GBPJPY-129 //GBPUSD-141 //USDCAD-104 //USDCHF-119 //USDJPY- 92 // one month optimizations to MT data feed if(UseOpts) { //if (Symbol()=="AUDCAD") {ProfitMade= 35; StopLoss=100;} //if (Symbol()=="AUDJPY") {ProfitMade= 35; StopLoss=100;} //if (Symbol()=="AUDNZD") {ProfitMade= 35; StopLoss=100;} //if (Symbol()=="AUDUSD") {ProfitMade= 35; StopLoss=100;} //if (Symbol()=="CHFJPY") {ProfitMade= 35; StopLoss=100;} //if (Symbol()=="EURAUD") {ProfitMade= 35; StopLoss=100;} //if (Symbol()=="EURCAD") {ProfitMade= 35; StopLoss=100;} //if (Symbol()=="EURCHF") {ProfitMade= 35; StopLoss=100;} //if (Symbol()=="EURGBP") {ProfitMade= 35; StopLoss=100;} //if (Symbol()=="EURJPY") {ProfitMade= 35; StopLoss=100;} //if (Symbol()=="EURUSD") {ProfitMade= 35; StopLoss=100;} //if (Symbol()=="GBPCHF") {ProfitMade= 35; StopLoss=100;} //if (Symbol()=="GBPJPY") {ProfitMade= 35; StopLoss=100;} if (Symbol()=="GBPUSD") {ProfitMade= 90; StopLoss=102;} //if (Symbol()=="NZDJPY") {ProfitMade= 35; StopLoss=100;} //if (Symbol()=="NZDUSD") {ProfitMade= 35; StopLoss=100;} //if (Symbol()=="USDCAD") {ProfitMade= 35; StopLoss=100;} //if (Symbol()=="USDCHF") {ProfitMade= 35; StopLoss=100;} //if (Symbol()=="USDJPY") {ProfitMade= 35; StopLoss=100;} }//UseOpts Print(Symbol()," is using ProfitMade=",ProfitMade," and StopLoss=",StopLoss); Comment(" "); } //+----------------+ //| Custom DE-init | //+----------------+ // Called ONCE when EA is removed from chart int deinit() { Print ("DE-Init happened ",CurTime()); Comment(" "); } //+-----------+ //| Main | //+-----------+ // Called EACH TICK and each Bar[] int start() { double p=Point(); int cnt=0; int gle=0; int OrdersPerSymbol=0; // stoploss and takeprofit calcs double SL=0; double TP=0; // Moving Averages double MAFast=0; double MASlow=0; // RSI indicator and direction double RSI=0; double RSI2=0; bool RSIPOS=false; bool RSINEG=false; // PLEASE NOTE // There is no error checking here for AccountFreeMargin // That's because ProfitMade is in a loop at the bottom of this code. // If you exit on no margin, you can NEVER collect profit from remaing // open trades because the code that would collect it can never execute. // Besides, the server won't let you trade anyway, so it was only a courtesy. // bar counting if(bartime!=Time[0]) {bartime=Time[0]; bartick++; TradeAllowed=true;} // 3-period and 7-period EXPONENTIAL moving averageon CLOSE of Bar[1] MAFast=iMA(Symbol(),15,3,0,MODE_EMA,PRICE_CLOSE,1); MASlow=iMA(Symbol(),15,7,0,MODE_EMA,PRICE_CLOSE,1); // 2-period RSI on Bar[2] RSI= iRSI(Symbol(),15,2,PRICE_CLOSE,2); RSI2=iRSI(Symbol(),15,2,PRICE_CLOSE,1); // Determine what polarity RSI is in if(RSI>RSI_Pos && RSI2<RSI_Pos2) {RSIPOS=true;} if(RSI<RSI_Neg && RSI2>RSI_Neg2) {RSINEG=true;} OrdersPerSymbol=0; for(cnt=OrdersTotal();cnt>=0;cnt--) { OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES); if( OrderSymbol()==Symbol() && OrderMagicNumber()==MagicNumber) { OrdersPerSymbol++; } } if((OrdersPerSymbol < NumberOfOrders) && TradeAllowed) { //ENTRY LONG (buy, Ask) if(MAFast>(MASlow+p) && RSINEG) { //Ask(buy, long) SL=Ask-(StopLoss*p); TP=Ask+(TakeProfit*p); OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,SL,TP,TradeComment,MagicNumber,White); gle=GetLastError(); if(gle==0) { Print ("BUY Ask=",Ask," bartick=",bartick); bartick=0; TradeAllowed=false; } else { Print ("BUY -----ERROR----- Ask=",Ask," MAFast=",MAFast," MASlow=",MASlow," RSI=",RSI," gle=",gle," bartick=",bartick); } return(0); } //ENTRY SHORT (sell, Bid) if(MAFast<(MASlow-p) && RSIPOS) { SL=Bid+(StopLoss*p); TP=Bid-(TakeProfit*p); OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,SL,TP,TradeComment,MagicNumber,Red); gle=GetLastError(); if(gle==0) { Print ("SELL Bid=",Bid," bartick=",bartick); bartick=0; TradeAllowed=false; } else { Print ("SELL -----ERROR----- Bid=",Bid," MAFast=",MAFast," MASlow=",MASlow," RSI=",RSI," gle=",gle," bartick=",bartick); } return(0); } } //if // CLOSE order if profit target made for(cnt=0;cnt<OrdersTotal();cnt++) { OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES); if( OrderSymbol()==Symbol() && OrderMagicNumber()==MagicNumber ) { if(OrderType()==OP_BUY) { // did we make our desired BUY profit? if(Bid-OrderOpenPrice() > ProfitMade*p ) { OrderClose(OrderTicket(),Lots,Bid,Slippage,White); gle=GetLastError(); if(gle==0) { Print ("BUYCLOSE Bid=",Bid," bartick=",bartick); bartick=0; } else { Print ("BUY CLOSE -----ERROR----- Bid=",Bid," MAFast=",MAFast," MASlow=",MASlow," RSI=",RSI," gle=",gle," bartick=",bartick); } return(0); } } // if BUY if(OrderType()==OP_SELL) { // did we make our desired SELL profit? if(OrderOpenPrice()-Ask > (ProfitMade*p) ) { OrderClose(OrderTicket(),Lots,Ask,Slippage,Red); if(gle==0) { Print ("SELLCLOSE Ask=",Ask," bartick=",bartick); bartick=0; } else { Print ("SELL CLOSE -----ERROR----- Ask=",Ask," MAFast=",MAFast," MASlow=",MASlow," RSI=",RSI," gle=",gle," bartick=",bartick); } return(0); } } //if SELL } // if(OrderSymbol) } // for } // start()

Guida Expert Advisor

Guida Expert Advisor. Un guida breve ai forex expert advisors.

Guida Expert Advisor. Un guida breve ai forex expert advisors.

Il Forex

Il Forex

Il Forex market, mercato delle valute e dei cambi.  Il mercato Forex cosa è? Qual'è il significato di Forex Exchange? Il mercato delle valute e ...

Il Forex

Il Forex market, mercato delle valute e dei cambi. 

Il mercato Forex cosa è? Qual'è il significato di Forex Exchange? Il mercato delle valute e dei cambi si chiama Forex ed è sempre aperto 24 ore su 24. Il mercato delle divise, conosciuto anche come mercato forex (FX), dall'inglese foreign exchange, è un mercato finanziario internazionale decentralizzato in cui investitori e speculatori cambiano una valuta per un'altra.

  • Cosa vuol dire fare Forex?
  • Il Forex è il mercato più grande e più liquido del mondo
  • I protagonisti del Forex
  • Banche e Broker
  • Come fare trading sul Forex?
  • Come posso diventare trader professionista: da dove iniziare?
  • Cos'è un Forex expert advisor?
Expert Advisor

Metatrader - Expert Advisor

METATRADER – FOREX EXPERT ADVISOR. Gli Expert Advisor, o anche semplicemente EA, sono sistemi di trading automatico che operano sulla piattaforma M ...

Expert Advisor

METATRADER – FOREX EXPERT ADVISOR.

Gli Expert Advisor, o anche semplicemente EA, sono sistemi di trading automatico che operano sulla piattaforma MetaTrader. In pratica sono strisce di codice che selezionano le condizioni per dare segnali di acquisto o vendita sulle valute. Sono programmati con un linguaggio specifico chiamato MQL, che permette di definire le regole di ingresso e uscita dal mercato, le strategie di gestione del rischio e del capitale, gli indicatori tecnici e gli altri elementi necessari per automatizzare le operazioni di trading.

Gli EA sono in grado di identificare le opportunità di investimento, aprire e chiudere posizioni, monitorare il mercato e inviare segnali al trader che li utilizza. Gli EA possono essere personalizzati in base alle esigenze e alle preferenze del trader, oppure si possono acquistare o scaricare gratuitamente da siti specializzati. 

Contenuti:

Metatrader Expert Advisor

Metatrader Expert Advisor Gratis - MT4 Expert Advisor sono indicatori utili nei trading system automatici. Scopri qui un Metatrader Expert Advisor G ...

Forex Expert Advisor per Metatrader.Metatrader Expert Advisor Gratis - MT4 Expert Advisor sono indicatori utili nei trading system automatici.
Scopri qui un Metatrader Expert Advisor Gratis per iniziare e provare su un "conto demo" che non comporta alcun rischio. 
Ti offriamo una risorsa gratuita al solo scopo di fare esperienza sul Forex, scegliendo indicatore, cross di valute e condizioni di mercato ideali.
Possiamo inoltre fornirti Forex Expert Advisor su misura in base alle tue indicazioni.
Altri nostri Forex EA, ai quali ti puoi abbonare, sono testati da tempo ed ottengono ottimi risultati.
Per ulteriori informazioni Contattaci Adesso.

Migliori Expert Advisor

Migliori Expert Advisor.

Migliori Expert Advisor.

Forex Expert Advisor Generator

Nuovo Expert Advisor Generator

Webinar di presentazione 11 agosto alle ore 19:00. Vuoi creare le tue strategie automatiche di trading? Non hai tempo e voglia di stare davanti a ...

Forex Expert Advisor Generator

Webinar di presentazione 11 agosto alle ore 19:00.

Vuoi creare le tue strategie automatiche di trading? Non hai tempo e voglia di stare davanti ai grafici e vuoi automatizzare i tuoi sistemi? Hai commissionato le tue strategie a programmatori,ma con scarsi risultati? 
Ci sono due soluzioni a questi problemi; la prima è imparare a programmare... la seconda (che è molto più interessante e non serve saper programmare!) è usare una tecnologia avanzata, cioè un software che genera sistemi di trading in automatico tramite un algoritmo sofisticato! I trading system sono molto utili, ma serve esperienza per costruirli correttamente. Hai quindi bisogno di un Forex Expert Advisor Generator.
Chi ha ideato questo nuovo generatore di Forex Expert advisor si chiama Roberto La Bella, Ingegnere informatico, trader e programmatore MQL4. 
Per presentare le interessanti caratteristiche di questo nuovo software in maniera dettagliata ha organizzato un Webinar Live che si terrà l'11 agosto alle ore 19:00. Preparati ad assistere a una tecnologia di altissimo livello!
 
 
 
Trading System Usa

Trading System Usa

Trading System Usa - Alcuni Forex Expert Advisor. I Forex Expert Advisor sono dei trading system che applicati sul mercato Forex offrono a volte dei ...

Trading System Usa

Trading System Usa - Alcuni Forex Expert Advisor.

I Forex Expert Advisor sono dei trading system che applicati sul mercato Forex offrono a volte dei rendimenti interessanti e permettono di controllare il rischio con la possibilità di individuare attraverso i dati statistici del expert advisor le situazioni più critiche dal punto di vista trading e quindi di evitarle. Questa ricerca continua di un Forex Expert Advisor robusto ed affidabile che permetta di guadagnare ed evitare i rischi più grossi, si svolge in tutto il mondo.

Contenuti:

Trading system

Trading system: le metriche più importanti

Quali sono le metriche più importanti di un trading system sul Forex? Un trading system è un insieme di regole e algoritmi che determinano quando e ...

Trading system

Quali sono le metriche più importanti di un trading system sul Forex?

Un trading system è un insieme di regole e algoritmi che determinano quando entrare e uscire dal mercato Forex, in base a una serie di indicatori e condizioni. Ma quali sono le metriche ed i parametri più importanti per poterne valutare l'efficacia sul mercato Forex? Un trading system può essere automatizzato o semi-automatizzato, e può avere diversi obiettivi e stili di trading. Le offerte di trading system con guadagni stratosferici si sprecano.

Trading system, Forex EA, abbonamenti a segnali, copy trading, expert advisor sono le kw più cercate. Ma come posso valutare una proposta ed affidarmi ad un trading system, se quello che so di lui è solo il guadagno? Non dicono nulla del rischio, della robustezza del sistema, dei parametri e metriche che mi consentirebbero di fare una prima valutazione. Evidentemente i venditori puntano sulla vostra avidità e vi propongono facili guadagni. Dunque quali sono le metriche da conoscere per poter fare una prima valutazione?   

Per valutare l’efficacia e l’affidabilità di un trading system, è necessario monitorare e analizzare una serie di metriche che misurano la performance e il rischio del sistema. Queste metriche possono aiutare a capire i punti di forza e di debolezza del sistema, a ottimizzare le regole e i parametri del sistema, e a confrontare diversi sistemi tra loro.

In questo articolo vedremo quali sono le metriche più importanti di un trading system sul mercato Forex e come valutarle.

Contenuti:

Avviso. I Forex Expert Advisor ed i mercati finanziari comportano rischi. Ti invitiamo a consultare il " Disclaimer " e la " Privacy "

Copyright © 2024 I migliori Forex Expert Advisor free per MT4 e MT5. Tutti i diritti riservati.
Joomla! è un software libero rilasciato sotto licenza GNU/GPL.