[amibroker] StaticVarGet( ''varname', align, MODE = compressOpen)

 

I would like to know if there is an alternative to StaticVarGet( ''varname', align, mode = compressOpen).

(the last parameter is not implemented, only for TimeFrameCompress).


On a 1-min exploration I am storing data I need to retrieve on 5/15/etc min charts.StaticVarGet seems to operate in mode "compressLast", but I'd actually need the first value of the period.


The best (partial solution) I was able to come is to compress/expand while exploring. This will repeat the first value over the 5-min period(s) (so StaticVarGet getting the last of those will get the 'correct' one):

StaticVarSet("DB_1m_Profile_Segments_" + Name(), TimeFrameExpand(TimeFrameCompress(Segments, in5Minute, compressOpen), in5Minute, expandFirst));

StaticVarSet("DB_1m_Profile_BarIndex_" + Name(), TimeFrameExpand(TimeFrameCompress(BarIndex(), in5Minute, compressOpen), in5Minute, expandFirst));


Unfortunately this ONLY works for the 5-min chart, on the 15-min chart I will see the first value of the 3rd 5-min period.... which is not what I want.

I tried many variations (e.g. align=False) but none come close to the above...


Background: I am calculating VAP data on 1-min TF on user specified segments (can even be defined on any 5-min period stretch intraday) and so I need to be able to retrieve the same data at the correct bars on higher timeframes. "Segments" show where these segments start (=1) and end (=-1), I calculate the VAP for this stretch (PriceVolDistribution), store the resulting matrix
    StaticVarSet("DB_1m_Profile_VAP_" + Name() + "_" + SegmentStart, ProfileMx);

... which I need to retrieve on the 5-min/15-min charts at the correct bar (so far only the last one):
ProfileDailySegments = StaticVarGet("DB_1m_Profile_Segments_" + Name()); 
ProfileCum=StaticVarGet("DB_1m_Profile_BarIndex_" + Name());
ProfileStartSegment=ValueWhen(ProfileDailySegments>0, ProfileCum);
VAPMx=StaticVarGet("DB_1m_Profile_VAP_" + Name() + "_" + ProfileStartSegment);
.. where ProfileStartSegment is the bar index on the 1-min chart (at calculation time!)
 
Thanks.

__._,_.___

Posted by: gabor.s.kuti@gmail.com
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.

**** IMPORTANT PLEASE READ ****
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