[WARNUNG GESCHLOSSEN!] Alle Fragen von Neulingen, um das Forum nicht zu überladen. Fachleute, gehen Sie nicht vorbei. Ohne dich kann ich nirgendwo hingehen. - Seite 594
Ich habe die Wahrscheinlichkeitstheorie genommen und statistisch gesehen, wenn die Ordereröffnung innerhalb von 50 Pips vom Preis liegen wird, dann ist bei der Ordereröffnung mit 10 Pips Gewinn leichter zu erreichen - wenn es auch 10 Pips Stop Loss geben wird (sogar Spread ist kein Problem), ist die Trendbewegung eine tolle Sache ...
Hinzufügen eines Stop-Loss, unabhängig von StepStop
//+------------------------------------------------------------------+ //| Volfram.mq4 | //| Vova-x@list.ru | //| | //+------------------------------------------------------------------+ #property copyright "Vova-x@list.ru" #property link "" //----------------------------------------- extern TakeProfit=10; extern int StepStop=45; extern double Lots=0.01; extern bool MoneyManagement=true; extern inttern MarginPercent=10; //------------------------------------------- int level_sell_stop; int level_buy_stop;
//---------------------------------------------------------- void init() { // int minstop=MarketInfo(Symbol(),MODE_STOPLEVEL); //Drucken("levelbuy_stop: "+minstop;) } //----------------------------------------------------------- void start() { if (!IsTradeAllowed()) return; level_buy_stop=0; level_sell_stop=0; StepingStop(); StepingPendings(); if (TotalBuy ()==0 && TotalBuyStop ()==0) SetBuyStop (); if (TotalSell()==0 && TotalSellStop()==0) SetSellStop(); Comment("Level Buy Stop=",level_buy_stop*Point, "\n", "Level Sell Stop=",level_sell_stop*Point); } //--------------------------------------------------------------------------------------------- void StepingStop() { if (StepStop<1) return; int ask, bid, open, stop, x; Doppelter Verlust; for (int i=0; i<OrdersTotal(); i++) { if (!OrderSelect(i,SELECT_BY_POS,MODE_TRADES)) break; if (OrderSymbol()!=Symbol()) if (Auftragsart()==OP_BUY) { bid=MathRound(Bid/Point); open=MathRound(OrderOpenPrice()/Point); stop=MathRound(OrderStopLoss()/Point); x=(Gebot-Eröffnung)/StepStop; x--; x*=StepStop; level_sell_stop=open+x; if (stop>=open+x) Verlust=(offen+x)*Punkt; OrderModify(OrderTicket(),OrderOpenPrice(),loss,OrderTakeProfit(),0,CLR_NONE); } wenn (Auftragsart()==OP_SELL) { ask=MathRound(Ask/Point); open=MathRound(OrderOpenPrice()/Point); stop=MathRound(OrderStopLoss()/Point); x=(open-ask)/StepStop; x--; x*=StepStop; level_buy_stop=open-x; if (stop>0 && stop<=open-x) Verlust=(offen-x)*Punkt; OrderModify(OrderTicket(),OrderOpenPrice(),loss,OrderTakeProfit(),0,CLR_NONE); } } } //---------------------------------------------------------------------------- void StepingPendings() { int ask, bid, open; doppelter Preis, Verlust, Gewinn; for (int i=0; i<OrdersTotal(); i++) { if (!OrderSelect(i,SELECT_BY_POS,MODE_TRADES)) break; if (OrderSymbol()!=Symbol()) wenn (Auftragsart()==OP_BUYSTOP) { if (level_buy_stop==0) open=MathRound(OrderOpenPrice()/Point); wenn (offen<=level_buy_stop) price=level_buy_stop*Point; Verlust=Preis-SchrittStopp*Punkt; profit=0; if (TakeProfit>0) profit=price+TakeProfit*Point; OrderModify(OrderTicket(),Preis,Verlust,Gewinn,0,CLR_NONE); } wenn (Auftragsart()==OP_SELLSTOP) { if (level_sell_stop==0) open=MathRound(OrderOpenPrice()/Point); wenn (offen>=level_sell_stop) price=level_sell_stop*Point; Verlust=Preis+StepStop*Punkt; profit=0; if (TakeProfit>0) profit=price-TakeProfit*Point; OrderModify(OrderTicket(),Preis,Verlust,Gewinn,0,CLR_NONE); } } } //------------------------------------------------------------------- void SetBuyStop() { double lots=LotsCounting(); double price=Bid+StepStop*Point; double loss=Preis-StepStop*Point; double profit=0; if (TakeProfit>0) profit=Preis+TakeProfit*Point; int ticket=OrderSend(Symbol(),OP_BUYSTOP,lots,price,0,loss,profit,"",0,0,CLR_NONE); if (ticket<1) Print("Das Setzen einer ausstehenden Bestellung ist mit Fehler #",GetLastError()," ",(GetLastError()) fehlgeschlagen; }
void SetSellStop() { double lots=LotsCounting(); double price=Ask-StepStop*Point; double loss=Preis+StepStop*Point; double profit=0; if (TakeProfit>0) profit=price-TakeProfit*Point; int ticket=OrderSend(Symbol(),OP_SELLSTOP,lots,price,0,loss,profit,"",0,0,CLR_NONE); if (ticket<1) Print("Das Setzen einer ausstehenden Bestellung ist mit Fehler #",GetLastError()," ",(GetLastError()) fehlgeschlagen; }
int TotalBuy() { int count=0; for (int i=0; i<OrdersTotal(); i++) { if (!OrderSelect(i,SELECT_BY_POS,MODE_TRADES)) break; if (OrderSymbol()!=Symbol()) continue; if (OrderType()==OP_BUY) count++; } zurückgeben (count); }
int TotalBuyStop() { int count=0; for (int i=0; i<OrdersTotal(); i++) { if (!OrderSelect(i,SELECT_BY_POS,MODE_TRADES)) break; if (OrderSymbol()!=Symbol()) continue; if (OrderType()==OP_BUYSTOP) count++; } zurückgeben (count); }
int TotalSell() { int count=0; for (int i=0; i<OrdersTotal(); i++) { if (!OrderSelect(i,SELECT_BY_POS,MODE_TRADES)) break; if (OrderSymbol()!=Symbol()) continue; if (OrderType()==OP_SELL) count++; } zurückgeben (count); }
int TotalSellStop() { int count=0; for (int i=0; i<OrdersTotal(); i++) { if (!OrderSelect(i,SELECT_BY_POS,MODE_TRADES)) break; if (OrderSymbol()!=Symbol()) continue; if (OrderType()==OP_SELLSTOP) count++; } zurückgeben (count); }
double LotsCounting() { Doppellose=Lose; wenn (MoneyManagement) { double lotsize=MarketInfo(Symbol(),MODE_LOTSIZE); double freemargin=AccountFreeMargin(); lots=0; if (lotsize>0) lots=NormalizeDouble((MarginPercent*freemargin/lotsize),1); } if (lots>10) lots=NormalizeDouble(lots,0); wenn (Lose<0,01) Lose=0,01; Rückgabe (Lose); }
Der Grund dafür, dass sie nicht geantwortet haben, liegt wahrscheinlich darin, dass die Erstellung eines solchen Indikators einfach und wahrscheinlich unnötig ist.
Danke, aber was ist damit? Oder sagen Sie mir, ob es in den Einstellungen des Terminals eine Möglichkeit gibt, die Stundenmarkierungen über die gesamte Länge der Zeitskala deutlicher anzuzeigen?
root: Danke, aber trotzdem? Oder sagen Sie mir, ob es in den Einstellungen des Terminals eine Option gibt, mit der die Stundenmarkierungen über die gesamte Länge der Zeitskala deutlicher angezeigt werden?
Ich verstehe es, das Fehlen dieses Indikators ist das letzte, was Sie davon abhält, Geld im Forex zu verdienen. So etwas gibt es definitiv nicht, aber Urain hat ein ähnliches für 8 Zeilen. Wenn Sie das nicht können, fragen Sie den Autor, er ist im Forum.
Hallo. Leute, bitte helft mir bei einer Sache. Ich habe noch nie davon gehört - aber was, wenn es jemand hat? Es geht darum, alle ausgewählten Objekte von einem Diagramm in ein anderes zu übertragen. Angenommen, ich muss die Wellenauszeichnung aller Zeiten eines Symbols in ein Fenster übertragen. Es ist schwierig, den Aufschlag beim Wechsel des Zeitrahmens zu wiederholen, da die Berechnung sehr aufwendig ist (die Berechnung von 30-50 Trends auf M1 lässt das Terminal hervorstechen - und es handelt sich nur um 16-24 Stunden eines Charts). Vielleicht gibt es ein Skript, das die Objekte auf dem Diagramm (in diesem Fall - Trendlinien) mit der anschließenden Übertragung des gesamten Arrays von Trendlinien in ein anderes Fenster kopiert? Oder gibt es vielleicht eine Möglichkeit, mehrere Vorlagen in einem Fenster zu kombinieren?
Wenn Sie kein Benutzerkonto haben, registrieren Sie sich
Erlauben Sie die Verwendung von Cookies, um sich auf der Website MQL5.com anzumelden.
Bitte aktivieren Sie die notwendige Einstellung in Ihrem Browser, da Sie sich sonst nicht einloggen können.
Sie sind angemeldet. Die Zwei-Faktor-Authentifizierung wurde deaktiviert. Richten Sie sie erneut ein und scannen Sie einen neuen QR-Code oder fahren Sie mit deaktivierter Zwei-Faktor-Authentifizierung fort.
Ich habe die Wahrscheinlichkeitstheorie genommen und statistisch gesehen, wenn die Ordereröffnung innerhalb von 50 Pips vom Preis liegen wird, dann ist bei der Ordereröffnung mit 10 Pips Gewinn leichter zu erreichen - wenn es auch 10 Pips Stop Loss geben wird (sogar Spread ist kein Problem), ist die Trendbewegung eine tolle Sache ...
Hinzufügen eines Stop-Loss, unabhängig von StepStop
//+------------------------------------------------------------------+
//| Volfram.mq4 |
//| Vova-x@list.ru |
//| |
//+------------------------------------------------------------------+
#property copyright "Vova-x@list.ru"
#property link ""
//-----------------------------------------
extern TakeProfit=10;
extern int StepStop=45;
extern double Lots=0.01;
extern bool MoneyManagement=true;
extern inttern MarginPercent=10;
//-------------------------------------------
int level_sell_stop;
int level_buy_stop;
//----------------------------------------------------------
void init()
{
// int minstop=MarketInfo(Symbol(),MODE_STOPLEVEL);
//Drucken("levelbuy_stop: "+minstop;)
}
//-----------------------------------------------------------
void start()
{
if (!IsTradeAllowed()) return;
level_buy_stop=0;
level_sell_stop=0;
StepingStop();
StepingPendings();
if (TotalBuy ()==0 && TotalBuyStop ()==0) SetBuyStop ();
if (TotalSell()==0 && TotalSellStop()==0) SetSellStop();
Comment("Level Buy Stop=",level_buy_stop*Point,
"\n", "Level Sell Stop=",level_sell_stop*Point);
}
//---------------------------------------------------------------------------------------------
void StepingStop()
{
if (StepStop<1) return;
int ask, bid, open, stop, x;
Doppelter Verlust;
for (int i=0; i<OrdersTotal(); i++)
{
if (!OrderSelect(i,SELECT_BY_POS,MODE_TRADES)) break;
if (OrderSymbol()!=Symbol())
if (Auftragsart()==OP_BUY)
{
bid=MathRound(Bid/Point);
open=MathRound(OrderOpenPrice()/Point);
stop=MathRound(OrderStopLoss()/Point);
x=(Gebot-Eröffnung)/StepStop; x--; x*=StepStop;
level_sell_stop=open+x;
if (stop>=open+x)
Verlust=(offen+x)*Punkt;
OrderModify(OrderTicket(),OrderOpenPrice(),loss,OrderTakeProfit(),0,CLR_NONE);
}
wenn (Auftragsart()==OP_SELL)
{
ask=MathRound(Ask/Point);
open=MathRound(OrderOpenPrice()/Point);
stop=MathRound(OrderStopLoss()/Point);
x=(open-ask)/StepStop; x--; x*=StepStop;
level_buy_stop=open-x;
if (stop>0 && stop<=open-x)
Verlust=(offen-x)*Punkt;
OrderModify(OrderTicket(),OrderOpenPrice(),loss,OrderTakeProfit(),0,CLR_NONE);
}
}
}
//----------------------------------------------------------------------------
void StepingPendings()
{
int ask, bid, open;
doppelter Preis, Verlust, Gewinn;
for (int i=0; i<OrdersTotal(); i++)
{
if (!OrderSelect(i,SELECT_BY_POS,MODE_TRADES)) break;
if (OrderSymbol()!=Symbol())
wenn (Auftragsart()==OP_BUYSTOP)
{
if (level_buy_stop==0)
open=MathRound(OrderOpenPrice()/Point);
wenn (offen<=level_buy_stop)
price=level_buy_stop*Point;
Verlust=Preis-SchrittStopp*Punkt;
profit=0; if (TakeProfit>0) profit=price+TakeProfit*Point;
OrderModify(OrderTicket(),Preis,Verlust,Gewinn,0,CLR_NONE);
}
wenn (Auftragsart()==OP_SELLSTOP)
{
if (level_sell_stop==0)
open=MathRound(OrderOpenPrice()/Point);
wenn (offen>=level_sell_stop)
price=level_sell_stop*Point;
Verlust=Preis+StepStop*Punkt;
profit=0; if (TakeProfit>0) profit=price-TakeProfit*Point;
OrderModify(OrderTicket(),Preis,Verlust,Gewinn,0,CLR_NONE);
}
}
}
//-------------------------------------------------------------------
void SetBuyStop()
{
double lots=LotsCounting();
double price=Bid+StepStop*Point;
double loss=Preis-StepStop*Point;
double profit=0; if (TakeProfit>0) profit=Preis+TakeProfit*Point;
int ticket=OrderSend(Symbol(),OP_BUYSTOP,lots,price,0,loss,profit,"",0,0,CLR_NONE);
if (ticket<1) Print("Das Setzen einer ausstehenden Bestellung ist mit Fehler #",GetLastError()," ",(GetLastError()) fehlgeschlagen;
}
void SetSellStop()
{
double lots=LotsCounting();
double price=Ask-StepStop*Point;
double loss=Preis+StepStop*Point;
double profit=0; if (TakeProfit>0) profit=price-TakeProfit*Point;
int ticket=OrderSend(Symbol(),OP_SELLSTOP,lots,price,0,loss,profit,"",0,0,CLR_NONE);
if (ticket<1) Print("Das Setzen einer ausstehenden Bestellung ist mit Fehler #",GetLastError()," ",(GetLastError()) fehlgeschlagen;
}
int TotalBuy()
{
int count=0;
for (int i=0; i<OrdersTotal(); i++)
{
if (!OrderSelect(i,SELECT_BY_POS,MODE_TRADES)) break;
if (OrderSymbol()!=Symbol()) continue;
if (OrderType()==OP_BUY) count++;
}
zurückgeben (count);
}
int TotalBuyStop()
{
int count=0;
for (int i=0; i<OrdersTotal(); i++)
{
if (!OrderSelect(i,SELECT_BY_POS,MODE_TRADES)) break;
if (OrderSymbol()!=Symbol()) continue;
if (OrderType()==OP_BUYSTOP) count++;
}
zurückgeben (count);
}
int TotalSell()
{
int count=0;
for (int i=0; i<OrdersTotal(); i++)
{
if (!OrderSelect(i,SELECT_BY_POS,MODE_TRADES)) break;
if (OrderSymbol()!=Symbol()) continue;
if (OrderType()==OP_SELL) count++;
}
zurückgeben (count);
}
int TotalSellStop()
{
int count=0;
for (int i=0; i<OrdersTotal(); i++)
{
if (!OrderSelect(i,SELECT_BY_POS,MODE_TRADES)) break;
if (OrderSymbol()!=Symbol()) continue;
if (OrderType()==OP_SELLSTOP) count++;
}
zurückgeben (count);
}
double LotsCounting()
{
Doppellose=Lose;
wenn (MoneyManagement)
{
double lotsize=MarketInfo(Symbol(),MODE_LOTSIZE);
double freemargin=AccountFreeMargin();
lots=0; if (lotsize>0) lots=NormalizeDouble((MarginPercent*freemargin/lotsize),1);
}
if (lots>10) lots=NormalizeDouble(lots,0);
wenn (Lose<0,01) Lose=0,01;
Rückgabe (Lose);
}
// Ende
Der Grund dafür, dass sie nicht geantwortet haben, liegt wahrscheinlich darin, dass die Erstellung eines solchen Indikators einfach und wahrscheinlich unnötig ist.
Leute, Hilfe! Ich kann das maximale Volumen eines zu eröffnenden Geschäfts nicht berechnen.
Max_lots ist immer Null!
Und die zweite Frage: Wie wird das LEVEL berechnet?
Danke, aber trotzdem? Oder sagen Sie mir, ob es in den Einstellungen des Terminals eine Option gibt, mit der die Stundenmarkierungen über die gesamte Länge der Zeitskala deutlicher angezeigt werden?
In einfachen Worten kann das Volumen wie folgt berechnet werden
und level = AccountEquity() / AccountFreeMargin() * 100;
und level = AccountEquity() / AccountFreeMargin() * 100;
NICHT korrekt. Diese Formel errechnet nicht die Höhe
Ja, falsch, Niveau = AccountEquity() / AccountMargin() * 100;
Ja, falsch, Niveau = AccountEquity() / AccountMargin() * 100;
Entschuldigen Sie den Patzer, aber heute ist der Tag.
=====
Und eine bedeutungslose Höhe schwingen...
Ein paar Phrasen, die von hier eingeflogen wurden...
===========
Andrei Voznesensky.