Qualsiasi domanda da principiante, per non ingombrare il forum. Professionisti, non passate oltre. Da nessuna parte senza di te - 6. - pagina 221
Ti stai perdendo delle opportunità di trading:
- App di trading gratuite
- Oltre 8.000 segnali per il copy trading
- Notizie economiche per esplorare i mercati finanziari
Registrazione
Accedi
Accetti la politica del sito e le condizioni d’uso
Se non hai un account, registrati
Ho trovato sul forum che questo è possibile: https://www.mql5.com/ru/forum/141467
E dove posso trovare un emulatore di tick?
Quindi non è possibile implementare l'emulazione di tick nei fine settimana con MQL4??
Proprio su quella pagina, il cui link hai inserito nel tuo post. Leggete lì con più attenzione.
Sì, sono stato stupido. Ho solo bisogno di avviare(); avviare inoltre tramite init(){}...
int init(){start();}
...
void start(){...}
Grazie, l'ho capito.
Come posso riscattare i miei bonus in denaro?
I bonus di chi?
Ho il seguente codice:
extern datetime start = D'2013.10.17 23:59';
int start()
{
int b1=iBarShift(Symbol(),0,start,0);
double hb=iHigh(Symbol(),0,b1); //barra
double hb2=iHigh(Symbol(),0,b1-1); //barra di domani dalla data specificata
Potreste dirmi come mettere il giorno di ieri dalla data specificata, perché double hb3=iHigh(Symbol(),0,b1+1); non funziona...
Ciao a tutti!!! Ho un EA che apre ordini contro il movimento, come cambiare o consigliare dove cambiare?
stringa GLOB_START;
int init()
{
GLOB_START = "@" + DoubleToStr(ID,0) + "@" + "_start";
if !GlobalVariableCheck( GLOB_START )GlobalVariableSet(GLOB_START,TimeCurrent());
ritorno(0);
}
int deinit()
{
switch( UninitializeReason() )
{
caso REASON_REMOVE: delete_glob ("@" + DoubleToStr(ID,0) + "@" );
}
if ( IsTesting() )delete_glob ("@" + DoubleToStr(ID,0) + "@" );
ritorno(0);
}
void delete_glob ( stringa c )
{
int i;
for ( i = GlobalVariablesTotal()-1; i>= 0 ; i-- )if ( StringFind(GlobalVariableName(i),c) >= 0 )GlobalVariableDel(GlobalVariableName(i))
}
int start()
{
Commento(Info());
int KOL_BUY = order_total(0);
int KOL_SELL = order_total(1);
doppia l;
se ( order_total() == 0 )
{
aperto(0,Lot,0,TP);
aperto(1,Lotto,0,TP);
}
if ( KOL_BUY == 0 && KOL_SELL != 0 )
{
aperto(0,Lot,0,TP);
l = last_trade(1);
aperto(1,l,0,0);
modifica_ordini(1);
}
if ( KOL_BUY != 0 && KOL_SELL == 0 )
{
aperto(1,Lot,0,TP);
l = last_trade(0);
aperto(0,l,0,0);
modifica_ordini(0);
}
ritorno(0);
}
stringa Info()
{
int i;
doppio buff_1 = 0, buff_2 = 0, buff_3 = 0;
stringa res = "\n";
for( i = OrdersHistoryTotal() - 1; i >= 0; i-- )
{
OrderSelect(i,SELECT_BY_POS,MODE_HISTORY);
if( OrderMagicNumber() == ID )
{
se ( 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 + "Profitto nella valuta di deposito per " + TimeToStr(iTime(NULL,PERIOD_D1,0)) + ": " + DoubleToStr(buff_1,0) + "\n" + "\n";
res = res + "Profitto nella valuta di deposito per " + TimeToStr(iTime(NULL,PERIOD_D1,1)) + ": " + DoubleToStr(buff_2,0) + "\n" + "\n";
res = res + "Profitto nella valuta di deposito totale:" + 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 = OrdiniTotali() - 1; i >= 0; i-- )
{
OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
if( OrderMagicNumber() == ID && OrderType() == tipo )
{
se ( OrderOpenTime() > time_last )
{
op_pr_last = OrderOpenPrice();
time_last = OrderOpenTime();
}
se ( OrderOpenTime() < time_first )
{
op_pr_first = OrderOpenPrice();
time_first = OrderOpenTime();
}
}
}
se ( tipo == 0 )livello = op_pr_last + MathAbs(op_pr_last-op_pr_first) * (SL/100);
se ( tipo == 1 )livello = op_pr_last - MathAbs(op_pr_last-op_pr_first) * (SL/100);
for( i = OrdiniTotali() - 1; i >= 0; i -- )
{
OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
if( OrderMagicNumber() == ID && OrderType() == tipo && NormalizeDouble(OrderTakeProfit(),Digits) != NormalizeDouble(level,Digits) )OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),level,0)
}
}
double last_trade( int t )
{
int i;
doppio res = -1;
datetime time=0;
for(i=OrdiniTotali()-1;i>=0;i--)
{
OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
if(OrderOpenTime()>time && OrderMagicNumber()==ID && OrderType() == t)
{
res = OrderLots();
time = OrderOpenTime();
}
}
se ( moltiplicatore )ritorna(res * Lot_koeff);
se ( !moltiplicatore )ritorno(res + Lot_koeff);
}
int open(int type, double l, double sl=0, double tp=0, string comm = "")
{
int isOpened = 0, try = 0;
doppio 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);
se ( tipo == 0 )
{
se ( tp == 0 )t = 0;
if ( tp != 0 )t = Ask + tp * Point;
se ( sl == 0 )s = 0;
se ( sl != 0 )s = Bid - sl * Point;
}
se ( tipo == 1 )
{
se ( tp == 0 )t = 0;
if ( tp != 0 )t = Bid - tp * Point;
se ( sl == 0 )s = 0;
se ( 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);
Dormire(500);
mentre(isOpened<0)
{
while ( IsTradeContextBusy() ){Sleep(500);}
RefreshRates();
se ( tipo == 0 )
{
se ( tp == 0 )t = 0;
if ( tp != 0 )t = Bid + tp * Point;
se ( sl == 0 )s = 0;
se ( sl != 0 )s = Bid - sl * Point;
}
se ( tipo == 1 )
{
se ( tp == 0 )t = 0;
if ( tp != 0 )t = Ask - tp * Point;
se ( sl == 0 )s = 0;
se ( sl != 0 )s = Ask + sl * Point;
}
s = NormalizeDouble(s,Digits);
t = NormalizeDouble(t,Digits);
prova++;
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;
Dormire(500);
}
if(isOpened<0) Alert("Ordine non aperto, errore :", GetLastError());
return(isOpened);
}
int order_total( int type_1 = -1, int type_2 = -1 )
{
int i;
int kol=0;
for(i=OrdiniTotali()-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++;
}
ritorno(kol);
}
doppio check_lot(doppio &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));
Come posso fare una ricerca per "Fondi:" (AccountEquity())?
Parametri
extern double TrailingStart = 10000; // livello di trailing
extern double TrailingStop = 100; // Trailing size
extern double TrailingStep = 10; // passo di trascinamento
Come faccio a trovare due frattali in alto/basso in una fila? L'immagine qui sotto.
Ho cercato di scrivere un indicatore, ma non ci ho pensato bene.
Forse qualcuno ha visto un tale indicatore pronto?