Einzelnen Beitrag anzeigen
  #20 (permalink)  
Alt 06.03.16
MA-EA MA-EA ist offline
Elite Mitglied
 
Registriert seit: Sep 2015
Beiträge: 565
MA-EA befindet sich auf einem aufstrebenden Ast
Standard

Jetzt sind es nur noch 4 Fehler.
Code:
//Globale Variablen
int MagicNumber = 541574052;
string Name = "Valerius3GDVolaEA";

extern int TimeFrame = 60;
extern string TimeFrames = "Current:0;M1:1; M5:5; M15:15; M30:30; H1:60; H4:240; D1:1440";
extern int CloseGD = 3;
extern int HighGD = 6;
extern int LowGD = 6;
extern int GDType = 0;
extern string GDTypes = "SMA:0; EMA:1; SMMA;2; LWMA:3";
int GDShift = 0;
extern double Lots = 0.01;

extern int MaxSpread = 40;
extern int Slippage = 300;

extern int Ticket, i;
double PointSet;
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+

int OnInit(){
return(0);
}

double Spread=Ask-Bid;{
}

double LC = iClose(Symbol(), TimeFrame, 1);
double CGD = iMA(Symbol(), TimeFrame, CloseGD, GDShift, GDType, PRICE_CLOSE, 1);
double HGD = iMA(Symbol(), TimeFrame, HighGD, GDShift, GDType, PRICE_HIGH, 1);
double LGD = iMA(Symbol(), TimeFrame, LowGD, GDShift, GDType, PRICE_LOW, 1);

{
int OrderSelect(SELECT_BY_TICKET);
if (OrderSend(Symbol(),0,Lots,Ask,0,magic,0,clrNONE)==true)
}

//Open Orders

if (Spread <= MaxSpread && LC>CGD && CGD>HGD)
OrderSend(Symbol(), OP_BUY, (Lots, Ask, Slippage, Name + " Buy(#" + MagicNumber + ")", MagicNumber, 1, Blue);{
}

if (Spread <= MaxSpread && LC<CGD && CGD<LGD)
OrderSend(Symbol(), OP_SELL, (Lots, Bid, Slippage, Name + " Sell(#" + MagicNumber + ")", MagicNumber, 1, Red);{
}

//Close Orders
if(OrderSelect)(SELECT_BY_TICKET)

if (LC<CGD && CGD<HGD)
OrderClose(Symbol(), OP_BUY, (Lots, Bid, Slippage, ), Blue,);{
}

if (LC>CGD && CGD>LGD)
OrderClose(Symbol(), OP_SELL, (Lots, Ask, Slippage, ), Red,);{
}

return(0);{
}