Metastock Formula

Can anybody tell me what is wrong with this formula:-
BUY OR SELL
colA(close) -- c

colB(buy)-- Ref(H,-2) <Ref(H,-1)AND
Ref(H,-1) <H AND
Ref(L,-2) < Ref(L,-1)AND
Ref(L,-1) <L

colC(buy s.l.) -- Ref(L,-1)

colD(sell) -- Ref(H,-2) > Ref(H,-1)AND
Ref(H,-1) > H AND
Ref(L,-2) > Ref(L,-1)AND
Ref(L,-1) > L

colE(sell s.l.) -- Ref(H,-1)
 
By using Indicator builder :

I have 3 moving averages,

1. mov(c,3,e)
2. mov(c,13,e)
3. mov(c,39,e)

I want to plot mov(c,39,e) on chart only when mov(c,3,e) is greater then mov(c,13,e) otherwise nothing.

Please help me to built this formula for Metastock

Prakash
 
I think that is not possible,because if condition is true we can ask MS to plot moving avg(mov,39,e) but when the condition is false then it will automatically plot zero I mean i dont think there is anyway to tell MS to plot nothing if condition is false.Still u can ask in Equis metastock forum about it.

Instead you can use binary waves to check your condition.Suppose your condition is true it will show 1 if false then 0.It is like any other indicator.
 
I think that is not possible,because if condition is true we can ask MS to plot moving avg(mov,39,e) but when the condition is false then it will automatically plot zero I mean i dont think there is anyway to tell MS to plot nothing if condition is false.Still u can ask in Equis metastock forum about it.

Instead you can use binary waves to check your condition.Suppose your condition is true it will show 1 if false then 0.It is like any other indicator.
FOR METASTOCK EXPERT ADVISOR
THIS BUY SELL ARROW ARE REALLY GOOD FOR BANK NIFTY AND OTHER STOCKS ALSO ONLY FEW SIGNALS IN ONE YEAR BUT PROFIT ARE VERY HIGH
I TEST ON 5 YEARS DATA YOU CAN CHECK AND TRADE SAFLY
ENTER IN SYMBOL TAB
HERE IS CODE
BUY:-
TroughBars(1,L,3)=1 AND TroughBars(1,MACD(),29)=1
SELL:-
PeakBars(1,H,3)=1 AND PeakBars(1,MACD(),29)=1
 
FOR METASTOCK EXPERT ADVISOR
THIS BUY SELL ARROW ARE REALLY GOOD FOR BANK NIFTY AND OTHER STOCKS ALSO ONLY FEW SIGNALS IN ONE YEAR BUT PROFIT ARE VERY HIGH
I TEST ON 5 YEARS DATA YOU CAN CHECK AND TRADE SAFLY
ENTER IN SYMBOL TAB
HERE IS CODE
BUY:-
TroughBars(1,L,3)=1 AND TroughBars(1,MACD(),29)=1
SELL:-
PeakBars(1,H,3)=1 AND PeakBars(1,MACD(),29)=1
Metastock is not good for backtesting purpose.You will make an ass of yourself believing that it works , actually which doesnt.Use Tradestation or Multicharts.A test with multicharts will show you the real position of your strategy :D
It seems using peak and troughs, usually it will take back the given signals in realtime.But in backtest it will show sky high profits.
 
Dear Trader!
Here a code for Amistock, Now I want to change into formular of expert in Metastock. Who can help me??? Tks alot.

_SECTION_BEGIN("Adwin - Williams %R and 9 day Mov.avg 1");
/* by Adwin Company*/
MaxGraph =10;

R = ((HHV(H,14) - C) /(HHV (H,14) -LLV (L,14))) *-100;
Graph0 = R;
Graph1 =-30;
Graph2 =-70;
Graph3 =-90;
Graph4 =-10;
Graph5=MA(R , 9);
Graph5Style = 1+4;
Graph5Color =6; // ma`u tin hi?u//
//MA`u ti`n Hi?u?//
Graph0Style=1+4;
Graph1Style =Graph2Style= 1;
Graph3Style =Graph4Style =2;
Graph3Color = Graph4Color =2; //MA`u n`n//
Graph2Color = Graph1Color =12; //ma`u muc ngang//

//Loc//
x = BarsSince( Cross( r, MA( r, 9)));
y = BarsSince( Cross( MA(r, 9), r));

//Buy = BarsSince( Cross( r, MA( r, 9)));
//Sell = BarsSince( Cross( MA(r, 9), r));

//PlotShapes(IIf(Buy,shapeUpArrow,shapeNone) ,colorBlue);
//PlotShapes(IIf(Sell,shapeDownArrow,shapeNone),colorRed);
Graph8 = ( x == 0 OR y == 0 ) * 30;

Title =Name() + " - www.adwin.com.vn Williams %R and 9 day Mov " +" % R Line " +"("+ WriteVal ( Graph0,format=1.2)+")"+ " Signal Line " + ""+"("+WriteVal(Graph5,format=1.2)+")" +" , " + Date( );
_SECTION_END();
 

Similar threads