Metastock to MT4 - page 3

 

How to make it for MT4 style

VAR1:=(2*CLOSE+HIGH+LOW)/4;

VAR2:=EMA(EMA(EMA(VAR1,4),4),4);

J: (VAR2-REF(VAR2,1))/REF(VAR2,1)*100, COLORSTICK;

D: MA(J,3);

K: MA(J,1);

Drawicon(Cross(K,D),K,1);

//

Hi, Buddies

Who can help me translate the above script into MT4 code sytle??

I can't understand how to do.

Thanks a lot! I'm sure it's better to trade.

Best regards

Franky

 

[REQ] Relative Volatility Index (RVI)

Hi, could someone code this indicator for MT4?

Here is the code from Metastock:

version 1:

Periods:=Input("RVI Periods :",0,1000,14);

SdevPer:=Input("STD Deviation Periods :",0,1000,10);

RVIDown := ((PREV*(Periods-1))+If(ROC(C,1,%)<0,Stdev(C,SdevPer),0))/Periods;

RVIUp := ((PREV*(Periods-1))+If(ROC(C,1,%)>0,Stdev(C,SdevPer),0))/Periods;

RVIall := ( 100 * RVIUp ) / ( RVIUp + RVIDown);

RVIall

Version 2:

Periods:=Input("RVI Periods :",0,1000,14);

SdevPer:=Input("STD Deviation Periods :",0,1000,10);

RVIDownH := ((PREV*(Periods-1))+If(ROC(H,1,%)<0,Stdev(H,SdevPer),0))/Periods;

RVIUpH := ((PREV*(Periods-1))+If(ROC(H,1,%)>0,Stdev(H,SdevPer),0))/Periods;

RVIH := ( 100 * RVIUpH ) / ( RVIUpH + RVIDownH);

RVIDownL := ((PREV*(Periods-1))+If(ROC(L,1,%)<0,Stdev(L,SdevPer),0))/Periods;

RVIUpL := ((PREV*(Periods-1))+If(ROC(L,1,%)>0,Stdev(L,SdevPer),0))/Periods;

RVIL := ( 100 * RVIUpL ) / ( RVIUpL + RVIDownL);

RVIall := (RVIL + RVIH) /2;

RVIall;

 

Thanks

fxbs:
PolarizedFractaEfficiency.mq4

Developed by Hans Hannula TASC 12:1 "Polarized fractal Efficiency"

this should be good

Thanks Buddy

 

convert MS code to MQ4,Please

hi

i need your help

i have a metastock expert code, Please convert this expert to mq4 indicator (for metatrader) and hope me.

highlight buy:

F1:=ValueWhen(1,H<Ref(H,-2) AND

Ref(H,-1)<Ref(H,-2) AND

Ref(H,-3)<Ref(H,-2) AND

Ref(H,-4)<Ref(H,-2),Ref(H,-2));

F2:=ValueWhen(1,L>Ref(L,-2) AND

Ref(L,-1)>Ref(L,-2) AND

Ref(L,-3)>Ref(L,-2) AND

Ref(L,-4)>Ref(L,-2),Ref(L,-2));

a:=Cross(H,F1);

b:=Cross(F2,L);

state:=If(BarsSince(a)<BarsSince(b),1,0);

state=1

+++++++++

highligh sell:

F1:=ValueWhen(1,H<Ref(H,-2) AND

Ref(H,-1)<Ref(H,-2) AND

Ref(H,-3)<Ref(H,-2) AND

Ref(H,-4)<Ref(H,-2),Ref(H,-2));

F2:=ValueWhen(1,L>Ref(L,-2) AND

Ref(L,-1)>Ref(L,-2) AND

Ref(L,-3)>Ref(L,-2) AND

Ref(L,-4)>Ref(L,-2),Ref(L,-2));

a:=Cross(H,F1);

b:=Cross(F2,L);

state:=If(BarsSince(a)<BarsSince(b),1,0);

state=0

Thank you very much

 

QPhase indicator coding assistance

Hi,

I've got this Metastock code (CSSA-QPhase) which I'd like converted into mq4 if someone has time. Thanks.

CSSA QPhase

mhistories:=Input("m-histories", 5, 500, 50);

GroupStart:=Input("GroupStart", 2, 495, 9);

GroupDepth:=Input("GroupDepth", 1, 500, 4);

Lead:=Input("Lead", 0, 20, 0);

Smoothing:=Input("Smoothing", 0, 1, 0.05);

TrainBars:=Input("TrainBars", 5, 10000, 490);

TrainStart:=1;

{ExtFml( "Noxa CSSA_MSX.ShowRange", CLOSE, TrainStart, TrainBars);}

