Hallo Zusammen,
ich habe schon gedacht, dass im 2 ten Parameter "OP_BUYSTOP" oder "OP_SELLSTP" stehen muss, allerdings nun die Frage erkennt MT4 automatisch, dass Kauf und verkauf am high und low der vorherigen Kerze sein sollen?
Dementsprechend müsste ich (wenn das so klappen würde) ja nur:
Hallo Testmaster,
extern int BTP=10;
extern int BSL=20;
extern int STP=10;
extern int SSL=20;
extern double Lots=0.1;
extern int slippage=1;
int iOrderOpenStatus;
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
//----Kauflogik
if (Open[-1] < Close[-1])
{
double BSL=Ask-(BSL*Point);
double BTP=Ask+(BTP*Point);
iOrderOpenStatus=OrderSend (Symbol(), OP_BUYSTOP,Lots, Ask, slippage, BSL, BTP, "Kauf",0,Green);
}
//----Verkaufslogik
if (Close[-1] < Open[-1])
{
double SSL=Bid-(SSL*Point);
double STP=Bid+(STP*Point);
iOrderOpenStatus=OrderSend (Symbol(), OP_SELLSTOP,Lots, Bid, slippage, SSL, STP, "Verkauf",0,Red);
}
return(0);
}
//+------------------------------------------------------------------+
abändern..
Vielen Dank und schönes WE
Marc
__________________
Heute Weizen, Abends Corn morgen fangen wir an von vorn...
|