Forex



Go Back   Forex Trading > Downloads > Indicators - Metatrader 4
Forex Forum Register More recent Blogs Calendar Advertising Others Help






Register
Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.

From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.

Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
  • Elite Section
    Get access to private discussions, specialized support, indicators and trading systems reported every week.
  • Advanced Elite Section
    For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
See more

 
 
Thread Tools
 
Old 05-10-2006, 05:53 PM
Senior Member
 
Join Date: Mar 2006
Posts: 293
gody6000 is on a distinguished road
Metastock to MT4

MetaStock code for creating the PFE indicator:

Polarized Fractal Efficiency

Mov(If(C,>,Ref(C,-9),Sqr(Pwr(Roc(C,9,$),2) + Pwr(10,2)) /
Sum(Sqr(Pwr(Roc(C,1,$),2)+1),9),-
Sqr(Pwr(Roc(C,9,$),2) + Pwr(10,2)) /
Sum(Sqr(Pwr(Roc(C,1,$),2)+1),9))*100,5,E)

CAN ANY ONE TRY TO CODIT FOR META TRADER 4 THANKS
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
 
Old 08-24-2006, 01:39 PM
Member
 
Join Date: Mar 2006
Posts: 34
spiketrader is on a distinguished road
Metastock to MT4

Hi.
I found this indicator in Metastock and MT3 formats and is very useful to set the stop point . If anybody know Mq4 programming change it into Mq4 I will be appreciated .The Metastock and MT3 codes and description are as below:
/*[[
Name := SafeZone Stop
Author := Copyright ?2004, MetaQuotes Software Corp.
Link := http://www.metaquotes.net/
Separate Window := No
First Color := Cyan
First Draw Type := Symbol
First Symbol := 159
Use Second Data := No
Second Color := Red
Second Draw Type := Line
Second Symbol := 218
]]*/
Inputs: LookBack(10), StopFactor(3), EMALength(13);
Variables: Pen(0), Counter(0), SafeStop(0), EMA0(0), EMA1(0), EMA2(0);
Variables: first(True), prevbars(0), loopbegin(0), shift(0), value1(0), PreSafeStop(0);
SetLoopCount(0);
// Initial checkings
If LookBack < 1 or EMALength < 1 Then Exit;
If Bars < prevbars Or Bars - prevbars > 1 Then first = True;
prevbars = Bars;
If first Then Begin
loopbegin = Bars - LookBack - 3;
If loopbegin < 0 Then Exit; // not enough bars
first = False;
End;
loopbegin = loopbegin + 1;
For shift = loopbegin DownTo 0 Begin
EMA0 = iMA(EMALength,MODE_EMA,shift);
EMA1 = iMA(EMALength,MODE_EMA,shift+1);
EMA2 = iMA(EMALength,MODE_EMA,shift+2);
PreSafeStop = GetIndexValue(shift+1);
Pen = 0;
Counter = 0;
If EMA0 > EMA1 Then Begin
For value1=0 to LookBack Begin
If Low[shift+value1] < Low[shift+value1+1] Then Begin
Pen = Low[shift+value1+1] - Low[shift+value1] + Pen;
Counter = Counter + 1;
End;
End;
If Counter <> 0 Then
SafeStop = Close[shift] - (StopFactor * (Pen/Counter))
Else
SafeStop = Close[shift] - (StopFactor * Pen);
If SafeStop < PreSafeStop and EMA1 > EMA2 Then SafeStop = PreSafeStop;
End;
If EMA0 < EMA1 Then Begin
For value1=0 to LookBack Begin
If High[shift+value1] > High[shift+value1+1] Then Begin
Pen = High[shift+value1] - High[shift+value1+1] + Pen;
Counter = Counter + 1;
End;
End;
If Counter <> 0 Then
SafeStop = Close[shift] + (StopFactor * (Pen/Counter))
Else
SafeStop = Close[shift] + (StopFactor * Pen);
If SafeStop > PreSafeStop and EMA1 < EMA2 Then SafeStop = PreSafeStop;
End;
PreSafeStop = SafeStop;
loopbegin = loopbegin - 1;
SetIndexValue(shift,SafeStop);
End;


I have it on Metastock as well, not sure if it'd be of any use :


Quote:
================================
Trailing Stop - Elder's SafeZone
================================
---8<---------------------------

{Dr Alexander Elder's SafeZone trailing stop v3}

{ SafeZone types:

[1] Uses upside/downside penetration days as
suggested by Dr Elder in his book;

[2] Uses up/down days (instead of
upside/downside penetration days)
to match book's companion spreadsheet.}

{ Triggers: Long (+1) & Short (-1) signals at
crossover of user-defined trailing stops.}

{ ©Copyright 2003-2005 Jose Silva }
{ For personal use only }
{ http://www.metastocktools.com }

{ User inputs }
coefficient:=Input("SafeZone coefficient",
0,10,2.5);
bkpds:=Input("Lookback periods",1,260,10);
pds:=Input("Trend EMA periods",2,260,21);
adv:=Input("plot: [1]Today's SafeZone, [2]Tomorrow's stop",1,2,1)-1;
type:=Input("SafeZone type: [1]Book, [2]Spreadsheet",1,2,1);
plot:=Input("SafeZone: [1]Stop, [2]Long+Short, [3]Signals",1,3,1);

{ Downside penetrations }
DwSidePen:=
If(type=1,Mov(C,pds,E)>Ref(Mov(C,pds,E),-1),1)
AND L<Ref(L,-1);
DwSideDiff:=If(DwSidePen,Ref(L,-1)-L,0);
DwPenAvg:=Sum(DwSideDiff,bkpds)
/Max(Sum(DwSidePen,bkpds),.000001);
StLong:=Ref(L-DwPenAvg*coefficient,-1);
StopLong:=If(C<PREV,StLong,Max(StLong,PREV));

{ Upside penetrations }
UpSidePen:=
If(type=1,Mov(C,pds,E)<Ref(Mov(C,pds,E),-1),1)
AND H>Ref(H,-1);
UpSideDiff:=If(UpSidePen,H-Ref(H,-1),0);
UpPenAvg:=Sum(UpSideDiff,bkpds)
/Max(Sum(UpSidePen,bkpds),.000001);
StShort:=Ref(H+UpPenAvg*coefficient,-1);
StopShort:=If(C>PREV,StShort,Min(StShort,PREV));

{ Stop signals }
entry:=Cross(C,Ref(StopShort,-1));
exit:=Cross(Ref(StopLong,-1),C);

{ Clean signals }
Init:=Cum(IsDefined(entry+exit))=1;
bin:=ValueWhen(1,entry-exit<>0 OR Init,
entry-exit);
entry:=bin=1 AND (Alert(bin<>1,2) OR Init);
exit:=bin=-1 AND (Alert(bin<>-1,2) OR Init);

{ Plot on price chart }
If(plot=1,Ref(If(bin=1,stopLong,stopShort),
-1+adv),If(plot=2,Ref(stopLong,-1+adv),0));
If(plot=1,Ref(If(bin=1,stopLong,stopShort),
-1+adv),If(plot=2,Ref(stopShort,-1+adv),
entry-exit))

---8<---------------------------


http://www.metastocktools.com


Description:



Quote:
'SafeZone measures market noise and places stops at a multiple of noise level away from the market.

We may use the slope of a 22-day EMA to define the trend. You need to choose the length of the lookback period for measuring noise level. It has to be long enough to track recent behaviour but short enough to be revelent for current trading. A period of 10 to 20 days works well, or we can make our lookback period 100 days or so if we want to average long-term market behaviour.

If the trend is up, mark all downside penetrations during the look-back period, add their depths, and divide the sum by the number of penetrations. This gives you the Average Downside Penetration for the selected lookback period. It reflects the average level of noise in the current uptrend. Placing your stop any close would be self-defeating. We want to place our stops farther away from the market than the average level of noise. Multiply the Average Downside Penetration by a coefficient, starting with two, but experiment with higher numbers. Subtract the result from yesterday's low, and place your stop there. If today's low is lower than yesterday's, do not move your stop lower since we are only allowed to raise stops on long positions, not lower them.

Reverse these rules in downtrends. When a 22-day EMA identifies a downtrend, count all the upside penetrations during the lookback period and find the Average Upside Penetration. Multiply it by a co-efficient, starting with two. When you go short, place a stop twice the Average Upside Penetration above the previous day's high. Lower your stop whenever the market makes a lower high, but never raise it.

I anticipate that SafeZone will be programmed into many software packages, allowing traders to control both the lookback period and the multiplication factor. Until then, you will have to do your own programming or else track SafeZone manually. Be sure to calculate it separately for uptrends and downtrends.
Also I have a version of this in Mq4 but it doesn’t work properly(the attached file).


Thank for your help in advance
Attached Files
File Type: mq4 SafeZone_v0[1].1.mq4 (4.6 KB, 321 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
 
Old 11-01-2006, 10:20 AM
cubesteak's Avatar
Senior Member
 
Join Date: Jul 2006
Location: Southern California
Posts: 160
cubesteak is on a distinguished road
A code of the MT3

I coded this from the MT3 code above. It is different than the one that you've posted - that one came from a russian forum as I understand it and isn't based on the MT3 code.

I don't have MT3 to test this for validity - do you? If so, I'd love to know if this does what you are looking for.

Cheers,
CS
Attached Files
File Type: mq4 Elders Safe Zone.mq4 (3.2 KB, 340 views)
__________________

Join the MultiBroker M1 and TICK Data Bank Project

Imagine 90-99% modeling quality in MT4 back testing with free data from your broker!
Come see our current list of covered brokers.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
 
Old 12-13-2006, 06:36 AM
Junior Member
 
Join Date: May 2006
Posts: 22
bugkeab is on a distinguished road
Wink Metastock to MT4

The code below is metastock format, Can someone help to convert to MT4 ? with option mov preriods change.

It's trend following oscillator, it's can use with break out strategies like price chanel or price chanal with ATR adjusted to make trading system.
(see attached picture for a sample system)


Bull Power/Bear Power Histogram

r1:=If(Ref(C,-1)<O,Max(O-Ref(C,-1),H-L),H-L);
r2:=If(Ref(C,-1)>O,Max(Ref(C,-1)-O,H-L),H-L);
bull:=If(C=O,
If(H-C=C-L,
If(Ref(C,-1)>O,
Max(H-O,C-L),
r1),
If(H-C>C-L,
If(Ref(C,-1)<O,
Max(H-Ref(C,-1),C-L),
H-O),
r1)),
If(C<O,
If(Ref(C,-1)<O,
Max(H-Ref(C,-1),C-L),
Max(H-O,C-L)),
r1));
bear:=If(C=O,
If(H-C=C-L,
If(Ref(C,-1)<O,
Max(O-L,H-C),
r2),
If(H-C>C-L,
r2,
If(Ref(C,-1)>O,
Max(Ref(C,-1)-L,H-C),
O-L))),
If(C<O,
r2,
If(Ref(C,-1)>O,
Max(Ref(C,-1)-L,H-C),
Max(O-L,H-C))));
BB:=Mov(bull-bear,30,S); { need option mov preriods change}
slowBB:= mov(BB,89,s); { need option mov preriods change}
fastBB:= mov(BB,13,s); { need option mov preriods change}

Thank you
Attached Images
File Type: png 30 min breakout.png (34.5 KB, 1976 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
 
Old 12-14-2006, 08:02 AM
igorad's Avatar
Senior Member
 
Join Date: Oct 2005
Location: Ukraine
Posts: 963
igorad is on a distinguished road
Hi,
It's so-called Bull And Bear Balance Indicator by Vadim Gimelfarb.
And looks very similar to MACD.

Igor
Attached Files
File Type: mq4 BullAndBear_v1.mq4 (6.3 KB, 650 views)
__________________
Let's improve trade skills together
http://finance.groups.yahoo.com/group/TrendLaboratory
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
 
Old 12-14-2006, 08:40 AM
balista4's Avatar
Senior Member
 
Join Date: May 2006
Posts: 156
balista4 is on a distinguished road
Thanks Igorad
__________________
I'm waiting for the golden age 12/12/2012
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
 
Old 12-14-2006, 02:42 PM
Member
 
Join Date: Sep 2006
Posts: 30
king forex is on a distinguished road
hi

were this indicators Attached Thumbnails plz
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
 
Old 12-14-2006, 04:13 PM
Junior Member
 
Join Date: May 2006
Posts: 22
bugkeab is on a distinguished road
Thank you very much Igorad.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
 
Old 03-22-2007, 11:20 PM
Malcik's Avatar
Senior Member
 
Join Date: Nov 2006
Location: Pilsen, Czech Republic
Posts: 150
Malcik is on a distinguished road
Hi, I figured I would use this indicator too I attempted to convert it to MT4 from VTrader... here's the original code:

Code:
_pfe:= Mov(If(pr>Ref(pr,-length),sqrt(Power(Roc(pr,length,Points),2) + Power(10,2)) /
Sum(Sqrt(Power(Roc(pr,1,Points),2)+1),length),-
Sqrt(Power(Roc(pr,length,Points),2) + Power(10,2)) /
Sum(Sqrt(Power(Roc(pr,1,Points),2)+1),length))*100,smooth,E);
And the MT4 version is in the attachment. However, it doesn't look like the original one (check the picture), the original one is smoother. Plus, I had to put a fixed period because when it was a variable, it always returned zero.

I'm a bad programmer, so I ask anyone willing to help to check the MT4 code and correct the errors, generally it should be somewhat right.

And, as you can see from the picture, it's worth it to have this indicator in MT4, very useful, so do it for your own good

Thanks!
Attached Images
File Type: gif pfe.GIF (13.0 KB, 2024 views)
Attached Files
File Type: mq4 Polarized Fractal Efficiency.mq4 (3.0 KB, 316 views)
__________________
Malcik
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
 
Old 07-25-2007, 05:26 PM
giraia_br's Avatar
Senior Member
 
Join Date: Feb 2006
Posts: 145
giraia_br is on a distinguished road
correct setup to Metastock (METASTOCK, NOT METATRADER) to backtest

there is not forum for this, but i know that many respected traders like Igor uses Metastock saying that is far more reliable than Metatrader.

so what is the correct setup to do that?

if is it correct that Metastock is really reliable, so i think that this topic would be very useful.

sorry for my very poor English.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
 

Bookmarks

Tags
elder, metastock, mt4 to metastock, polarized fractal efficiency, safezone
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Reliable feeds - Metastock etc pip-gandalf Metatrader 4 6 09-07-2007 10:18 AM
Moving average from Metastock maniek Indicators - Metatrader 4 2 06-05-2006 12:13 PM


All times are GMT. The time now is 04:22 AM.



Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.