ExtFml( "Noxa CSSA_MSX.QPhase",

CLOSE,

mhistories,

GroupStart,

GroupDepth,

Lead,

Smoothing,

TrainStart,

TrainBars

);

Where:

Category Noxa-CSSA

Syntax

ExtFml( "Noxa CSSA_MSX.QPhase", DataArray, m-histories, GroupStart, GroupDepth, Lead, Smoothing, TrainStart, TrainBars)

Input Parameters

Name

Setting

Example

DataArray

Time series

Close

m-histories

Integer 5~500

50

GroupStart

Integer >=2

9

GroupDepth

Integer >=1

4

Lead

Integer >0

0

Smoothing

Real 0~1

0

TrainStart

Integer >=1

1

TrainBars

Integer >=50

490

Definition

m-histories

Number of components

GroupStart

The first component# in group for reconstruction

GroupDepth

The number of components in group for reconstruction

Lead

The number of bars ahead to project the cycle

Smoothing

The amount of smoothing to apply to cycles

TrainStart

The first bar# of training range

TrainBars

The number of bars in training range

GroupStart and GroupDepth have to be set so that

GroupStart + GroupDepth <= m-histories

 

PnT System metastock to mt4

Boonc Peak 'n Trough V 1.2 metastock code

from www.chaloke.com, thailand, free system

this is about peak and trough theory... trend following system.... when the chart make a new high and higher high it's going up until it come down to make a new low and lower low until it's going up... sorry, with my english is not good. i hope you understand. this is the code frome metastock, if anyone could convert the code from metastock to mt4,

thanky you

Trend

{ Bullish % Step Variable *trend Peak&trough for Expert Advisor Trends n Symbols = Green }

MinimumChange :=LastValue( Fml( "% Variable Step") );

FearFactor :=0.5;

DwTrendMinChange := MinimumChange * FearFactor ;

DwTrendMinChange := LastValue(If(Mov(C,5,S)>Mov(C,25,S), MinimumChange , DwTrendMinChange ));

UpTrendMinChange:= MinimumChange;

BarsSince(Cross(ValueWhen(1,Trough(1,L, DwTrendMinChange )Ref(Trough(1,L, DwTrendMinChange ),-1),L),C))>BarsSince(Cross(C,ValueWhen(1,Peak(1,H, UpTrendMinChange)Ref(Peak(1,H, UpTrendMinChange ),-1),H)));

{ Bearish % Step Variable *trend Peak&trough for Expert Advisor Trends n Symbols = Red }

MinimumChange :=LastValue( Fml( "% Variable Step") );

FearFactor :=0.5;

DwTrendMinChange := MinimumChange * FearFactor ;

DwTrendMinChange := LastValue(If(Mov(C,5,S)>Mov(C,25,S), MinimumChange , DwTrendMinChange ));

UpTrendMinChange:= MinimumChange;

BarsSince(Cross(ValueWhen(1,Trough(1,L, DwTrendMinChange )Ref(Trough(1,L, DwTrendMinChange ),-1),L),C))<BarsSince(Cross(C,ValueWhen(1,Peak(1,H, UpTrendMinChange )Ref(Peak(1,H, UpTrendMinChange ),-1),H)));

Highlight

{ Bullish % Step Variable *trend Peak&trough for Expert Advisor Trends n Symbols = Green }

MinimumChange :=LastValue( Fml( "% Variable Step") );

FearFactor :=0.5;

DwTrendMinChange := MinimumChange * FearFactor ;

DwTrendMinChange := LastValue(If(Mov(C,5,S)>Mov(C,25,S), MinimumChange , DwTrendMinChange ));

UpTrendMinChange:= MinimumChange;

BarsSince(Cross(ValueWhen(1,Trough(1,L, DwTrendMinChange )Ref(Trough(1,L, DwTrendMinChange ),-1),L),C))>BarsSince(Cross(C,ValueWhen(1,Peak(1,H, UpTrendMinChange)Ref(Peak(1,H, UpTrendMinChange ),-1),H)));

Bearish

{ Bearish % Step Variable *trend Peak&trough for Expert Advisor Trends n Symbols = Red }

MinimumChange :=LastValue( Fml( "% Variable Step") );

FearFactor :=0.5;

DwTrendMinChange := MinimumChange * FearFactor ;

DwTrendMinChange := LastValue(If(Mov(C,5,S)>Mov(C,25,S), MinimumChange , DwTrendMinChange ));

UpTrendMinChange:= MinimumChange;

BarsSince(Cross(ValueWhen(1,Trough(1,L, DwTrendMinChange )Ref(Trough(1,L, DwTrendMinChange ),-1),L),C))<BarsSince(Cross(C,ValueWhen(1,Peak(1,H, UpTrendMinChange )Ref(Peak(1,H, UpTrendMinChange ),-1),H)));

Symbol

{Buy % Variable Step Symbol}

MinimumChange :=LastValue( Fml( "% Variable Step") );

FearFactor :=0.5;

DwTrendMinChange := MinimumChange * FearFactor ;

DwTrendMinChange := LastValue(If(Mov(C,5,S)>Mov(C,25,S), MinimumChange , DwTrendMinChange ));

UpTrendMinChange:= MinimumChange;

Cross(

C, ValueWhen(1,Peak(1,H, UpTrendMinChange )Ref(Peak(1,H, UpTrendMinChange ),-1),H

));

{Sell % Variable Step Symbol}

MinimumChange :=LastValue( Fml( "% Variable Step") );

FearFactor :=0.5;

DwTrendMinChange := MinimumChange * FearFactor ;

DwTrendMinChange := LastValue(If(Mov(C,5,S)>Mov(C,25,S), MinimumChange , DwTrendMinChange ));

UpTrendMinChange:= MinimumChange;

Cross(

ValueWhen(1,Trough(1,L, DwTrendMinChange )Ref(Trough(1,L, DwTrendMinChange ), -1),L),C

);

 

could anyone help me create a Peak and Trough indicator?

could anyone help me create Peak and Trough indicator but base on this code that i use in my metastock trading, and when it make a new high or a new low the bar is only show in green and red colour all the way until it's end. and also an arrow signal

Trend

{ Bullish % Step Variable *trend Peak&trough for Expert Advisor Trends n Symbols = Green }

MinimumChange :=LastValue( Fml( "% Variable Step") );

FearFactor :=0.5;

DwTrendMinChange := MinimumChange * FearFactor ;

DwTrendMinChange := LastValue(If(Mov(C,5,S)>Mov(C,25,S), MinimumChange , DwTrendMinChange ));

UpTrendMinChange:= MinimumChange;

BarsSince(Cross(ValueWhen(1,Trough(1,L, DwTrendMinChange )Ref(Trough(1,L, DwTrendMinChange ),-1),L),C))>BarsSince(Cross(C,ValueWhen(1,Peak(1,H, UpTrendMinChange)Ref(Peak(1,H, UpTrendMinChange ),-1),H)));

{ Bearish % Step Variable *trend Peak&trough for Expert Advisor Trends n Symbols = Red }

MinimumChange :=LastValue( Fml( "% Variable Step") );

FearFactor :=0.5;

DwTrendMinChange := MinimumChange * FearFactor ;

DwTrendMinChange := LastValue(If(Mov(C,5,S)>Mov(C,25,S), MinimumChange , DwTrendMinChange ));

UpTrendMinChange:= MinimumChange;

BarsSince(Cross(ValueWhen(1,Trough(1,L, DwTrendMinChange )Ref(Trough(1,L, DwTrendMinChange ),-1),L),C))<BarsSince(Cross(C,ValueWhen(1,Peak(1,H, UpTrendMinChange )Ref(Peak(1,H, UpTrendMinChange ),-1),H)));

Thank you very much and sorry withy my english is not good

 

MT4 code for Composite Index

I also have a MetaStock formula that I hope someone can code to .mq4

It is the indicator that is used in conjunction with RSI(14) in the book Technical Analysis for the Trading Professional by Constance Brown. If you have seen the cover of that book, you will be glad to have this indicator.

It is easy to do with Excel, but I have no experience with MetaEditor coding.

Here's the MetaStock format :

Composite Index = RSI(14)-Ref(RSI(14),-9)+Mov(RSI(3),3,S)

Any help is greatly appreciated

 

Could someone code this indicator for me please

The MetaStock formula is

CI = RSI(14)-Ref(RSI(14),-9)+Mov(RSI(3),3,Simple)

I want to use this to catch divergences with RSI(14).

I would code it myself but I don't know how ...

I use it with Excel and it looks promising at catching many market turns

thanks a million

 
d3scart3s:
The MetaStock formula is

CI = RSI(14)-Ref(RSI(14),-9)+Mov(RSI(3),3,Simple)

I want to use this to catch divergences with RSI(14).

I would code it myself but I don't know how ...

I use it with Excel and it looks promising at catching many market turns

thanks a million

Here it is a version, not a very polished one (I'm at work right now ) but you can test it and let me know if it's fine.

All the best,

Files:
rsi_turn.mq4  3 kb
Reason: