Einzelnen Beitrag anzeigen
  #180 (permalink)  
Alt 22.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

Ist das alles richtig? Kapiert er so, was er machen soll?

Code:
extern int High_GD = 6;
extern int Close_GD = 3;
extern int Low_GD = 6;
Code:
extern int Max_Spread = 35;
Code:
double O = iOpen(Symbol(), TimeFrame, 0);
double LC = iClose(Symbol(), TimeFrame, 1);
double H = iMA(Symbol(), TimeFrame, High_GD, GD_Shift, GD_Type, PRICE_HIGH, 1);
double C = iMA(Symbol(), TimeFrame, Close_GD, GD_Shift, GD_Type, PRICE_CLOSE, 1);
double L = iMA(Symbol(), TimeFrame, Low_GD, GD_Shift, GD_Type, PRICE_LOW, 1);
Code:
//Open Trade
if (!IsInvested){
if (Spread <= Max_Spread && O>H && LC>H) OrderSend(Symbol(), OP_BUY, Lots, Ask, Slippage, 0, 0, Name + " Buy(#" + MagicNumber + ")", MagicNumber, 0, Blue);
if (Spread <= Max_Spread && O<L && LC<L) OrderSend(Symbol(), OP_SELL, Lots, Bid, Slippage, 0, 0, Name + " Sell(#" + MagicNumber + ")", MagicNumber, 0, Red);}

//Close Trade
if (IsInvested){
for (i=OrdersTotal()-1; i>=0; i--){
if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)){

if (OrderType()==OP_BUY && OrderMagicNumber()==MagicNumber && OrderSymbol()==Symbol()){
if(LC<H && LC<C) OrderClose(OrderTicket(), OrderLots(), Bid, Slippage, DarkBlue);}

if (OrderType()==OP_SELL && OrderMagicNumber()==MagicNumber && OrderSymbol()==Symbol()){
if(LC>L && LC>C) OrderClose(OrderTicket(), OrderLots(), Ask, Slippage, FireBrick);}}}}
return(0);}