Aiuto per la codifica - pagina 299

 
mladen:
AZRUL

Posizionare questo :

static datetime lastUpdated = 0; if ((TimeCurrent()-lastUpdated) < PERIOD_M5*60) return(0); lastUpdated=TimeCurrent();

come prima linea della procedura di avvio e il resto del codice della procedura di avvio sarà eseguito con almeno 5 minuti di ritardo tra due esecuzioni consecutive

Caro SIR MLADEN,

Proverò a mettere questi codici SOLO....

Grazie MOLTO2 per il tuo tempo e la tua competenza.... 5° crediti

Sinceramente vostro

AZRUL...

 

Se compilo questo codice mentre uso "strict" ottengo"array out of range".

if (RSI4 > RSI1 && RSI4 < RSI1) drawArrow(i,Aqua,233,false);

if (RSI4 RSI1) drawArrow(i,Tomato,234,true);

[/PHP]

This works with no errors but of course there are arrows on every candle

if (RSI4 > RSI1 ) drawArrow(i,Aqua,233,false);

if (RSI4 < RSI1 ) drawArrow(i,Tomato,234,true);

This appears to be the problem as soon as the +1 is added.

[PHP]RSI4 > RSI1

C'è una correzione per questo?

 
cja:
Se compilo questo codice mentre uso "strict" ottengo "array out of range"

if (RSI4 > RSI1 && RSI4 < RSI1) drawArrow(i,Aqua,233,false);

if (RSI4 RSI1) drawArrow(i,Tomato,234,true);

[/PHP]

This works with no errors but of course there are arrows on every candle

if (RSI4 > RSI1 ) drawArrow(i,Aqua,233,false);

if (RSI4 < RSI1 ) drawArrow(i,Tomato,234,true);

[/PHP]

This appears to be the problem as soon as the +1 is added.

[PHP]RSI4 > RSI1
Is there a fix for this?

cja

Prova così :

[PHP]se(i<(Bars-1))

{

se (RSI4 > RSI1 && RSI4 < RSI1) drawArrow(i,Aqua,233,false);

if (RSI4 RSI1) drawArrow(i,Tomato,234,true);

}

e dovrebbe funzionare

 

Ciao, ho un problema con un indicatore fibonacci, vorrei usarlo sullo stesso grafico a 1440 e 2280, come in questa immagine:

(Ecco perché ho creato manualmente)

Il problema è che ho creato una seconda versione dell'indicatore a 2 giorni ma quando lo inserisco sullo stesso grafico dove ho l'indicatore in versione 1440 automaticamente non vedo più le linee in 1440. Spero di risolvere con il vostro aiuto!

 
dany84:
Ciao, ho un problema con un indicatore fibonacci, vorrei usarlo sullo stesso grafico a 1440 e 2280, come in questa immagine:

(Ecco perché ho creato manualmente)

Il problema è che ho creato una seconda versione dell'indicatore a 2 giorni ma quando lo inserisco sullo stesso grafico dove ho l'indicatore in versione 1440 automaticamente non vedo più le linee in 1440. Spero di risolvere con il vostro aiuto!

dany84

Provalo ora: fibo_v9_1.mq4

Imposta il parametro UniqueID su un valore unico per ogni nuova istanza dell'indicatore e poi puoi avere tutte le istanze che vuoi

File:
fibo_v9_1.mq4  6 kb
 
mladen:
dany84

Provalo ora: fibo_v9_1.mq4

Imposta il parametro UniqueID su un valore unico per ogni nuova istanza dell'indicatore e poi puoi avere tutte le istanze che vuoi

Grazie Mladen, ora funziona bene!

 

Strano errore!!!

I have the following string: " 99.40 "

double TakeProfit = StrToDouble("99.40");

Print("TakeProfit =", TakeProfit);

Print("or TakeProfit = ", NormalizeDouble(TakeProfit,2);

E questo è l'output:

TakeProfit =99.40000000000001

o TakeProfit = 99.40000000000001

Qualcuno può spiegarmi questo strano errore e cosa posso fare contro di esso?

Grazie!

 
sunshineh:
Strano errore!!!

I have the following string: " 99.40 "

double TakeProfit = StrToDouble("99.40");

Print("TakeProfit =", TakeProfit);

Print("or TakeProfit = ", NormalizeDouble(TakeProfit,2);

E questo è l'output:

TakeProfit =99.40000000000001

o TakeProfit = 99.40000000000001

Qualcuno può spiegarmi questo strano errore e cosa posso fare contro di esso?

Grazie!

sunshineh

Come hai ottenuto la parte "0000000000001" con la stampa?

Sto ottenendo questo quando uso quel codice:

File:
pribt.gif  21 kb
 

Ciao,

questa è la stampa dei messaggi di due diversi conti Metatrader:

 
sunshineh:
Ciao,

Questa è la stampa dei messaggi di due diversi conti Metatrader:

Probabilmente la build

Ho usato la build 660 per testarlo

Motivazione: