Hi
Another question to you faboulous programmers ;>)
I want a buy/sell signal when my SMA moves under certain conditions
// Conditions to enter long positions
indicator1 = Average[30](close)
c1 = indicator1 moves up X % in Y minutes
// Conditions to enter short positions
indicator1 = Average[3](close)
c2 = indicator1 moves down X % in Y minutes
Always use the ‘Insert PRT Code’ button when putting code in your posts to make it easier for others to read.
Thank you 🙂
There you go:
Timeframe(1 minute,UpdateOnClose)
Y = 100 //100 minutes
X = 0.5 //0.5%
ind = Average[30](close)
PC = (((ind * 100 / ind[Y]) - 100))
UP = PC >= X
DN = PC <= -X
RETURN UP AS "Bullish",-DN AS "Bearish",0 as "0"
Roberto
Molte grazie a te è perfetto