Ciao a tutti
ho un codice di mia creazione che sotto il grafico mi da un indicatore con valori
1
0
-1
il valore -1 non viene analizzato dal trading system
con la funzione “graph” sullo stesso vedo solo valori 1 e 0 il -1 scompare
ripeto con il mio indicatore ho 1 / 0 / -1
#Nicolas hai qualche delucidazione?
Grazie
Si prega di caricare il codice e / o screenshot dell’indicatore per vedere cosa succede!
ciao Nicolas
come stai?
scusa del ritardo, sono stato impegnato.
ti allego lo screen del back test
l’ indicatore che uso per il back test è LS indicator 1.1, sotto al backtest c’è il risultato della funzione “graph” dello stesso LS indicator 1.1
che ho utilizzato nel codice del backtest.
Come puoi vedere il risultato della funzione graph è diverso da LS indicator 1.1 e riporta solo valori 1 mentre dovrebbero essere visualizzati anche valori -1
cosa puoi suggerirmi per risolvere?
grazie
Sto bene, grazie.
Piuttosto difficile fornire assistenza molto senza il codice della strategia. Come hai fatto a implementare le informazioni indicatore nella vostra strategia di trading? Avete copiato / incolla l’intero codice o ha utilizzato una chiamata? Ci deve essere qualcosa che hai perso da qualche parte 🙂
Ciao Nicolas come vedi sono riuscito a loggarmi.
per quanto riguarda il codice ho:
sia copiato ed incollato il codice di riferimento
sia chiamato il codice
ma il realtà in entrambi i casi ho solo valori positivi quindi 0 e 1
il valore negativo è assente
questa è la parte di calcolo del codice che mi da 1, 0 e -1
e funziona bene, poi in ProOrder invece da solo valori 1 e 0
if (o or ha or ih) = 1 and osc = -1 then
lsind = 1
ELSIF (djl or djs or bh)= 1 and osc = -1 then
lsind = 1
ELSIF (har or hr or pl)= 1 and osc = -1 then
lsind = 1
ELSIF (dcc or ds or ml)= 1 and osc = -1 then
lsind = 1
ELSIF (hp or dh or mlh)= 1 and osc = -1 then
lsind = 1
ELSIF (mar or ws or bc)= 1 and osc = -1 then
lsind = 1
ELSIF (es or ms or forc) = 1 and osc = -1 then
lsind = 1
elsif (o or ha or ih)= -1 and osc = 1 then
lsind = -1
ELSIF (djl or djs or bh)= -1 and osc = 1 then
lsind = -1
ELSIF (har or hr or pl)= -1 and osc = 1 then
lsind = -1
ELSIF (dcc or ds or ml)= -1 and osc = 1 then
lsind = -1
ELSIF (hp or dh or mlh)= -1 and osc = 1 then
lsind = -1
ELSIF (mar or ws or bc)= -1 and osc = 1 then
lsind = -1
ELSIF (es or ms or forc) = -1 and osc = 1 then
lsind = -1
else
lsind = 0
endif
return lsind
Grazie per il codice, ma non è completa, devo avere il codice completo per riprodurre lo stesso problema in ProOrder.
Ciao Nicolas a grafico processa solo valori 1
i valori -1 non li vede
//doji versione larga
dvl = Range > (ABS(Open - Close) * 5)
//condizione salita
if dvl and high < high[1] and high[1] < high[2] then
djl = 1
elsif dvl and low > low[1] and low[1] > low[2] then
djl = -1
else
djl = 0
endif
//doji 2 versione stretta
dvs = (Open = Close)
if dvs and high[1] > high and low[1] > low then
djs = 1
elsif dvs and low > low[1] and high > high[1] then
djs = -1
else
djs = 0
endif
ind = Stochastic[k,d](close)
if ind >= 70 then
osc = 1
elsif ind <= 30 then
osc = -1
else
osc = 0
endif
IF (djl or djs )= 1 and osc = -1 then
lsind = 1
ELSIF (djl or djs)= -1 and osc = 1 then
lsind = -1
else
lsind = 0
endif
C1= lsind = 1
C2= lsind = (-1)
//COMANDO LONG
L= HIGH+(5*PIPSIZE)
POS=COUNTOFPOSITION
IF C1 THEN
BUY 3 SHARES AT L LIMIT
RANG= HIGH[1]-LOW[1]
ENDIF
IF LONGONMARKET THEN
SELL 1 shares AT TRADEPRICE+RANG*PIPSIZE LIMIT
//SEll AT LOW-5*PIPSIZE STOP//stop loss
ENDIF
IF LONGONMARKET AND POS=2 THEN
SELL 2 shares AT TRADEPRICE+RANg*PIPSIZE*2 LIMIT
ENDIF
//COMANDO SHORT
S= LOW-(5*PIPSIZE)
IF C2 THEN
SELLSHORT 3 SHARES AT S LIMIT
RANG= HIGH[1]-LOW[1]
ENDIF
IF SHORTONMARKET THEN
EXITSHORT 1 shares AT TRADEPRICE-RANG*PIPSIZE LIMIT
SEll AT HIGH+5*PIPSIZE STOP//stop loss
ENDIF
IF SHORTONMARKET AND POS=2 THEN
SELL AT TRADEPRICE-RANg*PIPSIZE*2 LIMIT
ENDIF
// Stop e target: Inserisci qui i tuoi stop di protezione e profit target
SET STOP PLOSS LS
BUON 2017 A TUTTI
Nicolas potresti aiutarmi?
nessuna possibilità di implementare i -1 nella logica di prorealtime?
DANYParticipant
Senior
ciao,
devi modificare le righe 30 e 34 in questo modo:
IF (djl=1 OR djs= 1) and osc = -1 then
lsind = 1
ELSIF (djl=-1 or djs=-1) and osc=1 then
lsind = -1
se poi serve una mano per altre cose e vogliamo sentirci in privato per condividere qualche idea fammi sapere.
Ciao.
ciao grazie ora calcola perfettamente
ok per sentirci in privato
xxxxxxx@gmail.com
EDIT: Do not give your email address on forums please. (Nicolas).