flags - contains the sum of following values
- atcFlagDeleteValues = 1 - deletes all previous data from composite symbol at the beginning of scan (recommended)
- atcFlagCompositeGroup = 2 - put composite ticker into group 253 and EXCLUDE all other tickers from group 253 (avoids adding composite to composite)
- atcFlagTimeStamp = 4 - put last scan date/time stamp into FullName field
- atcFlagEnableInBacktest = 8 - allow running AddToComposite in backtest/optimization mode
- atcFlagEnableInExplore = 16 - allow running AddToComposite in exploration mode
- atcFlagResetValues = 32 - reset values at the beginning of scan (not required if you use atcFlagDeleteValues)
- atcFlagDefaults = 7
(this is a composition of atcFlagResetValues | atcFlagCompositeGroup | atcFlagTimeStamp flags)
- atcFlagEnableInPortfolio = 64 - allow running AddToComposite in custom portfolio backtester phase
- atcFlagEnableInIndicator = 128 - allow running AddToComposite in indicator mod
The first flag is in the zeroth position. 2 ^ 0 == 1. The 0th position is the flag for atcFlagDeleteValues. If it is set to 1, delete all previous values. If it is set to 0, do not delete. We can tell whether it is set to 1 or to 0 for a particular use by asking whether the flag value is even or odd. That is, we can perform modulo 2 operation on the flag and note the remainder. If modulo(flag,2) == 0, do not delete.
----------------
Hi Howard, thanks for showing interest. I was looking at addtocomposite function, i noticed that the flags have a numerical value (integers). The values are 1,2,4,8,16,32,64,128. If you use number 3 as a flag it will use flags 1 & 2. Now I can write if, then statements or case/switch for every combination. The number of combinations is factorial so as the number of flags increase then writing statements become tedious and impractical. So googled for a solution and I found the Python solution on stackoverflow.com. I thought maybe if logic can be written in afl. I spent the long weekend on it with no success.
The flag numbers are integers, they start with 1 and subsequently would be twice the previous one I don't know what the upper limit would be (some integer in progression I explained). The only restriction is that each number is used once. The sum is used to determine which flags were used.
Best Regards
Posted by: Howard B <howardbandy@gmail.com>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (7) |
This group is for the discussion between users only.
This is *NOT* technical support channel.
TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com
TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
EmoticonEmoticon