Einzelnen Beitrag anzeigen
  #2 (permalink)  
Alt 02.11.14
Magnato Magnato ist offline
Neues Mitglied
 
Registriert seit: Jun 2011
Beiträge: 8
Magnato befindet sich auf einem aufstrebenden Ast
Standard Aus 2 mach 1

Kann mir vielleicht jemand helfen wie ich die 2 Scripte zu einem machen kann?

Zitat:
//+------------------------------------------------------------------+
//| Buy with SL and TP |
//| Copyright © 2008, smjones |
//| sjcoinc |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2008, smjones"
#property link "sjcoinc2000@yahoo.com"


#property show_inputs

extern double Lots = 0.2;
extern bool UseMoneyMgmt = false;
extern double RiskPercent = 2;
extern bool UseStop = true;
extern bool UseTakeProfit = true;
extern double StopLoss = 100;
extern double TakeProfit = 100;
extern string Note="0 in Entry field means Market Order Buy";
extern double Entry = 1.2600;

string Input = " Buy Price ";



//+------------------------------------------------------------------+
//| script program start function |
//+------------------------------------------------------------------+
int start()
{
double Risk = RiskPercent / 100;
if (UseMoneyMgmt)
Lots = NormalizeDouble( AccountBalance()*Risk/StopLoss/(MarketInfo(Symbol(), MODE_TICKVALUE)),2);
int Mode = OP_BUYSTOP;
if (Ask > Entry && Entry > 0) Mode = OP_BUYLIMIT;
if (Entry == 0) {Entry = Ask; Mode = OP_BUY;}
double SLB = Entry - StopLoss*Point, TPB = Entry + TakeProfit*Point;
if (UseStop == false) SLB = 0;
if (UseTakeProfit == false) TPB = 0;
if(Lots > 0)
OrderSend(Symbol(),Mode, Lots, Entry, 2,SLB , TPB, "Buy Script", 0, NULL, LimeGreen);



return(0);
}
//+------------------------------------------------------------------+
Und wenn die erste Position ausgestoppt wird, möchte ich gerne das untere Script ausgelöst haben.

Zitat:
//+------------------------------------------------------------------+
//| Sell with SL and TP |
//| Copyright © 2008, smjones |
//| sjcoinc |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2008, smjones"
#property link "sjcoinc2000@yahoo.com"



#property show_inputs

extern double Lots = 0.2;
extern bool UseMoneyMgmt = false;
extern double RiskPercent = 2;
extern bool UseStop = true;
extern bool UseTakeProfit = true;
extern double StopLoss = 100;
extern double TakeProfit = 100;
extern string Note="0 in Entry field means Market Order Sell";
extern double Entry = 1.2600;

string Input = " Sell Price ";




//+------------------------------------------------------------------+
//| script program start function |
//+------------------------------------------------------------------+
int start()
{
double Risk = RiskPercent / 100;
if (UseMoneyMgmt)
Lots = NormalizeDouble( AccountBalance()*Risk/StopLoss/(MarketInfo(Symbol(), MODE_TICKVALUE)),2);
int Mode = OP_SELLSTOP;
if (Bid < Entry && Entry > 0) Mode = OP_SELLLIMIT;
if (Entry == 0) {Entry = Bid; Mode = OP_SELL;}
double SLS = Entry+StopLoss*Point, TPS = Entry - TakeProfit * Point;
if (UseStop == false) SLS = 0;
if (UseTakeProfit == false) TPS = 0;
if(Lots > 0)
OrderSend(Symbol(),Mode, Lots, Entry, 2, SLS, TPS, "Sell Script",0, NULL, Red);

return(0);
}
//+------------------------------------------------------------------+
Mein Frage wäre jetzt ob man die zwei Scripte so miteinander verbinden kann dass bei jedem SL das nächste ausgelöst wird?

Mfg
Magnato