hi,
I’m trying a strategy in which I want to fix the number of trades per each day.
I’ve found the OTD of Roberto but it is limited to only a trade per day.
I’d like to have a flexible snippet in which I put the number I’ve chosen.
Is there any snippet available?
Thanks in advance
Hi! you should create a variable to control the number of trades.
For example “n”:
ema20=average[20,1](close)
//if intradaybarindex=0 then
//n=0
//endif
if close>ema20 and n<4 then
n=n+1
buy 1 contract at market
endif
if time>160000 then
sell at market
n=0
endif
You can restart after close the position or when intradaybarindex is cero.
Many thanks IVAN.
it’s working.
Would you be so kind to help me again. I just wrote in the italian forum and I’m in trouble with a strategy that involves 2 weeks.
Cheers