Einzelnen Beitrag anzeigen
  #80 (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

Hallo.

Wollte mal selber nen IKH EA basteln. Hab in nicht mal 20 Zeilen 7 Fehler und keine Ahnung was da nicht passt.

Code:
//+------------------------------------------------------------------+
//|                                                   EigenerIKH.mq4 |
//|                        Copyright 2016, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2016, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict

//IKH Globale Variablen
int MagicNumber = 541371055;
extern int TimeFrame = 60;
extern int Tenkan = 7;   // Tenkan-sen
extern int Kijun = 22;   // Kijun-sen
extern int Senkou = 44;  // Senkou Span B
extern double Lots = 0.01;
extern string TimeFrames = "Current:0;M1:1; M5:5; M15:15; M30:30; H1:60; H4:240; D1:1440";
extern int Slippage = 200;

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

//Open Orders
}
if (Tenkan > Kijun && Kijun > Senkou) OrderSend(Symbol()), OP_BUY, Lots, Ask, Slippage, 0, 0, Name + " Buy(#" + MagicNumber + ")", MagicNumber, 1, Blue);
if (Tenkan < Kijun && Kijun < Senkou) OrderSend(Symbol()), OP_SELL, Lots, Bid, Slippage, 0, 0, Name + " Buy(#" + MagicNumber + ")", MagicNumber, 1, Red);
{
//Close Orders
{
if (OrderType()==OP_BUY && OrderMagicNumber()==MagicNumber && OrderSymbol()==Symbol());
if (Tenkan < Kijun) OrderClose(OrderTicket(), OrderLots(), Bid, Slippage, DarkBlue), 1;

if (OrderType()==OP_SELL && OrderMagicNumber()==MagicNumber && OrderSymbol()==Symbol());
if (Tenkan > Kijun) OrderClose(OrderTicket(), OrderLots(), Ask, Slippage, FireBrick), 1;
}
return(0);
}