Einzelnen Beitrag anzeigen
  #12 (permalink)  
Alt 18.11.15
RonaldM RonaldM ist offline
Neues Mitglied
 
Registriert seit: Nov 2015
Beiträge: 9
RonaldM befindet sich auf einem aufstrebenden Ast
Standard

Hallo, danke für die Rückmeldung.
Die kleinen Fehler im Code habe ich bereits entdeckt und behoben, der Code sieht momentan so aus:


//+------------------------------------------------------------------+
//| plan_pending_order.mq4 |
//| Copyright 2015, MetaQuotes Software Corp. |
//| MQL4: automated forex trading, strategy tester and custom indicators with MetaTrader |
//+------------------------------------------------------------------+
#property copyright "Copyright 2015, MetaQuotes Software Corp."
#property link "http://www.mql4.com"
#property version "1.00"
#property strict
//+------------------------------------------------------------------+
//| Script program start function |
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
//---- input parameters
extern int OpenHour = 9; // Time to open, hours
extern int OpenMinute = 0; // Time to open, minutes
extern bool UseCurrSymbol = False; // Use one symbol only
extern bool UseOneAccount = False; // Use one account only
extern int NumberAccount = 1234076297; // Account number
extern int Slippage = 4; // Slippage
extern double ShortEntry = 0;
extern double LongEntry = 0;
extern double Lots = 0;
extern double StopLoss = 100;
extern double TakeProfit = 100;
extern datetime Exp = D'18.11.2015 18:29:00';
extern int status = -1;
extern color clBuy = Blue; // Color of closing buy
extern color clSell = Red; // Color of closing sell

//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
void start() {

if (UseOneAccount && AccountNumber()!=NumberAccount)
{
Comment("Working on the account: "+AccountNumber()+"is PROHIBITED!");
return;
}
else Comment("");

if (status==-1 && Hour()==OpenHour && Minute()==OpenMinute)
{
//double AskPrice = Ask;
//double BidPrice = Bid;

if (Ask < LongEntry)
{
if(LongEntry > 0) OrderSend(Symbol(),OP_BUYSTOP,Lots,LongEntry,Slipp age,LongEntry-StopLoss,LongEntry+TakeProfit,"Buy",0,Exp,clBuy);
} else {
if(LongEntry > 0) OrderSend(Symbol(),OP_BUYLIMIT,Lots,LongEntry,Slip page,LongEntry-StopLoss,LongEntry+TakeProfit,"Buy",0,Exp,clBuy);
}
}
}
//return(0);

StopLoss und TakeProfit lassen sich ja im MT4 setzen, wenn man den Expert startet.