Bonjour ;
L'objectif est de faire le Point ensemble pour définir 1 seul marché et son unité de temps unique avec ce Robot.
Plus de gens participeront aux BackTest avec leur broker, plus le résultat final sera valable.
Avantage certain pour vous ? Ce Robot est déjà a vous ! (Cadeau)
Condition 1 : 500 € de capital pour tout le monde.
Condition 2 : Ne rien changer sur le robot (réglages)
Condition 3 : Trouver le marché le plus performant chez vous et préciser son unité de temps.
Condition 4 : Partager votre meilleur résultat (tout simplement)
Voici le Robot : Si vous savez pas compiler, je vous l envoie par eMail (Venir me voir en privé)
Merci pour votre participation ! Ensemble..
GAGNONS !
Yo' (aRka)
L'objectif est de faire le Point ensemble pour définir 1 seul marché et son unité de temps unique avec ce Robot.
Plus de gens participeront aux BackTest avec leur broker, plus le résultat final sera valable.
Avantage certain pour vous ? Ce Robot est déjà a vous ! (Cadeau)
Condition 1 : 500 € de capital pour tout le monde.
Condition 2 : Ne rien changer sur le robot (réglages)
Condition 3 : Trouver le marché le plus performant chez vous et préciser son unité de temps.
Condition 4 : Partager votre meilleur résultat (tout simplement)
Voici le Robot : Si vous savez pas compiler, je vous l envoie par eMail (Venir me voir en privé)
Code
//+------------------------------------------------------------------+
//| aRka3579 |
//+------------------------------------------------------------------+
input int Magic = 1;
extern int ATR_Period = 24;
extern string MM = "|||||||||| MONEY MANAGEMENT Risk ||||||||||";
input double Lots = 35;
extern string __2 = "|||||||||| SL/TP & TRAILING STOP ||||||||||";
extern double TP_ATR = 789 ;
extern double SL_ATR = 2.7;
extern double TS_ATR = 2.7;
//------------------
double slb,tpb,sls,tps,pt;
double last_profit, last_lot;
int last_tip;
int last_bar = 0;
// My TrailingStop
void Trailingstop()
{
for(int i=OrdersTotal()-1; i>=0;i--)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
if(OrderSymbol()==Symbol())
if(OrderMagicNumber()==Magic)
if(OrderType()==OP_BUY)
{
if(Ask-OrderOpenPrice()>+iATR(NULL,PERIOD_CURRENT,ATR_Period,0)*TS_ATR)
if(OrderStopLoss()<Ask-iATR(NULL,PERIOD_CURRENT,ATR_Period,0)*TS_ATR)
int TBM=OrderModify(OrderTicket(),OrderOpenPrice(),Bid-iATR(NULL,PERIOD_CURRENT,ATR_Period,0)*TS_ATR,OrderTakeProfit(),0,clrNONE);
}
else if(OrderType()==OP_SELL)
{
if(OrderOpenPrice()-Bid>-iATR(NULL,PERIOD_CURRENT,ATR_Period,0)*TS_ATR)
if(OrderStopLoss()>Bid+iATR(NULL,PERIOD_CURRENT,ATR_Period,0)*TS_ATR)
int TSM=OrderModify(OrderTicket(),OrderOpenPrice(),Ask+iATR(NULL,PERIOD_CURRENT,ATR_Period,0)*TS_ATR,OrderTakeProfit(),0,clrNONE);
}
}
}
//| Calculate open positions
int CalculateCurrentOrders(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()==Magic)
{
if(OrderType()==OP_BUY) buys++;
if(OrderType()==OP_SELL) sells++;
}
}
//--- return orders volume
if(buys>0) return(buys);
else return(-sells);
}
//| Check for open order conditions
void CheckForOpen()
{
int res;
if(Volume[0]>1) return;
if(SL_ATR==0)slb=0;else slb=Close[0]-iATR(NULL,PERIOD_CURRENT,17,0)*SL_ATR;
if(SL_ATR==0)sls=0;else sls=Close[0]+iATR(NULL,PERIOD_CURRENT,17,0)*SL_ATR;
if(TP_ATR==0)tpb=0;else tpb=Close[0]+iATR(NULL,PERIOD_CURRENT,17,0)*TP_ATR;
if(TP_ATR==0)tps=0;else tps=Close[0]-iATR(NULL,PERIOD_CURRENT,17,0)*TP_ATR;
double ssA=iIchimoku(NULL, 0,9,26,52, MODE_SENKOUSPANA,0);
double ssB=iIchimoku(NULL, 0,9,26,52, MODE_SENKOUSPANB,0);
double rhigh = iHigh(Symbol(),Period(),iHighest(Symbol(), Period(), MODE_HIGH, 23,1+1));
double rlow = iLow(Symbol(),Period(),iLowest(Symbol(), Period(), MODE_LOW, 23, 1+1));
// Candle value
double CLOSE = iClose(Symbol(),0, 1);
double HIGH = iHigh(Symbol(),0, 1);
double LOW = iLow(Symbol(),0, 1);
//--- SELL conditions
if(iMA(NULL,PERIOD_CURRENT,1,0,MODE_SMA,PRICE_CLOSE,1)<iBands(NULL,PERIOD_CURRENT,128,1,0,PRICE_OPEN,MODE_LOWER,1))
if(((CLOSE < rlow && 1 > 0) || (LOW < rlow)))
if(Open[1]<ssA && Open[1]<ssB)
{
res=OrderSend(Symbol(),OP_SELL,(AccountEquity() * 0.001 /Lots),Bid,3,sls,tps,"Sell",Magic,0,Red);
return;
}
//--- BUY conditions
if(iMA(NULL,PERIOD_CURRENT,1,0,MODE_SMA,PRICE_CLOSE,1)>iBands(NULL,PERIOD_CURRENT,128,1,0,PRICE_OPEN,MODE_UPPER,1))
if(((CLOSE > rhigh && 1 > 0) || (HIGH > rhigh)))
if(Open[1]>ssA && Open[1]>ssB)
{
res=OrderSend(Symbol(),OP_BUY,(AccountEquity() * 0.001 /Lots),Ask,3,slb,tpb,"Buy",Magic,0,Blue);
return;
}
}
//| OnTick function
void OnTick()
{
//--- check for history and trading
if(Bars<100 || IsTradeAllowed()==false)
return;
//--- calculate open orders by current symbol
if(CalculateCurrentOrders(Symbol())==0) CheckForOpen();
else Trailingstop();
}
Merci pour votre participation ! Ensemble..
GAGNONS !
Yo' (aRka)