New member here, 1st time post. Found this site via google search, am from taiwan, trading US options/futures. New to Amibroker.
yahoo amibroker forum seems very 'restricted' to new members. I found this site much more friendly to new comers.
I am fairly good with programming and coming from Ninja, AFL's arry style is new to me. Need to twist my brain sometimes to get it working.
My question is:
Is there anything can't be done with pure array operation without looping?
(at least that was so claimed in some of the articles in yahoo amibroker forum)
A simple counter example is:
assume I am at bar i, the goal is to find the 1st previous (or to the left) bar j, where bar j's value is lower than bar i.
Obviously using things like
ValueWhen( L<=L, BarIndex(), 1) does not make sense at all, and there's no other way except looping.
So my point is, pure AFL style array operation fails in cases where you need to reference multiple array elements in the SAME array, and the relative positions of the two elements is unknown. i.e., you can't use Ref().
Can any AFL seniors elighten me if my point is not correct?
A follow up question then is, is there any 'conflict' of loop code in backtest/scan?
All the sample codes I've seen so far, loops only exist in indicators but not in scan/backtest-able code. This is one area that's still muddy to me,
so the general question is, what's the difference between indicator code, and scan/backtest-able code.
Since my system is primarily pattern based (vs. the quantitative based like MACD/RSI cross over etc), these questions will be important for me while evaluating if Amibroker is suitable as an auto-trading platform.
Much thanks!
yahoo amibroker forum seems very 'restricted' to new members. I found this site much more friendly to new comers.
I am fairly good with programming and coming from Ninja, AFL's arry style is new to me. Need to twist my brain sometimes to get it working.
My question is:
Is there anything can't be done with pure array operation without looping?
(at least that was so claimed in some of the articles in yahoo amibroker forum)
A simple counter example is:
assume I am at bar i, the goal is to find the 1st previous (or to the left) bar j, where bar j's value is lower than bar i.
Obviously using things like
ValueWhen( L<=L, BarIndex(), 1) does not make sense at all, and there's no other way except looping.
So my point is, pure AFL style array operation fails in cases where you need to reference multiple array elements in the SAME array, and the relative positions of the two elements is unknown. i.e., you can't use Ref().
Can any AFL seniors elighten me if my point is not correct?
A follow up question then is, is there any 'conflict' of loop code in backtest/scan?
All the sample codes I've seen so far, loops only exist in indicators but not in scan/backtest-able code. This is one area that's still muddy to me,
so the general question is, what's the difference between indicator code, and scan/backtest-able code.
Since my system is primarily pattern based (vs. the quantitative based like MACD/RSI cross over etc), these questions will be important for me while evaluating if Amibroker is suitable as an auto-trading platform.
Much thanks!