Evidenzia le candele errate, con ben evidente data ed ora di ciascuna.
Stò iniziando a capire il codice e ho apportato alcune modifiche,non capisco però questa variabile per poterla settare
HigherHIGHs = (summation[CandleNum – 1](high > high[1]) = (CandleNum – 1))
il viceversa
LowerLOWs = (summation[CandleNum – 1](low < low[1]) = (CandleNum – 1))
Grazie roberto della disponibilità
Servono a verificare che per N candele consecutive, in tal caso CANDLENUM-1, vi siano stati massimi crescenti o minimi crescenti.
Si toglie 1 da CANDLENUM perché fa il confronto tra il massimo/minimo corrente e quello precedente, quindi per confrontare, ad esempio, 5 massimi/minimi, SUMMATION deve fare 4 confronti, non 5.
Non ne vengo a capo può backtestare per favore il sistema e dirmi perchè salta cosi tante possibilità di trade anche nelle linee di trend definite e consistenti?
Indicamene 2-3 saltate, con data ed ora precise di quando avrebbe dovuto entrare e non l’ha fatto.
meroledì 21 ore 9 trend al rialzo di 130 pips…. nessuna entrata long
giovedì 22 ore 9 trend al rialzo di 90 pips…. nessuna entrata long
questi sono due esempi grossi ma di meno consistenti ce ne sono tanti
Rispetto al tuo post del 18 Agosto hai invertito la definizione:
Bullish = summation[CandleNum](close < open) = CandleNum
Bearish = summation[CandleNum](close > open) = CandleNum
perché? Come hai fatto con il Copia e Incolla?
In pratica BULLISH è vero dopo CANDLENUM candele rosse (e viceversa per BEARISH)!!!
In ogni caso, il 21/8 alle 9 non c’erano le condizioni, che invece c’erano, ed è entrato con le dovute correzioni, alle 9:03. Anche il 22/8 alle 9 non c’erano le condizioni.
Le ho ritoccate a mano….mi sembravano al contrario ora le ho riguardate
|
|
Bullish = summation[CandleNum](close < open) = CandleNum
|
variabile bullish è ugale alla somma di 3 candele la cui chiusura è minore dell apertura…..ho sbagliato era giusta prima.
Tu che condizioni aggiungeresti per beccare quei due trade?
Non puoi mettere una condizione ad hoc per beccarli, perché non si ripeteranno mai più in quelle stesse sequenze.
Premesso che non puoi beccarli tutti, devi trovare una conformazione di candele, se vuoi usare solo la price action, che prenda la maggior parte delle operazioni e sia profittevole.
Altrimenti devi ricorrere ad indicatori vari, magari al supporto Multi Time Frame che ti consente di vedere i segnali su vari TF per avere maggiori conferme.
Capisco,ma se volessi aggiungere un’altro tipo di entrata a mercato ad esempio
Se ho una candela singola che si sviluppa in 20 pips entra a mercato si potrebbe integrare,per lo meno stavo leggendo che si possono mettere più condizioni per entrare a mercato
Per entrare a mercato puoi mettere anche 10 o più condizioni, collegandole con AND oppure OR.
Esempio:
c1 = summation[5](high > high[1] AND close > open) //5 candele rialziste e 3 volte con Massimi crescenti
c2 = Rsi[14](close) > 70 //Rsi in ipercomprato
IF c1 AND c2 THEN
sell 1 contract at market //vendi in previsione di un ritracciamento
set target pprofit 50
set stop ploss 20
ENDIF
devi stabilire te le condizioni di entrata e di uscita.
ONCE CandleNum = C
Bullish = summation[CandleNum](close > open) = CandleNum
Bearish = summation[CandleNum](close < open) = CandleNum
HigherHIGHs = (summation[CandleNum - 1](high > high[1]) = (CandleNum - 1))
LowerLOWs = (summation[CandleNum - 1](low < low[1]) = (CandleNum - 1))
IF Bearish AND LowerLOWs AND Not OnMarket THEN
BUY 1 CONTRACT AT MARKET
Sl = max(S,(close - low) / pipsize)
Tp = Sl * M
ENDIF
IF Bullish AND HigherHIGHs AND Not OnMarket THEN
SELLSHORT 1 CONTRACT AT MARKET
Sl = max(S,(high - close) / pipsize)
Tp = Sl * M
ENDIF
SET STOP pLOSS Sl
SET TARGET pPROFIT Tp
//trailing stop
trailingstop = T
//resetting variables when no trades are on market
if not onmarket then
MAXPRICE = 0
MINPRICE = close
priceexit = 0
endif
//case SHORT order
if shortonmarket then
MINPRICE = MIN(MINPRICE,close) //saving the MFE of the current trade
if tradeprice(1)-MINPRICE>=trailingstop*pointsize then //if the MFE is higher than the trailingstop then
priceexit = MINPRICE+trailingstop*pointsize //set the exit price at the MFE + trailing stop price level
endif
endif
//case LONG order
if longonmarket then
MAXPRICE = MAX(MAXPRICE,close) //saving the MFE of the current trade
if MAXPRICE-tradeprice(1)>=trailingstop*pointsize then //if the MFE is higher than the trailingstop then
priceexit = MAXPRICE-trailingstop*pointsize //set the exit price at the MFE - trailing stop price level
endif
endif
//exit on trailing stop price levels
if onmarket and priceexit>0 then
EXITSHORT AT priceexit STOP
SELL AT priceexit STOP
endif
Grazie Roberto ma le variabili che di cui mi hai fatto esempio non riesco a inserirle ne codice sopra….mi faresti cortesemente un esempio di inserimento?
Tu hai già delle condizioni di entrata, non ha molto senso metterci quelle, al limite quella del RSI, l’altra no perché hai già una verifica delle candele.
ONCE CandleNum = 3
Bullish = summation[CandleNum](close > open) = CandleNum
Bearish = summation[CandleNum](close < open) = CandleNum
HigherHIGHs = (summation[CandleNum - 1](high > high[1]) = (CandleNum - 1))
LowerLOWs = (summation[CandleNum - 1](low < low[1]) = (CandleNum - 1))
MyRsi = Rsi[14](close)
IF Bearish AND LowerLOWs AND Not OnMarket AND MyRsi > 30 THEN
BUY 1 CONTRACT AT MARKET
Sl = max(S,(close - low) / pipsize)
Tp = Sl * M
ENDIF
IF Bullish AND HigherHIGHs AND Not OnMarket AND MyRsi < 70 THEN
SELLSHORT 1 CONTRACT AT MARKET
Sl = max(S,(high - close) / pipsize)
Tp = Sl * M
ENDIF
SET STOP pLOSS Sl
SET TARGET pPROFIT Tp
//trailing stop
trailingstop = T
//resetting variables when no trades are on market
if not onmarket then
MAXPRICE = 0
MINPRICE = close
priceexit = 0
endif
//case SHORT order
if shortonmarket then
MINPRICE = MIN(MINPRICE,close) //saving the MFE of the current trade
if tradeprice(1)-MINPRICE>=trailingstop*pointsize then //if the MFE is higher than the trailingstop then
priceexit = MINPRICE+trailingstop*pointsize //set the exit price at the MFE + trailing stop price level
endif
endif
//case LONG order
if longonmarket then
MAXPRICE = MAX(MAXPRICE,close) //saving the MFE of the current trade
if MAXPRICE-tradeprice(1)>=trailingstop*pointsize then //if the MFE is higher than the trailingstop then
priceexit = MAXPRICE-trailingstop*pointsize //set the exit price at the MFE - trailing stop price level
endif
endif
//exit on trailing stop price levels
if onmarket and priceexit>0 then
EXITSHORT AT priceexit STOP
SELL AT priceexit STOP
endif
Non l’ho provato.
ho scaricato i manuali e stò iniziando a studiarli…..
non sò se si possa fare nel forum al limite me lo dite e lo cancello,Roberto lei può scrivere un codice personalizzato a pagamento?
nel caso le lascio la mia mail XXXXXXXXX
io per scriverne uno mio ci metterò un bel pò di tempo nel frattempo ne vorrei iniziare a utilizzare uno.
Ho cancellato l’email perché è vietato pubblicare riferimenti personali.
Per contattare qualcuno occorre chiedere il permesso all’admin tramite i contatti.
Per la programmazione a pagamento segui questo link https://www.prorealcode.com/trading-programming-services/