Metastock Formula

Dear Senior members...I want to create METASTOCK FORMULA..if two "consecutive candles" close Above 5EMA-high....then BUY....& if two "consecutive candles" close below 5EMA-low....then SELL..can anybody help me to formulate this...
Thanx in advance...
 
Can any one help writing metastock code for my chart.

Condition: Averages values of last 5 periods/Time-frame of 5ema-High, 5ema-Low & 5ema-Close (i.e. ave. of 15 levels). For using in daily & Hourly charts.

eg. Last 5 days NF High, Low & close 5emas are

H-ema L-ema C-ema

6316 6259 6292
6317 6242 6272
6292 6186 6212
6244 6144 6188
6208 6088 6124

Average of above 15 levels is 6226. So Average EMA line to be drawn on Metastock chart

Please help me.

Thanks in advance,
Keerthi
Your conditions are not very clear to me, but from what I make of it, this should work:

a1:=Sum(HHV(Mov(H,5,E),5),5)/5;
a2:=Sum(LLV(Mov(L,5,E),5),5)/5;
a3:=(Sum(Mov(C,5,E),5)/5);
a4:=(a1+a2+a3)/3;
a4;
 
Dear Mozillan....
.I want to create METASTOCK FORMULA..if two "consecutive candles" close Above 5EMA-high....then BUY....& if two "consecutive candles" close below 5EMA-low....then SELL..can anybody help me to formulate this...
Thanx in advance...
 
Dear Mozillan....
.I want to create METASTOCK FORMULA..if two "consecutive candles" close Above 5EMA-high....then BUY....& if two "consecutive candles" close below 5EMA-low....then SELL..can anybody help me to formulate this...
Thanx in advance...
How about this Expert:
{Buy: Blue UP arrow }
A1:=Mov(H,5,E);
C>A1 AND Ref(C,-1)>Ref(A1,-1)

{Sell: DOWN Red arrow}
A1:=Mov(L,5,E);
C<A1 AND Ref(C,-1)<Ref(A1,-1)
 

Attachments

Last edited:
How about this Expert:
{Buy: Blue UP arrow }
A1:=Mov(H,5,E);
C>A1 AND Ref(C,-1)>Ref(A1,-1)

{Sell: DOWN Red arrow}
A1:=Mov(L,5,E);
C<A1 AND Ref(C,-1)<Ref(A1,-1)
A big thanx brother...u made it...excellent.& coincidence I was also trying this on NIFTY FUTURE..
Sum small change required...that is i was backtesting these signals...& found that if the close of second consecutive candle should be above the close of previous candle ( in case of Buy) & close of second consecutive candle should be below the close of previous candle ( in case of Sell) ...then its is more stronger & reliable signals...so please make slight modification in this brother...thanx in advance...
 
A big thanx brother...u made it...excellent.& coincidence I was also trying this on NIFTY FUTURE..
Sum small change required...that is i was backtesting these signals...& found that if the close of second consecutive candle should be above the close of previous candle ( in case of Buy) & close of second consecutive candle should be below the close of previous candle ( in case of Sell) ...then its is more stronger & reliable signals...so please make slight modification in this brother...thanx in advance...
{Buy: Blue UP arrow }
A1:=Mov(H,5,E);
C>A1 AND Ref(C,-1)>Ref(A1,-1) and C>Ref(C,-1)

{Sell: DOWN Red arrow}
A1:=Mov(L,5,E);
C<A1 AND Ref(C,-1)<Ref(A1,-1) and C<Ref(C,-1)
 
Enhanced system tester

Hi,

I am very new to Metastock. I have been trying to get the Enhanced System Tester to Work. I am using a Moving Average Crossover Strategy.

My Buy : Mov(C,13,E) > Mov(C,21,E)

My Sell : Mov(C,13,E) < Mov(C,21,E)

I am not able to put a stop loss using this formula. I want to set the stop loss at 3.5%. In the option of "STOPS" if I am putting 3.5%, I am getting wayward results. Can anyone Help
 
Re: Enhanced system tester

Hi,

I am very new to Metastock. I have been trying to get the Enhanced System Tester to Work. I am using a Moving Average Crossover Strategy.

My Buy : Mov(C,13,E) > Mov(C,21,E)

My Sell : Mov(C,13,E) < Mov(C,21,E)

I am not able to put a stop loss using this formula. I want to set the stop loss at 3.5%. In the option of "STOPS" if I am putting 3.5%, I am getting wayward results. Can anyone Help
Are you checking the Longs & Shorts checkboxes? Also, are you checking the Maximim Loss checkbox?
 
mozillan brother,
pl again small favour...i want sum filters...in earlier formula of EMA 5 high low....that is...For the first candle wich is closing above 5 ema hi/lo..the formula shud consider it as a valid candle if it has closed say 0.50 paise above ema 5 hi /lo value ...& in second candle also closing consectively above the first valid candle ..it shud become valid if its closing value is higher & higher (in case of buy) & vice versa for sell case by 0.50 paise value..

Thanx
 
mozillan brother,
pl again small favour...i want sum filters...in earlier formula of EMA 5 high low....that is...For the first candle wich is closing above 5 ema hi/lo..the formula shud consider it as a valid candle if it has closed say 0.50 paise above ema 5 hi /lo value ...& in second candle also closing consectively above the first valid candle ..it shud become valid if its closing value is higher & higher (in case of buy) & vice versa for sell case by 0.50 paise value..

Thanx
{Buy: Blue UP arrow }
A1:=Mov(H,5,E);
A2:=0.0000833333; {You can change this value to anything you like}
A3:=REF(A1,-1);
A4:=REF(C,-1);
C>A4 AND A4>A3 and C>A1 and A4>=((A3*A2)+A3)

{Sell: DOWN Red arrow}
A1:=Mov(L,5,E);
A2:=0.0000833333; {You can change this value to anything you like}
A3:=REF(A1,-1);
A4:=REF(C,-1);
C<A4 AND A4<A3 and C<A1 AND A4<=(A3-(A3*A2))
 
Last edited:

Similar threads