Title: Need Help - How to reset the values of ATC symbols?
Hi.
In the process of creating indices using ATC, I found that I needed to normalize the data by dividing the ATC OHLC and Volume data by the number of stock symbols in the ATC symbols. (The count of stock symbols is stored in the ATC’s Open Interest field.)
To simplify the process, I’m trying to simply update the current ATC symbols with these new “normalized” values. The exploration code is below. In essence, the code:
1) Retrieves an ATC symbol’s current values
2) Divides ATC symbol’s OHLC and volume by the symbol count (in the ATC Open Interest field)
3) Executes AddToComposite() with new values
4) Displays symbol values in Explore grid.
When I run this, the data in the exploration grid looks perfect, but the current ATC symbol values do not change. Since I’m using the atcFlagDeleteValues flag, I would expect that the exploration would delete the current values and replace them with new values.
Is there something wrong with this approach? A problem with my code? Is this an AB bug?
Thanks for any help.
Regards,
Dan.
/* Created by Dan Clark
This script requires QuotesPlus Data.
It simply divides the values in the index by the number of symbols in the index
It points to a Watchlist where ATC index symbols reside.
*/
//AddToCompositeFlags
ATCCurrentFlags = atcFlagDeleteValues + atcFlagEnableInExplore;
// Get the Symbol
Symbol = Name();
// Get the value arrays
CloseVal = C;
OpenVal = O;
HighVal = H;
LowVal = L;
VolVal = V;
OpenIntVal = OI;
//Get the count
iCount = OpenIntVal;
//Capture Normalize Values
NormCloseVal = C/iCount;
NormOpenVal = O/iCount;
NormHighVal = H/iCount;
NormLowVal = L/iCount;
NormVolVal = V/iCount;
//Add To Composite
AddToComposite(NormCloseVal, Symbol, "C", ATCCurrentFlags);
AddToComposite(NormOpenVal, Symbol, "O", ATCCurrentFlags);
AddToComposite(NormHighVal, Symbol, "H", ATCCurrentFlags);
AddToComposite(NormLowVal, Symbol, "L", ATCCurrentFlags);
AddToComposite(NormVolVal, Symbol, "V", ATCCurrentFlags);
AddToComposite(OpenIntVal, Symbol, "I", ATCCurrentFlags);
Buy = 1;
Filter = Buy;
SetOption("NoDefaultColumns", True );
AddTextColumn(Name() , "Symbol");
AddTextColumn(FullName() , "Company");
AddColumn(C , "Close");
AddColumn(V , "Vol", format = 1.0);
AddColumn(NormCloseVal , "Norm Close");
AddColumn(NormVolVal , "Norm Vol", format = 1.0);
AddColumn(iCount , "iCount", format = 1.0);
Please note that this group is for discussion between users only.
To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
For other support material please check also:
http://www.amibroker.com/support.html
SPONSORED LINKS
YAHOO! GROUPS LINKS
|