- Wir können hier deutsch sprechen :)
- Bitte editiere Dein Post einmal (wichtig), dass Code als Code dargestellt wird mit
oder Alt +S
und dann auch gleich Deinen Beitrag in deutsch - warum nicht. - Erwarte aber nicht, dass hier im Forum jemand für Dich Deine Idee programmiert, weil Du das nicht kannst,
- dafür gibt es die Freelancer, aber beschreibe genau das, was Du willst - lies vorhwer das, es macht die Sache klar und sicherer:
Regeln: https://www.mql5.com/de/job/rules
EA Pflichtenheft HowT: https://www.mql5.com/de/articles/4368
Indi Pflichtenheft HowTo: https://www.mql5.com/de/articles/4304 - Hier noch Links zu Tipp und Hinweise für Programmier-Anfänger:
https://www.mql5.com/de/articles/496
https://www.mql5.com/de/articles/100
https://www.mql5.com/de/articles/599
https://www.mql5.com/de/articles/232
Ord.,Pos.,Deals: https://www.mql5.com/de/articles/211
Fertige Vorlagen für die Verwendung von Indikatoren in Expert Advisors: https://www.mql5.com/de/articles/13244
und zur Fehlersuche, wenn das Programm nicht tut, was es soll: https://www.metatrader5.com/de/metaeditor/help/development/debug
Es gibt fast nichts, das nicht schon für MT4/5 programmiert wurde!
=> Suchen in den Artikeln: https://www.mql5.com/de/articles
=> Suchen in der Codebase: https://www.mql5.com/de/code
=> Suchen allgemein: https://www.mql5.com/de/search oder über Google mit: "site:mql5.com .." (verzeiht Schreibfehler)

- 2024.02.29
- www.mql5.com
Oke.
Also ich habe Versucht einen bot zu erstellen bei dem eine bestimmte Kerze als Zone benutzt wird
Z.B 17:05
Wenn eine Kerze über dieser Zone schließt, dann soll der bot Long gehen mit eigenem TP (Einstellungen)
Und sl sollte die untere Zone der Candle sein. Bei der 17:05 Candle soll auch der Wick gezählt werden.
Wenn eine Kerze unter der Zone schließt soll der bot short gehen mit dem voreingestellten TP und der SL. Soll das oberige der Candle sein (oberige der 17:05 Candle in diesem Fall) und bevor Long oder short gegangen wird, muss auch die Candle entweder mit dem Body oder mit dem Wick in der Zone sein (gleichzeitig)
Außerdem gibt es die Einstellung das nur bei einem bestimmten ATR Wert getradet wird und nur Long bei z.B über 200 SMA und nur short unter 200 SMA
Außerdem soll es eine Einstellung geben das SL vergrößert werden soll und TP verkleinert je nach was man für einen spread hat (sollte man in Einstellungen entscheiden können). Also 2 Pips kürzerer TP und 2 Pips weiterer SL, wenn spread z.b 2 Pips ist.
Breakeven und trailing wären auch super
Das ist was ich versucht have:
input double UpZone = 1.3000; // Define your UpZone value input double DownZone = 1.2900; // Define your DownZone value input int ATR_Period = 14; // ATR period input double MinATRLevel = 0.001; // Minimum ATR level to trigger a trade input double TakeProfitPips = 20; // Take Profit in pips input double SpreadPips = 2; // Desired spread in pips //+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ int OnInit() { // Add initialization code here if (!CheckSettings()) { Print("EA initialization failed. Check settings."); return(INIT_FAILED); } return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void OnTick() { double closePrice = iClose(Symbol(), 0, 0); double openPrice = iOpen(Symbol(), 0, 0); double highPrice = iHigh(Symbol(), 0, 0); double lowPrice = iLow(Symbol(), 0, 0); double spread = MarketInfo(Symbol(), MODE_SPREAD); double atrValue = iATR(Symbol(), 0, ATR_Period, 0); double stopLoss, takeProfit; // Declare variables outside of if statements // Check if ATR is greater than the specified minimum level if (atrValue >= MinATRLevel) { // Check if candle closes below DownZone but also has its body in the Zone if (closePrice < DownZone && openPrice > DownZone) { stopLoss = DownZone + SpreadPips * Point; takeProfit = openPrice + TakeProfitPips * Point - SpreadPips * Point; // Execute sell logic if (ExecuteSell(stopLoss, takeProfit) < 0) { Print("Sell order execution failed. Check logs."); } } // Check if candle closes above UpZone but also has a wick or body in the Zone if (closePrice > UpZone && (highPrice > UpZone || lowPrice > UpZone)) { stopLoss = UpZone - SpreadPips * Point; takeProfit = openPrice - TakeProfitPips * Point + SpreadPips * Point; // Execute buy logic if (ExecuteBuy(stopLoss, takeProfit) < 0) { Print("Buy order execution failed. Check logs."); } } } } //+------------------------------------------------------------------+ //| Check EA settings | //+------------------------------------------------------------------+ bool CheckSettings() { // Add additional checks if needed return (TakeProfitPips > 0 && SpreadPips >= 0); } //+------------------------------------------------------------------+ //| Execute Sell Order | //+------------------------------------------------------------------+ int ExecuteSell(double stopLoss, double takeProfit) { return (OrderSend(Symbol(), OP_SELL, 0.1, iClose(Symbol(), 0, 0), 3, stopLoss, takeProfit, "Sell order", 0, 0, Red)); } //+------------------------------------------------------------------+ //| Execute Buy Order | //+------------------------------------------------------------------+ int ExecuteBuy(double stopLoss, double takeProfit) { return (OrderSend(Symbol(), OP_BUY, 0.1, iClose(Symbol(), 0, 0), 3, stopLoss, takeProfit, "Buy order", 0, 0, Blue)); }
Frage, würdest Du, nachdem Du mit einem schrecklichen Ergebnis versucht hast, zu Hause selbst das Haar zu schneiden zum Friseur gehen: "Können Sie mir meine Frisur umsonst schön schneiden, ich hab ja schon mal angefangen...?"
Entweder Du lernst programmieren oder zu zahlst einen Freelancer (die sind nicht sooo teuer!) oder Du suchst, denn es gibt fast nichts, was nicht schon für MT4/MT5 programmiert wurde.
Außerdem der MT4 hat ein 'weiches Ablaufdatum': https://www.mql5.com/en/forum/454319

