HI Paris, thanks for your comment.
In fact, yes , the system work with other indices/currency pair.
I’m not sure I’d like to share all my systems, but I encourage you in trying some variation on the same theme on EURUSD and on AUDJPY.
Good luck and enjoy 🙂
@ francesco .
well in fact i ve tried to backtest it in various indices/currency with no satisfying results , but maybe i ve made it wrong .
to all ,
i encourage you to backtest a variable in stop loss 10 to 200 it improve quite a bit the results .
Francesco sto cercando di fare il codice anche con metatrader per confrontare i risultati . Non avendo con OIL uno storico decente ti chiedo se hai su qualche valuta un settaggio che mi permette di fare un test decente. Grazie. Mik
EDIT BY ADMIN : LAST WARNING : STOP ITALIAN IN ENGLISH FORUM! A LITTLE POLITICAL TO OTHER MEMBERS !!
hi, something decent I could find on AUDJPY 15 min and EURUSD 10 min. But with some tweak..
About the zero division error, I would suggest:
hammerupnegated= max(open,close)<min(open[1],close[1]) and (abs(open-close)/max(pointsize,HiLo))>0.5
Hi all,
I had a BUY triggered this am (0350) @ 4657 . Did anyone else see this? Checking the candle I don’t see a Hammer down at 0330, almost but not quite and backtesting the data does not trigger a BUY. Any ideas why this might have happened? If the auto trading used the “worse” case of bid / ask it might suffice a hammer but why wld that happen? if using all Mids or all Bids (or all asks) there is not a 33% hammer.
The code used is as per the OP with a zero divide adjustment (although i don’t think this is related to the Zero div issue).
Thanks
the systeme with *1 or +0.000001 is not good.
i try with hilo……
Juan and Nicolas fix did work. I started both and they both worked today.. athleast on the long trade.
About what Carras explains: Had a longtrade today with profit( juans fix and nicolas fix code) but the backtest showes no trades?
Good evening at all.
I have no business since July 7 in demo and real.
Can you post a full code that works?
Thanks and good job
This is the one I use (nicolas fix) I also run juans fix that did just the same as thisone today.
defparam cumulateorders = true
av1 = average[3](close)
av2 = average[20](close)
av3 = average[50](close)
//x = 0.5
bull = close> av1 and close >av2 and close > av3
bear = close <av1 and close <av2 and close <av3
//n= 1
If (high-low) = 0 Then
HiLo = 1
Else
HiLo = (high-low)
EndIf
hammerupnegated= max(open,close)<min(open[1],close[1]) and (abs(open-close)/max(pointsize,HiLo))>0.5
hammerup = min(open[1],close[1])>high[1]-(high[1]-low[1])/3 //and timeok
hammerupnegated= max(open,close)<min(open[1],close[1]) and (abs(open-close)/max(pointsize,HiLo))>0.5
cs = hammerup and hammerupnegated and bear
hammerdown = max(open[1],close[1])<low[1]+(high[1]-low[1])/3 //and timeok
hammerdownnegated = min(open,close)>max(open[1],close[1]) and (abs(open-close)/max(pointsize,HiLo))>0.5
cl = hammerdown and hammerdownnegated and bull
if cs and not onmarket then
sellshort 1 contract at market
endif
if cl and not onmarket then
buy 1 contract at market
endif
//TRAILING STOP
TGL =30
TGS= 20
if not onmarket then
MAXPRICE = 0
MINPRICE = close
PREZZOUSCITA = 0
ENDIF
if longonmarket then
MAXPRICE = MAX(MAXPRICE,close)
if MAXPRICE-tradeprice(1)>=TGL*pointsize then
PREZZOUSCITA = MAXPRICE-TGL*pointsize
ENDIF
ENDIF
if shortonmarket then
MINPRICE = MIN(MINPRICE,close)
if tradeprice(1)-MINPRICE>=TGS*pointsize then
PREZZOUSCITA = MINPRICE+TGS*pointsize
ENDIF
ENDIF
if onmarket and PREZZOUSCITA>0 then
EXITSHORT AT PREZZOUSCITA STOP
SELL AT PREZZOUSCITA STOP
ENDIF
SET STOP ploss 110
SET TARGET pPROFIT 52
hello ! work fine for me, thanks for strategy and for fix !
The first ok in profit.
go on …
thanks
For now 3 winners on 3 trade.
Can do better with a trailing Profit. Trailing stop I think that’s fine. What do you think if you’re also talking about this?
Very interesting strategy Francesco. Thank you for sharing. I must take a closer look at this one!