In response to a number of questions concerning entryprice, when entered, how
to reference back to my current tarde price, etc. I have found it necessary (as
have many other senior people in the AFL community) to make a loop which
handles the "BUY" or "SHORT" situation explicitly. That is, in order to answer
many complicated questions you just have to have a loop which goes from 1 to
LastValue(BarIndex()), and evaluates each trade on a one by one basis.
I am not saying that this invalidates the "array processing" approach of
amibroker, but it does minimize its use.
You may need a loop to answer such questions as:
1. number of shares purchased for each signal.
2. Am I in a long or short trade
3. What is my stop price for this trade? (profit, loss, etc.)
4. How many bars am I into this trade?
5. Current potential profit/loss on this trade
6. etc.
This kind of loop is just like TradeStation easyLanguage, if you are familiar
with that.
If you need some help with the basic structure of this type of loop, there are
many examples in this group.