Metatrader Forum | Forex Expert-Advisor | Broker & Forex Tools

Metatrader Forum | Forex Expert-Advisor | Broker & Forex Tools (http://www.expert-advisor.com/forum/index.php)
-   Programmierung MQL4 (http://www.expert-advisor.com/forum/forumdisplay.php?f=220)
-   -   Hat jemand ein If-Done Order Script (http://www.expert-advisor.com/forum/showthread.php?t=3942)

Magnato 30.10.14 10:05

Hat jemand ein If-Done Order Script
 
Hallo zusammen,

ich bin auf der Suche nach einem Script oder EA der eine Order sendet wenn eine andere Position am SL ausgestopt wird.

Ich benutze aktuell ein OrderSend Script dass ich manuell immer in den Chart ziehe wenn meine Position ausgestopt wird, aber für diese einfache Tätigkeit muss ich immer anwesend sein.

Deshalb meine Frage ob es vielleicht ein Script oder EA gibt der meine vordefinierten Order einzeln und nacheinander, also nach jedem SL in den Chart zieht.

Würd mich echt freuen wenn da jemand was weiß :)

Magnato 02.11.14 15:56

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


Alle Zeitangaben in WEZ +2. Es ist jetzt 09:10 Uhr.

Powered by vBulletin® Version 3.8.5 (Deutsch)
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.6.1
Powered by vBCMS® 2.7.0 ©2002 - 2024 vbdesigns.de
Copyright ©2009 - 2023 by Expert-Advisor.com - Das Metatrader Forum