Igitt... Ich bin so dumm)))) Verstehen Sie es nicht, berühren Sie die Funktionen init(), deinit() und start() nicht umsonst. Nur so, wie es in den großen Meta-Zitaten steht))))
double hb2=iHigh(Symbol(),0,b1-1); //Balken von morgen ab dem angegebenen Datum
Könnten Sie mir bitte sagen, wie ich den gestrigen Tag aus dem angegebenen Datum setzen kann, denn double hb3=iHigh(Symbol(),0,b1+1); funktioniert nicht...
Hallo zusammen!!! Ich habe ein EA Eröffnung Aufträge gegen die Bewegung, wie zu ändern oder beraten, wo zu ändern???
Zeichenfolge GLOB_START;
int init() { GLOB_START = "@" + DoubleToStr(ID,0) + "@" + "_start"; if !GlobalVariableCheck( GLOB_START )GlobalVariableSet(GLOB_START,TimeCurrent()); zurück(0); }
int deinit() { switch( UninitializeReason() ) { case REASON_REMOVE: delete_glob ("@" + DoubleToStr(ID,0) + "@" ); } if ( IsTesting() )delete_glob ("@" + DoubleToStr(ID,0) + "@" ); zurück(0); }
void delete_glob ( string c ) { int i; for ( i = GlobalVariablesTotal()-1; i>= 0 ; i-- )if ( StringFind(GlobalVariableName(i),c) >= 0 )GlobalVariableDel(GlobalVariableName(i)) }
int start() { Kommentar(Info()); int KOL_BUY = order_total(0); int KOL_SELL = order_total(1); Doppel-L;
wenn ( Auftragssumme() == 0 ) { offen(0,Lot,0,TP); offen(1,Lot,0,TP); }
if ( KOL_BUY == 0 && KOL_SELL != 0 ) { offen(0,Lot,0,TP); l = last_trade(1); open(1,l,0,0); ändern_bestellen(1); }
if ( KOL_BUY != 0 && KOL_SELL == 0 ) { offen(1,Lot,0,TP); l = last_trade(0); open(0,l,0,0); modify_orders(0); }
zurück(0); }
string Info() { int i; double buff_1 = 0, buff_2 = 0, buff_3 = 0; string res = "\n";
for( i = OrdersHistoryTotal() - 1; i >= 0; i-- ) { OrderSelect(i,SELECT_BY_POS,MODE_HISTORY); if( OrderMagicNumber() == ID ) { if ( OrderOpenTime() >= iTime(NULL,PERIOD_D1,0) )buff_1 += OrderProfit(); if ( OrderOpenTime() >= iTime(NULL,PERIOD_D1,1) && OrderOpenTime() < iTime(NULL,PERIOD_D1,0) )buff_2 += OrderProfit(); if ( OrderOpenTime() >= GlobalVariableGet(GLOB_START) )buff_3 += OrderProfit(); } }
res = res + "Gewinn in der Einzahlungswährung für " + TimeToStr(iTime(NULL,PERIOD_D1,0)) + ": " + DoubleToStr(buff_1,0) + "\n" + "\n"; res = res + "Gewinn in Einzahlungswährung für " + TimeToStr(iTime(NULL,PERIOD_D1,1)) + ": " + DoubleToStr(buff_2,0) + "\n" + "\n"; res = res + "Gewinn in der Einzahlungswährung insgesamt:" + DoubleToStr(buff_3,0) + "\n"; return(res); }
void modify_orders( int type ) { int i; datetime time_last = 0, time_first = TimeCurrent(); double SPREAD = MarketInfo(Symbol(),MODE_SPREAD)*MarketInfo(Symbol(),MODE_POINT), op_pr_last, op_pr_first, level;
for( i = OrdersTotal() - 1; i >= 0; i-- ) { OrderSelect(i,SELECT_BY_POS,MODE_TRADES); if( OrderMagicNumber() == ID && OrderType() == type ) { wenn ( OrderOpenTime() > time_last ) { op_pr_last = OrderOpenPrice(); time_last = OrderOpenTime(); } if ( OrderOpenTime() < time_first ) { op_pr_first = OrderOpenPrice(); time_first = OrderOpenTime(); } } }
if ( type == 0 )level = op_pr_last + MathAbs(op_pr_last-op_pr_first) * (SL/100); if ( type == 1 )level = op_pr_last - MathAbs(op_pr_last-op_pr_first) * (SL/100);
for( i = OrdersTotal() - 1; i >= 0; i -- ) { OrderSelect(i,SELECT_BY_POS,MODE_TRADES); if( OrderMagicNumber() == ID && OrderType() == type && NormalizeDouble(OrderTakeProfit(),Digits) != NormalizeDouble(level,Digits) )OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),level,0) } }
double last_trade( int t ) { int i; double res = -1; datetime time=0;
for(i=BestellungenGesamt()-1;i>=0;i--) { OrderSelect(i,SELECT_BY_POS,MODE_TRADES); if(OrderOpenTime()>time && OrderMagicNumber()==ID && OrderType() == t) { res = OrderLots(); time = OrderOpenTime(); } } if ( Multiplikator )return(res * Lot_koeff); if ( !Multiplikator )return(res + Lot_koeff); } int open(int type, double l, double sl=0, double tp=0, string comm = "") { int isOpened = 0, try = 0; double s,t; while ( IsTradeContextBusy() ){Sleep(500);} RefreshRates(); if ( sl != 0 && sl < MarketInfo(Symbol(),MODE_STOPLEVEL) )sl = MarketInfo(Symbol(),MODE_STOPLEVEL); if ( tp != 0 && tp < MarketInfo(Symbol(),MODE_STOPLEVEL) )tp = MarketInfo(Symbol(),MODE_STOPLEVEL); wenn ( Typ == 0 ) { wenn ( tp == 0 )t = 0; if ( tp != 0 )t = Ask + tp * Point; wenn ( sl == 0 )s = 0; if ( sl != 0 )s = Bid - sl * Point; } wenn ( Typ == 1 ) { wenn ( tp == 0 )t = 0; if ( tp != 0 )t = Bid - tp * Point; wenn ( sl == 0 )s = 0; if ( sl != 0 )s = Ask + sl * Point; } s = NormalizeDouble(s,Digits); t = NormalizeDouble(t,Digits); if(type==0)isOpened = OrderSend(Symbol(),type,check_lot(l),NormalizeDouble(Ask,Digits),10,s,t,comm,ID); if(type==1)isOpened = OrderSend(Symbol(),type,check_lot(l),NormalizeDouble(Bid,Digits),10,s,t,comm,ID); Schlaf(500); while(isOpened<0) { while ( IsTradeContextBusy() ){Sleep(500);} RefreshRates(); wenn ( Typ == 0 ) { wenn ( tp == 0 )t = 0; if ( tp != 0 )t = Bid + tp * Point; wenn ( sl == 0 )s = 0; if ( sl != 0 )s = Bid - sl * Point; } wenn ( Typ == 1 ) { wenn ( tp == 0 )t = 0; if ( tp != 0 )t = Ask - tp * Point; wenn ( sl == 0 )s = 0; if ( sl != 0 )s = Ask + sl * Point; } s = NormalizeDouble(s,Digits); t = NormalizeDouble(t,Digits); versuchen++; if(type==0)isOpened = OrderSend(Symbol(),type,check_lot(l),NormalizeDouble(Ask,Digits),10,s,t,comm,ID); if(type==1)isOpened = OrderSend(Symbol(),type,check_lot(l),NormalizeDouble(Bid,Digits),10,s,t,comm,ID); if(try > 5) break; if(isOpened>=0)break; Schlaf(500); } if(isOpened<0) Alert("Auftrag nicht geöffnet, Fehler:", GetLastError()); return(isOpened); }
int order_total( int type_1 = -1, int type_2 = -1 ) { int i; int kol=0; for(i=BestellungenGesamt()-1;i>=0;i--) { OrderSelect(i,SELECT_BY_POS,MODE_TRADES); if(OrderMagicNumber()==ID && (OrderType() == type_1 || OrderType() == type_2) )kol++; if(OrderMagicNumber()==ID && type_1 == -1 && type_2 == -1 )kol++; } zurück(kol); }
double check_lot(double &lo) { double l = MarketInfo(Symbol(),MODE_LOTSTEP); int ok = 0; while ( l < 1 ){l*=10;ok++;} if( lo < MarketInfo(Symbol(),MODE_MINLOT) )lo = MarketInfo(Symbol(),MODE_MINLOT); if( lo > MarketInfo(Symbol(),MODE_MAXLOT) )lo = MarketInfo(Symbol(),MODE_MAXLOT); return(NormalizeDouble(lo,ok));
Einen guten Tag an alle. Meine Herren, ich habe eine Frage, bitte klären Sie mich auf, wenn ich mit Alpari und Master_Forex arbeite, teste ich einen Expert Advisor auf den Geschichten, die ich von meinem Arbeitsterminal herunterlade, nichts von außen, keine linken Geschichten, wie von Dukas, keine Hilfsprogramme wie Tick Data Suite, nur 90% Modellierung vom Terminal meines DS speziell Alpari oder Master_Forex, Methode ........ Ich teste ein halbes Jahr auf verschiedene Bedingungen und Parameter, wählen Sie die beste, dann wieder testen und das nächste halbe Jahr, so 2-5 Jahre dann alles in den Stapel und die Eule ist bereit. Kann das ein zuverlässiger Prepper sein oder braucht er noch 99% und alles, was daran hängt.
Ich habe im Forum gefunden, dass dies möglich ist: https://www.mql5.com/ru/forum/141467
Und wo kann ich einen Tick-Emulator finden?
Es ist also nicht möglich, die Tick-Emulation an Wochenenden mit MQL4 zu implementieren?
Nur auf dieser Seite, deren Link Sie in Ihrem Beitrag angegeben haben. Lesen Sie es dort genauer.
Ja, ich war dumm. Ich muss nur start(); zusätzlich über init(){} starten...
int init(){start();}
...
void start(){...}
Danke, ich habe es herausgefunden.
Wie kann ich meine Boni gegen Geld eintauschen?
Wessen Boni?
Ich habe den folgenden Code:
extern datetime start = D'2013.10.17 23:59';
int start()
{
int b1=iBarShift(Symbol(),0,start,0);
double hb=iHigh(Symbol(),0,b1); //Balken
double hb2=iHigh(Symbol(),0,b1-1); //Balken von morgen ab dem angegebenen Datum
Könnten Sie mir bitte sagen, wie ich den gestrigen Tag aus dem angegebenen Datum setzen kann, denn double hb3=iHigh(Symbol(),0,b1+1); funktioniert nicht...
Hallo zusammen!!! Ich habe ein EA Eröffnung Aufträge gegen die Bewegung, wie zu ändern oder beraten, wo zu ändern???
Zeichenfolge GLOB_START;
int init()
{
GLOB_START = "@" + DoubleToStr(ID,0) + "@" + "_start";
if !GlobalVariableCheck( GLOB_START )GlobalVariableSet(GLOB_START,TimeCurrent());
zurück(0);
}
int deinit()
{
switch( UninitializeReason() )
{
case REASON_REMOVE: delete_glob ("@" + DoubleToStr(ID,0) + "@" );
}
if ( IsTesting() )delete_glob ("@" + DoubleToStr(ID,0) + "@" );
zurück(0);
}
void delete_glob ( string c )
{
int i;
for ( i = GlobalVariablesTotal()-1; i>= 0 ; i-- )if ( StringFind(GlobalVariableName(i),c) >= 0 )GlobalVariableDel(GlobalVariableName(i))
}
int start()
{
Kommentar(Info());
int KOL_BUY = order_total(0);
int KOL_SELL = order_total(1);
Doppel-L;
wenn ( Auftragssumme() == 0 )
{
offen(0,Lot,0,TP);
offen(1,Lot,0,TP);
}
if ( KOL_BUY == 0 && KOL_SELL != 0 )
{
offen(0,Lot,0,TP);
l = last_trade(1);
open(1,l,0,0);
ändern_bestellen(1);
}
if ( KOL_BUY != 0 && KOL_SELL == 0 )
{
offen(1,Lot,0,TP);
l = last_trade(0);
open(0,l,0,0);
modify_orders(0);
}
zurück(0);
}
string Info()
{
int i;
double buff_1 = 0, buff_2 = 0, buff_3 = 0;
string res = "\n";
for( i = OrdersHistoryTotal() - 1; i >= 0; i-- )
{
OrderSelect(i,SELECT_BY_POS,MODE_HISTORY);
if( OrderMagicNumber() == ID )
{
if ( OrderOpenTime() >= iTime(NULL,PERIOD_D1,0) )buff_1 += OrderProfit();
if ( OrderOpenTime() >= iTime(NULL,PERIOD_D1,1) && OrderOpenTime() < iTime(NULL,PERIOD_D1,0) )buff_2 += OrderProfit();
if ( OrderOpenTime() >= GlobalVariableGet(GLOB_START) )buff_3 += OrderProfit();
}
}
res = res + "Gewinn in der Einzahlungswährung für " + TimeToStr(iTime(NULL,PERIOD_D1,0)) + ": " + DoubleToStr(buff_1,0) + "\n" + "\n";
res = res + "Gewinn in Einzahlungswährung für " + TimeToStr(iTime(NULL,PERIOD_D1,1)) + ": " + DoubleToStr(buff_2,0) + "\n" + "\n";
res = res + "Gewinn in der Einzahlungswährung insgesamt:" + DoubleToStr(buff_3,0) + "\n";
return(res);
}
void modify_orders( int type )
{
int i;
datetime time_last = 0, time_first = TimeCurrent();
double SPREAD = MarketInfo(Symbol(),MODE_SPREAD)*MarketInfo(Symbol(),MODE_POINT), op_pr_last, op_pr_first, level;
for( i = OrdersTotal() - 1; i >= 0; i-- )
{
OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
if( OrderMagicNumber() == ID && OrderType() == type )
{
wenn ( OrderOpenTime() > time_last )
{
op_pr_last = OrderOpenPrice();
time_last = OrderOpenTime();
}
if ( OrderOpenTime() < time_first )
{
op_pr_first = OrderOpenPrice();
time_first = OrderOpenTime();
}
}
}
if ( type == 0 )level = op_pr_last + MathAbs(op_pr_last-op_pr_first) * (SL/100);
if ( type == 1 )level = op_pr_last - MathAbs(op_pr_last-op_pr_first) * (SL/100);
for( i = OrdersTotal() - 1; i >= 0; i -- )
{
OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
if( OrderMagicNumber() == ID && OrderType() == type && NormalizeDouble(OrderTakeProfit(),Digits) != NormalizeDouble(level,Digits) )OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),level,0)
}
}
double last_trade( int t )
{
int i;
double res = -1;
datetime time=0;
for(i=BestellungenGesamt()-1;i>=0;i--)
{
OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
if(OrderOpenTime()>time && OrderMagicNumber()==ID && OrderType() == t)
{
res = OrderLots();
time = OrderOpenTime();
}
}
if ( Multiplikator )return(res * Lot_koeff);
if ( !Multiplikator )return(res + Lot_koeff);
}
int open(int type, double l, double sl=0, double tp=0, string comm = "")
{
int isOpened = 0, try = 0;
double s,t;
while ( IsTradeContextBusy() ){Sleep(500);}
RefreshRates();
if ( sl != 0 && sl < MarketInfo(Symbol(),MODE_STOPLEVEL) )sl = MarketInfo(Symbol(),MODE_STOPLEVEL);
if ( tp != 0 && tp < MarketInfo(Symbol(),MODE_STOPLEVEL) )tp = MarketInfo(Symbol(),MODE_STOPLEVEL);
wenn ( Typ == 0 )
{
wenn ( tp == 0 )t = 0;
if ( tp != 0 )t = Ask + tp * Point;
wenn ( sl == 0 )s = 0;
if ( sl != 0 )s = Bid - sl * Point;
}
wenn ( Typ == 1 )
{
wenn ( tp == 0 )t = 0;
if ( tp != 0 )t = Bid - tp * Point;
wenn ( sl == 0 )s = 0;
if ( sl != 0 )s = Ask + sl * Point;
}
s = NormalizeDouble(s,Digits);
t = NormalizeDouble(t,Digits);
if(type==0)isOpened = OrderSend(Symbol(),type,check_lot(l),NormalizeDouble(Ask,Digits),10,s,t,comm,ID);
if(type==1)isOpened = OrderSend(Symbol(),type,check_lot(l),NormalizeDouble(Bid,Digits),10,s,t,comm,ID);
Schlaf(500);
while(isOpened<0)
{
while ( IsTradeContextBusy() ){Sleep(500);}
RefreshRates();
wenn ( Typ == 0 )
{
wenn ( tp == 0 )t = 0;
if ( tp != 0 )t = Bid + tp * Point;
wenn ( sl == 0 )s = 0;
if ( sl != 0 )s = Bid - sl * Point;
}
wenn ( Typ == 1 )
{
wenn ( tp == 0 )t = 0;
if ( tp != 0 )t = Ask - tp * Point;
wenn ( sl == 0 )s = 0;
if ( sl != 0 )s = Ask + sl * Point;
}
s = NormalizeDouble(s,Digits);
t = NormalizeDouble(t,Digits);
versuchen++;
if(type==0)isOpened = OrderSend(Symbol(),type,check_lot(l),NormalizeDouble(Ask,Digits),10,s,t,comm,ID);
if(type==1)isOpened = OrderSend(Symbol(),type,check_lot(l),NormalizeDouble(Bid,Digits),10,s,t,comm,ID);
if(try > 5) break;
if(isOpened>=0)break;
Schlaf(500);
}
if(isOpened<0) Alert("Auftrag nicht geöffnet, Fehler:", GetLastError());
return(isOpened);
}
int order_total( int type_1 = -1, int type_2 = -1 )
{
int i;
int kol=0;
for(i=BestellungenGesamt()-1;i>=0;i--)
{
OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
if(OrderMagicNumber()==ID && (OrderType() == type_1 || OrderType() == type_2) )kol++;
if(OrderMagicNumber()==ID && type_1 == -1 && type_2 == -1 )kol++;
}
zurück(kol);
}
double check_lot(double &lo)
{
double l = MarketInfo(Symbol(),MODE_LOTSTEP);
int ok = 0;
while ( l < 1 ){l*=10;ok++;}
if( lo < MarketInfo(Symbol(),MODE_MINLOT) )lo = MarketInfo(Symbol(),MODE_MINLOT);
if( lo > MarketInfo(Symbol(),MODE_MAXLOT) )lo = MarketInfo(Symbol(),MODE_MAXLOT);
return(NormalizeDouble(lo,ok));
Wie kann ich einen Suchlauf für "Fonds:" (AccountEquity()) durchführen?
Parameter
extern double TrailingStart = 10000; // Schleppende Stufe
extern double TrailingStop = 100; // Schleppende Größe
extern double TrailingStep = 10; // Schleppender Schritt
Wie finde ich zwei obere/untere Fraktale in einer Reihe? Das Bild unten.
Ich habe versucht, einen Indikator zu schreiben, aber ich habe es nicht durchdacht.
Vielleicht hat jemand einen solchen Indikator schon gesehen?