Einzelnen Beitrag anzeigen
  #16 (permalink)  
Alt 05.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 gibts nur noch einen Fehler.

'{' - function definition unexpected

Code:
//Globale Variablen
int MagicNumber = 541574052;
string Name = "Valerius 3GD Vola-EA";

extern int TimeFrame = 0;
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 GD_Type = 0;
extern string GD_Types = "SMA:0; EMA:1; SMMA;2; LWMA:3";
int GD_Shift = 0;
extern double Lots = 0.01;
extern double MaxSpread = 40.0;
extern int Slippage = 300;

int Ticket, i;
double PointSet;
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
   
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---
   
  }
//+------------------------------------------------------------------+
//| ChartEvent function                                              |
//+------------------------------------------------------------------+
void OnChartEvent(const int id,
                  const long &lparam,
                  const double &dparam,
                  const string &sparam)
  {
//---
   
  }
//+------------------------------------------------------------------+
{
int start

if (Digits <= 3) PointSet = 0.01; else PointSet = 0.0001;
if (Digits <= 1) PointSet = 1;
Lots = MathMax(MathMin(Lots, MarketInfo(Symbol(),MODE_MAXLOT)),MarketInfo(Symbol(),MODE_MINLOT));

double AktuellerSpread = Ask-Bid;
double LC = iClose(Symbol(), TimeFrame, 1); 
double CloseGD = iMA iClose;
double HighGD = iMA iHigh(Symbol(), TimeFrame, Fast_GD, GD_Shift, GD_Type, PRICE_CLOSE, 1);
double LowGD = iMA iLow (Symbol(), TimeFrame, Fast_GD, GD_Shift, GD_Type, PRICE_CLOSE, 1);

//Open Orders
if (AktuellerSpread <= Max Spread && LC > CloseGD && CloseGD > HighGD) OrderSend(Symbol(), OP_BUY, Lots, Ask, Slippage, 0, 0, Name + " Buy(#" + MagicNumber + ")", MagicNumber, 0, Blue);
if (AktuellerSpread <= Max Spread && LC < CloseGD && CloseGD < LowGD) OrderSend(Symbol(), OP_SELL, Lots, Bid, Slippage, 0, 0, Name + " Sell(#" + MagicNumber + ")", MagicNumber, 0, Red);

//Close Orders
if (LC < CloseGD && CloseGD < LowGD) OrderClose(OrderTicket(), OrderLots(), Bid, Slippage, DarkBlue), 0;
if (LC > CloseGD && CloseGD > LowGD) OrderClose(OrderTicket(), OrderLots(), Bid, Slippage, DarkBlue), 0;

return(0)
}