Hier habe ich schon mal denn Kern dafür geschrieben
//+------------------------------------------------------------------+
//| MPendingOrder.mq4 |
//| Crazy2net |
//| |
//+------------------------------------------------------------------+
#property copyright "Crazy2net"
#property link ""
#property show_confirm
#property show_inputs
extern int OrderAnzahl = 1 ;
extern string "0 = leer; 1=Buy; 2=Sell; 3=BuyStop; 4=SellStop;"
extern int OrderTyp = 0;
extern int Lot = 0.1 ;
extern int StopLoss = 20 ;
extern int TakeProfit = 20 ;
//+------------------------------------------------------------------+
//| script program start function |
//+------------------------------------------------------------------+
int start()
{
int ticket, Option, Pos;
double Price, sl, tp;
if(OrderTyp==0)break:
if(OrderTyp>0) continue:
if(OrderTyp==1)Option = OP_BUY;
if(OrderTyp==2)Option = OP_SELL;
if(OrderTyp==3)Option = OP_BUYSTOP;
if(OrderTyp==4)Option = OP_SELLSTOP;
if(OrderTyp==5)Option = OP_BUYLIMIT;
if(OrderTyp==6)Option = OP_SELLLIMIT:
if((Option == OP_BUY) || (Option == OP_BUYSTOP) || (Option == OP_BUYLIMIT)) Pos =1;
if((Option == OP_SELL) || (Option == OP_SELLSTOP) || (Option == OP_SELLLIMIT) Pos = 2;
//----
for(int i=1; i<OrderAnzahl; i++)
{
if(Pos==1)
{
ticket = OrderSend(Symbol(),Option,Lot,Ask+Preis*Point,3,Bi d-StopLoss*Point,Ask+TakeProfit*Point,NULL,0,0,Blue) ;
}
if(Pos==2)
{
ticket = OrderSend(Symbol(),Option,Lot,Bid-Preis*Point,3,Ask+StopLoss*Point,Bid-TakeProfit*Point,NULL,0,0,Red);
}
}
//----
return(0);
}
//+------------------------------------------------------------------+
habe noch nicht getestet !
Geändert von Crazy2net (02.12.10 um 17:28 Uhr)
|