- 2023.09.19
- narco
- www.mql5.com

- Freie Handelsapplikationen
- Über 8.000 Signale zum Kopieren
- Wirtschaftsnachrichten für die Lage an den Finanzmärkte
Sie stimmen der Website-Richtlinie und den Nutzungsbedingungen zu.
Hi!
I would Like to request an EA, that is basically an Breakout EA and First you Tell the EA an time of the Candle that it should Mark the highs and lows of, and then after that time, depending on which tf it IS, it buys If Candle closes above the Zone, but also has a Wick or the Body still in the Zone, and Same for selling, Just that the Candle should be under the Zone (and Body or Wick in it). Also IT would be cool, If there is a setting with min. ATR Level and which period. And maybe SMA Settings too (to Just buy above 200 SMA and sell under)
TP settings are also good, and SL should be dynamic (If sell, then sl = high of that Candle which Is used as Zone and If buy then sel = Low of canlce that is used as Zone)
It would be perfect If there is a setting to add Off Pips
Where you enter your Pips Size and TP gets reduced by These Pips and SL gets wider, so You dont get Wicked Out, or dont Take Profit.
I have tried this, maybe it can Help you :)
input double UpZone = 1.3000; // Define your UpZone value
input double DownZone = 1.2900; // Define your DownZone value
input int ATR_Period = 14; // ATR period
input double MinATRLevel = 0.001; // Minimum ATR level to trigger a trade
input double TakeProfitPips = 20; // Take Profit in pips
input double SpreadPips = 2; // Desired spread in pips
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
// Add initialization code here
if (!CheckSettings()) {
Print("EA initialization failed. Check settings.");
return(INIT_FAILED);
}
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
void OnTick()
{
double closePrice = iClose(Symbol(), 0, 0);
double openPrice = iOpen(Symbol(), 0, 0);
double highPrice = iHigh(Symbol(), 0, 0);
double lowPrice = iLow(Symbol(), 0, 0);
double atrValue = iATR(Symbol(), 0, ATR_Period, 0);
double stopLoss, takeProfit; // Declare variables outside of if statements
// Check if ATR is greater than the specified minimum level
if (atrValue >= MinATRLevel)
{
// Check if candle closes below DownZone but also has its body in the Zone
if (closePrice < DownZone && openPrice > DownZone)
{
stopLoss = DownZone + SpreadPips * Point;
takeProfit = openPrice + TakeProfitPips * Point - SpreadPips * Point;
// Execute sell logic
if (ExecuteSell(stopLoss, takeProfit) < 0) {
Print("Sell order execution failed. Check logs.");
}
}
// Check if candle closes above UpZone but also has a wick or body in the Zone
if (closePrice > UpZone && (highPrice > UpZone || lowPrice > UpZone))
{
stopLoss = UpZone - SpreadPips * Point;
takeProfit = openPrice - TakeProfitPips * Point + SpreadPips * Point;
// Execute buy logic
if (ExecuteBuy(stopLoss, takeProfit) < 0) {
Print("Buy order execution failed. Check logs.");
}
}
}
}
//+------------------------------------------------------------------+
//| Check EA settings |
//+------------------------------------------------------------------+
bool CheckSettings()
{
// Add additional checks if needed
return (TakeProfitPips > 0 && SpreadPips >= 0);
}
//+------------------------------------------------------------------+
//| Execute Sell Order |
//+------------------------------------------------------------------+
int ExecuteSell(double stopLoss, double takeProfit)
{
int attempts = 0;
int result;
do
{
result = OrderSend(Symbol(), OP_SELL, 0.1, iClose(Symbol(), 0, 0), 3, stopLoss, takeProfit, "Sell order", 0, 0, Red, 0, 0, 0);
attempts++;
// Add a delay to allow the market to settle
Sleep(1000);
}
while (result < 0 && attempts < 3); // Maximum 3 attempts
return result;
}
//+------------------------------------------------------------------+
//| Execute Buy Order |
//+------------------------------------------------------------------+
int ExecuteBuy(double stopLoss, double takeProfit)
{
int attempts = 0;
int result;
do
{
result = OrderSend(Symbol(), OP_BUY, 0.1, iClose(Symbol(), 0, 0), 3, stopLoss, takeProfit, "Buy order", 0, 0, Blue, 0, 0, 0);
attempts++;
// Add a delay to allow the market to settle
Sleep(1000);
}
while (result < 0 && attempts < 3); // Maximum 3 attempts
return result;
}but UpZone and down Zone should be detected automatically by that one Candle which you should be able to declare in settings, for example
17:05
This will See the high and Low of that Candle and trade based of that (buy above and sell under, but Body or Wick should be includes in the Zone, and Just buy or sell at Close of Candle. Also adjust SL and TP by spread.
Thanks!