Re: [amibroker] TimeFrameSet problem

 

OK, so the complete picture is:

I'm on a market where liquidity can be a problem. I want to filter out low liquidity stocks. So I don't want to check just if the volume was high enough on the last bar, I want to check few recent bars.

I'm checking both the average volume and lowest volume. The actual code goes like this

VolMA = MA(Volume * Close, 4);
VolLow = LLV(Volume * Close, 8);
hasVolume = VolLow > 100000 AND VolMA > 500000;

and then 

BuySignal = someCondition AND hasVolume;

I'm using weekly bars. Checking weekly volume is problematic, because there are some weeks with less than 5 trading days, so the volume on "shorter" weeks is lower. For MA it's not that big deal, but for LLV threshold it could be distorting results.

So that's why I wanted to check lowest daily volume for the last 20 bars of so. Ideally I'd like to check something like "what is the 5 percentile of daily volume for given period", but for now I'd be more than happy with lowest value.

I got response off the list, that the problem is going from weekly to daily (and the TimeFrameSet doesn't work from lower to higher, only the other way around)

best


On Sat, Apr 16, 2016 at 8:25 PM, 'B. Pitatzidis' bobptz@gmail.com [amibroker] <amibroker@yahoogroups.com> wrote:
 

Then you want
Buy = ... AND (Volume * C) > 10000)


I do not see why you need LLV.

Unless you say something like:

IT_IS_A_LOW_VOL_DAY = (Volume * C ) = LLV(Volume * C, 20);

and then


Buy = ... AND  IT_IS_A_LOW_VOL_DAY and (Volume * C) > 10000)


On Sat, Apr 16, 2016 at 9:17 PM, Marcin Jagodziński marcin.jagodzinski@gmail.com [amibroker] <amibroker@yahoogroups.com> wrote:
 

Sorry, my mistake. No, I don't want to find the date, I'd rather find the value (and then use it in Buy like Buy = ... AND VolLowDaily > 10000)

On Sat, Apr 16, 2016 at 7:57 PM, 'B. Pitatzidis' bobptz@gmail.com [amibroker] <amibroker@yahoogroups.com> wrote:
 

>>>
What I want to achieve is to find the day with lowest volume
<<<

VolLowDaily = LLV(Volume * C, 20);
This will find the lowest VOLUME*C (amount of money), but not the DATE, as you wish.  Maybe you need to use VALUEWHEN to find the date?

So add to your code something like:
ValueWhen(Volume * C =VolLowDaily , datetime(), )




On Sat, Apr 16, 2016 at 8:29 PM, Marcin Jagodziński marcin.jagodzinski@gmail.com [amibroker] <amibroker@yahoogroups.com> wrote:
 

Yes, I've tried it, the result is the same.

On Sat, Apr 16, 2016 at 7:26 PM, 'B. Pitatzidis' bobptz@gmail.com [amibroker] <amibroker@yahoogroups.com> wrote:
 

Hi

I have never used "AddColumn" but let me give it a shot.  Have you tried the TimeFrameExpand ?

TimeFrameSet(inDaily);
VolLowDaily = LLV(Volume * C, 20);
TimeFrameRestore(); 
VolLowDaily = TimeFrameExpand(VolLowDaily,inDaily);
AddColumn(VolLowDaily, "VLD");





On Sat, Apr 16, 2016 at 8:20 PM, Marcin Jagodziński marcin.jagodzinski@gmail.com [amibroker] <amibroker@yahoogroups.com> wrote:
 

No, it's not THIS trivial, I was using Filter of course.

On Sat, Apr 16, 2016 at 7:03 PM, Alan alan@thenorthams.us [amibroker] <amibroker@yahoogroups.com> wrote:
 

Filter = 1;
TimeFrameSet(inDaily);
VolLowDaily = LLV(Volume * C, 20);
TimeFrameRestore(); 
AddColumn(VolLowDaily, "VLD");

On 4/16/2016 11:41 AM, Marcin Jagodziński marcin.jagodzinski@gmail.com [amibroker] wrote:
 
Hello everyone,

although I've read https://www.amibroker.com/guide/h_timeframe.html several times, I still have (probably pretty trivial) problem with TimeFrameSet. 

What I want to achieve is to find the day with lowest volume (I'm using weekly bars for exploration). I've added this to my exploration


TimeFrameSet(inDaily);
VolLowDaily = LLV(Volume * C, 20);
TimeFrameRestore(); 

AddColumn(VolLowDaily, "VLD");
and I'm getting weird (high) values of VolLowDaily.

Anyone could tell me what I'm doing wrong?

best

--
Marcin Jagodziński




--
Marcin Jagodziński





--
Marcin Jagodziński





--
Marcin Jagodziński





--
Marcin Jagodziński

__._,_.___

Posted by: =?UTF-8?Q?Marcin_Jagodzi=C5=84ski?= <marcin.jagodzinski@gmail.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (9)
**** 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/


.

__,_._,___

Related Posts


EmoticonEmoticon

:)
:(
=(
^_^
:D
=D
=)D
|o|
@@,
;)
:-bd
:-d
:p
:ng
:lv