I’m a newbie in AFL coding, I recently readed the Bandy’s introduction to Amibroker, and I try to figure out how can I set a timeframe for a condition.
For instance:
RSI < 30 during 2 weeks then buy
I tried this, but doesn’t work…
RSII= RSI (14);
RISMAJOR= RSII<(30) AND 2*inWeekly
I did some “research” in this forum and I do not find something that can help me.
what this says is that the current daily RSI is below 20 and the RSI in weekly, 2 weeks ago was also below 20…
I hope it helps you get started.
Future leaks ARE VERY IMPORTANT to understand. if your code addresses in any way something in future, your results will be off because basically you are having foresight, a glass ball that you don’t actually have. Read up on it and ask again.
Just to clarify what I'm looking for, I work in daily bars, and I want to buy when the RSI have been less than 30 the last two weeks, or the last 10 days, doesn't matter.
I'm going to explain in a chart, maybe it's more easy to understand.