a = ma(c,10);
b = ma(c,20);
d = cross(a,b) and V*C>500000;
dd = sum(d,20)>0;
Filter = dd;
addcolumn(C*V,"indic. t/o");
Thanks Gringotts but I am looking to add other criteria to the scan based on what price is doing at the moment.
ie moving average cross anywhere within last 20 days and inside bar today.
a = ma(c,10);
b = ma(c,20);
d = cross(a,b) and V*C>500000;
dd = sum(d,20)>0; // cross anywhere in last 20 days
i = h<ref(h,-1) and l>ref(l,-1); //inside bar today
Filter = dd and i;
addcolumn(C*V,"indic. t/o");
Works great. Thanks Gringotts Bank. Silly me had date range set to most recent bar!
That's fine.
For what you asked, you do actually want the date range set to the most recent bar. This will still find any MA cross in the last 20 days when you run an EXPLORATION on today's date. [plus an inside bar today - both conditions need to be met].
Thank you again for your help Gringotts.
I've another question which you may be able to help with. If you can't that's fine too as you've helped me a lot already:
Would you know how I can scan for an up day which has volume greater than any down day's volume within the previous 5 days?
I thought it would be straight forward but I am struggling with how to put the logic into AB.
Thanks again.
a = roc(c,1)<0;
b = ValueWhen(a,V,1);
bb = HHV(b,5);
Filter = ROC(C,1)>0 AND v>ref(bb,-1);
Addcolumn etc...
You're a star. Thanks again! I did not know the Valuewhen function. Now I do.:beat:
chipolte, in general you can find available functions by going to Help > Help Contents > AFL Function Reference (alphabetical and categorized).
Thanks Colion. I have had a look through there and was wondering if someone knows the short form of searching for a price cross above the 200day taking place within the past 20 days?
I was typing this but surely there is function for a shorter form?
cross(C,(MA(C,200) OR
cross(ref(C,-1),(ref(MA(C,200),-1))) OR
etc
etc
cross (ref(C,-200).................:bricks1:
Thanks in advance
there is also another question/problem,
i want some alerts when price goes under a shape (trend line or horizontal line or a box or a circle)
it is possible now by "easy alerts" but it's not really easy! i want some kind of shapes.
Hi All,
I recently subscribed to LSE data through http://www.justdata.com.au/ which provides me with all historical listed U.K. listed equities however unlike Premium Data it does not include organised historical watch lists to check if a specific equity was included in an index at any given time i.e. FTSE100. Does anyone know if there is a way to do this?
Many thanks,
james
hi all.
could anyone share the script to colour bars based on whether they are up or down?
So an up bar would be green and a downbar red
(as opposed to the standard colouring based on whether the close is higher than the open)
Thanks
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?