Experiments in Technical Analysis

Dear Rahul,

Yes.. you have to put entire formula in filter column. Since you are curious to know how it is written, here is the explaination, line by line.

EMA23:=Mov(C,23,E);

Here, we have defined a variable EMA23 (you can give any name) as moving average (MOV) of closing price (C) of 23 candles (23) and it is exponential type (E). When you are in filter column, click on the "functions" button to see all the functions and their syntax. Here if you replace E by S, it will calculate Simple MA.

EMA30:=Mov(C,30,E);

Same as above. Only thing replaced is no. of candles i.e. 30.

These first 2 lines are just the definitions of the variables. Now comes the condition in the last line. The exploration will show only those scrips which will satisfy following condition.

C>=EMA23 AND C>=EMA30 AND Ref(C,-1)<EMA23 AND Ref(C,-1)<EMA30;

In this condition, we need to now check if today's closing price (C) is more than or equal to (>=) EMA23 and (AND) EMA30. Alongwith these 2 conditions, you also want to satisfy the conditions that yesterday's closing price (ref(C,-1) - here we are referring to (ref) closing price (C) one day prior. -1 denotes 1 candle prior, -2 if used, will denote 2 candles prior... and so on) is less than (<) EMA23 and (AND) EMA30.

Since we have used the operator AND inbetween all these conditions, the exploration will show those scrips which satisafy ALL of these 4 conditions. You can also use OR, if-then loop, etc. as per your needs.

Note that I have used "candles" and not "days". So, when you change the periodicity (daily, weekly, quarterly, hourly... and so on), calculation still holds good. i.e. when charts are viewed with daily periodicity, EMA23:=Mov(C,23,E) will calculate 23 "day" EMA of closing price. When periodicity is changed to weekly, the same above formula will calculate 23 "week" EMA of closing price, and so on.

I hope this helps. Please let me know if you still have any doubts.

With regards,

Abhay
Hi Abhay,

It is very very clear. Thanks. I think lot of formulaes would make sense to me now. Can we also write this is as

Mov Avg:=Mov(C,23,E); Or do we have to write EMA23. And if we do use Move Avg then in condition we would write c>=Mov avg. Is it case sensitive. Also we want only when closing price is more than 23 and 30 day can we remove the = sign and write c>ema23.

Thankyou again

Rahul
 

aad

Active Member
Hi Abhay,

It is very very clear. Thanks. I think lot of formulaes would make sense to me now. Can we also write this is as

Mov Avg:=Mov(C,23,E); Or do we have to write EMA23. And if we do use Move Avg then in condition we would write c>=Mov avg. Is it case sensitive. Also we want only when closing price is more than 23 and 30 day can we remove the = sign and write c>ema23.

Thankyou again

Rahul
Hi Rahul,

You cannot write "Mov Avg" as they are 2 words. You have to write movAvg, MovAvg, Mov_Avg, etc. so that it is one word. Please note that mov is a system reserved name for a function and you cannot use it as it is i.e. mov:= is not acceptable.

As I said, EMA23 is just a name to understand from the variable name what its characteristics are. So give a sensible name which, even if you see after 6 months, will immediately tell you what it does. You can write XYZ also instead of EMA23 but it does not make sense when you see the code after a long time or when you pass on this code to someone who does not know anything about this exploration as to what it does.

Although MetaStock does not care for case-sentivity i.e. EMA23 is same as eMA23 or emA23, etc., from a prgrammer's point of view, it is better to have some convention followed when it comes to case-sensitivity. It is especially useful when you want to transfer your formulae from one software to another which does follow case-sensitivity strictly. So, try to maintain same convention throughout.


Also we want only when closing price is more than 23 and 30 day can we remove the = sign and write c>ema23.
Yes, you can remove = sign. But I have deliberately included the same to cover the entire range so that an eligible candidate should not be removed from the exploration just because it is equal to EMA23 or EMA30 (I hope you also would'nt want that).

Regards,

Abhay
 
Hi Rahul,

You cannot write "Mov Avg" as they are 2 words. You have to write movAvg, MovAvg, Mov_Avg, etc. so that it is one word. Please note that mov is a system reserved name for a function and you cannot use it as it is i.e. mov:= is not acceptable.

As I said, EMA23 is just a name to understand from the variable name what its characteristics are. So give a sensible name which, even if you see after 6 months, will immediately tell you what it does. You can write XYZ also instead of EMA23 but it does not make sense when you see the code after a long time or when you pass on this code to someone who does not know anything about this exploration as to what it does.

Although MetaStock does not care for case-sentivity i.e. EMA23 is same as eMA23 or emA23, etc., from a prgrammer's point of view, it is better to have some convention followed when it comes to case-sensitivity. It is especially useful when you want to transfer your formulae from one software to another which does follow case-sensitivity strictly. So, try to maintain same convention throughout.




Yes, you can remove = sign. But I have deliberately included the same to cover the entire range so that an eligible candidate should not be removed from the exploration just because it is equal to EMA23 or EMA30 (I hope you also would'nt want that).

Regards,

Abhay

Thank You Abhay.

Rgds

Rahul
 
how do I download and use BSE - EOD data for F charts SE
=======================================================

Hi

1. Is there a quick way to download this EOD data down loader without a rapid share account

2. does this EOD data down loader, help in downloading BSE - EOD data as well ?

3. if NOT how do I download and use BSE - EOD data for F charts SE
 
Dear Karthik
Hi.

PHP:
for stop loss, i liked ur "volatility based stop system". i.e.,
3*atr = r (initial risk), as it eliminates the risk of market noise to hit ur stop, if we place stop at 5% below ur entry price, as dave landry suggests. but i would like to add, "always put ur stop,below the recent
pivot low or "3*atr or 2*atr", whichever is lower" and check the pivot low in "weekly chart", which gives a strong support area.
Please will u provide me a formula (AFL) to plot trending stop loss in Amibroker.

Thanks.
 
Hello Everybody,
Posting Alf On Behalf Of Mr Karthik.r....which Will Explore \ Scan Database In Few Seconds And Gives Best Buy\sell Security Based On Five Best Indicators,i Am Posting In Behalf Of Karthik.r {sir}, Because He Guided From Very First Step To Build This Explorer,who I Belive Is Best Person In This Forum , Who Talks Less And Gives More ,and [sir]deserves All The Credit....thank You
Hello Casoni,

I can see only the screen shot, where is the the AFL for for this, could you pls post the same...thanks
 
hi i m a technical trader myself and always eager to learn and experiment with new trading methods. i m using 5min, 30min and 60 min charts for intra as well as overnite positions. will love to know ur ideas
 

Similar threads