Forex
Google

Go Back   Forex Trading > Discussion Areas > Metatrader 3
Forex Forum Register FAQ Members List Calendar Search Today's Posts Mark Forums Read


Register in Forex TSD!
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time).
Click here to register and get more information

Reply
 
LinkBack Thread Tools Display Modes
  #11 (permalink)  
Old 01-19-2006, 07:26 AM
treberk treberk is offline
Senior Member
 
Join Date: Oct 2005
Posts: 109
treberk is an unknown quantity at this point
Hi,

it is here
Attached Images
File Type: gif hzz.gif (52.8 KB, 267 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #12 (permalink)  
Old 04-16-2006, 07:48 AM
BC Brett's Avatar
BC Brett BC Brett is offline
Member
 
Join Date: Mar 2006
Location: Vancouver, British Columbia
Posts: 33
BC Brett is on a distinguished road
Convert this MT3 into MT4 for me - very easy

I'm considering switching from MT4 to MT3.
I've just finished editing my very first expert advisor.
It took me about 4 weeks to learn enough about MT and MQL4 to finally get my strategy programmed, but now I think I might just convert the program to MQL2.

From what I've read on this forum, I don't see any advantages to MT4.
What I have read, and learned through backtesting my EA, is that the MT4 Strategy Tester does not work. For this reason alone, I think it only makes sense to spend a few more days making the switch so that I can get an accurate backtest with MT3.

I've already downloaded and installed MT3 and taken a look at the editor dictionary. I can see that there are fewer features with MT3 than with MT4, but I don't think that will be a major problem.

One feature of my MQL4 EA that I was relying on heavily, was the OrderMagicNumber for storing the original pending order's price, which can change with slippage when the order is filled.

MQL2 orders don't have OrderMagicNumber, but I did notice in the MQL2 dictionary a function called OrderValue which, in its description, says the function can retrieve an order's comment (VAL_COMMENT).

If I can use the comment to store the prefered price, I think I can make the switch to MT3. However, I was not able to find in the dictionary, how to set the order comment. The SetOrder function description does not list "comment" as one of its parameters.

Can anyone familiar with this feature of MQL2 tell me how the order comment is set?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #13 (permalink)  
Old 04-16-2006, 10:26 AM
treberk treberk is offline
Senior Member
 
Join Date: Oct 2005
Posts: 109
treberk is an unknown quantity at this point
Quote:
Originally Posted by BC Brett
From what I've read on this forum, I don't see any advantages to MT4.
What I have read, and learned through backtesting my EA, is that the MT4 Strategy Tester does not work. For this reason alone, I think it only makes sense to spend a few more days making the switch so that I can get an accurate backtest with MT3.
So, where have you read that the MT3 backtester is more reliable than the MT4 backtester???

I think you are very mis-informed about this!

MT4 backtesting can be very reliable, but it depends on the quality of the history data that you have and your modelling quality %.

You will not be able to add "comments" or assign "MagicNumbers" to sent orders in MQL2 the way it can be done in MT4 programming. MT4 programming is more advanced than MQL2 programming, why move backwards?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #14 (permalink)  
Old 04-16-2006, 10:32 AM
treberk treberk is offline
Senior Member
 
Join Date: Oct 2005
Posts: 109
treberk is an unknown quantity at this point
You might want to read about MT4 backtesting here: http://www.strategybuilderfx.com/for...09&page=1&pp=8

(if you can not access the page you will need to sign up as a member - it is free)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #15 (permalink)  
Old 04-16-2006, 11:20 PM
pipeline pipeline is offline
Member
 
Join Date: Mar 2006
Posts: 49
pipeline is on a distinguished road
From what I've gathered here and there, people that are a bit serious about backtesting use softwares such as WealthLab, Amibroker or MetaStocks, NOT mt3 or mt4.

Maybe, mt4 backtesting can be about ok IF you don't use any intrabar data. For example, if you work with daily bars, you should use only Open and Close values of daily bars (and not even High and Low if you set StopLosses or Take Profits). Nothing else.
The reason is, despite what their "modelling quality" might say, the only mt4 backtesting method that uses REAL data is "Open prices only".
"Every tick" and "Control Points" methods are nice fairy tales. Personnally, I won't trade money based on fairy tale data backtesting.
I'm still learning mt4, but in my experience, I wouldn't use mt4 backtesting in any other way. I'm not even 100% sure the way I suggested is 100% reliable. If I want to do good backtesting, I will get a backtesting software.

About mt4 vs mt3 for trading live: from what I've gathered here and there ;-) mt4 can't be trusted. Sometimes, orders that mt4 says were not executed, are in fact executed!! This was reported by brokers. If this is true, then brokers offering mt4 live trading aren't serious. Or, they made sure mt4 bugs didn't happen on their platform, it's possible too.
On the other hand, "I ve gathered here and there" lol that trading live with mt3 is possible.

Last edited by pipeline : 04-17-2006 at 12:22 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #16 (permalink)  
Old 05-14-2006, 07:29 PM
scott TTM scott TTM is offline
Senior Member
 
Join Date: Apr 2006
Posts: 210
scott TTM is on a distinguished road
Convert this MT3 into MT4 for me - very easy

Hi guys, I would appreciate if somebody could convert this into MT4 language for me - our broker just upgraded to MT4.

Here is the code:

Code:
/*[[
	Name := TTM Stoch
	Author := Scott Black
	Link := http://www.tradethemajors.com
	Separate Window := yes
	First Color := Cyan
	First Draw Type := Line
	Use Second Data := yes
	second Color := Magenta
	second Draw Type := Line
	Minimum Chart Limits := 0.000000
	Maximum Chart Limits := 100.000000
]]*/
Inputs : Slw(8),Pds(13),Slwsignal(9);
Variables : AA(0),bb(0),aa1(0),cnt1(0);

Variables : shift(0), cnt(0), loopbegin(0),loopbegin2(0),loopbegin3(0), first(True), prevbars(0);
Variables : sum(0), smconst(0),smconst1(0), prev(0),prev1(0),prev2(0),prev3(0), weight(0), linear(0);
Variables : MAValue(0),MAValue2(0),mavalue3(0), MAstring("");
Variables : MyHigh(0),MyLow(0),counter(0),Price(0),Price1(0);

SetLoopCount(0);
smconst = 2 / (1+SLW);
smconst1 = 2 / (1+slwsignal);
	      
	

loopbegin = loopbegin+1; 
For shift = 2000 Downto 0 Begin
    prev = GetIndexValue2(shift+1);
    AA =100* ((Close[shift] - Low[Lowest(MODE_LOW,shift+pds,Pds)]) / (High[Highest(MODE_HIGH,shift+pds,Pds)] - low[Lowest(MODE_LOW,shift+pds,Pds)]));
    MAValue2 = smconst * (aa-prev) + prev;
	SetIndexValue2(shift,MAValue2);
	loopbegin = loopbegin-1; 
End;

loopbegin2 = loopbegin2+1; 
For shift = 2000-pds downto 0 Begin
MyHigh = -999999;
MyLow = 99999999;
For counter =  shift to pds + shift Begin
PRICE= GetIndexValue2(counter);
If Price > MyHigh Then 
MyHigh = Price;
If pds <= 0 Then
MyHigh = Price;
If Price < MyLow Then 
MyLow = Price;
If pds <= 0 Then
MyLow = Price;
end;

prev1 = GetIndexValue(shift+1);
aa1=GetIndexValue2(shift);
bb=100*(aa1-mylow)/(myhigh-mylow);
MAValue = smconst * (bb-prev1) + prev1;
SetIndexValue(shift,mavalue);
loopbegin2 = loopbegin2-1; 
End;


loopbegin3 = loopbegin3+1; 
For shift = 2000 downto 0 Begin
prev2=GetIndexValue2(shift+1);
prev3=GetIndexValue(shift);
MAValue3= smconst1 * (prev3-prev2) +Prev2;

SetIndexValue2(shift,mavalue3);
loopbegin3 = loopbegin3-1;
end;
/*[[
Thank you very much!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #17 (permalink)  
Old 05-14-2006, 11:01 PM
hellkas hellkas is offline
Senior Member
 
Join Date: Oct 2005
Location: Porto/Portugal
Posts: 252
hellkas is on a distinguished road
Quote:
Originally Posted by scott TTM
Hi guys, I would appreciate if somebody could convert this into MT4 language for me - our broker just upgraded to MT4.

Here is the code:

Code:
/*[[
	Name := TTM Stoch
	Author := Scott Black
	Link := http://www.tradethemajors.com
	Separate Window := yes
	First Color := Cyan
	First Draw Type := Line
	Use Second Data := yes
	second Color := Magenta
	second Draw Type := Line
	Minimum Chart Limits := 0.000000
	Maximum Chart Limits := 100.000000
]]*/
Inputs : Slw(8),Pds(13),Slwsignal(9);
Variables : AA(0),bb(0),aa1(0),cnt1(0);

Variables : shift(0), cnt(0), loopbegin(0),loopbegin2(0),loopbegin3(0), first(True), prevbars(0);
Variables : sum(0), smconst(0),smconst1(0), prev(0),prev1(0),prev2(0),prev3(0), weight(0), linear(0);
Variables : MAValue(0),MAValue2(0),mavalue3(0), MAstring("");
Variables : MyHigh(0),MyLow(0),counter(0),Price(0),Price1(0);

SetLoopCount(0);
smconst = 2 / (1+SLW);
smconst1 = 2 / (1+slwsignal);
	      
	

loopbegin = loopbegin+1; 
For shift = 2000 Downto 0 Begin
    prev = GetIndexValue2(shift+1);
    AA =100* ((Close[shift] - Low[Lowest(MODE_LOW,shift+pds,Pds)]) / (High[Highest(MODE_HIGH,shift+pds,Pds)] - low[Lowest(MODE_LOW,shift+pds,Pds)]));
    MAValue2 = smconst * (aa-prev) + prev;
	SetIndexValue2(shift,MAValue2);
	loopbegin = loopbegin-1; 
End;

loopbegin2 = loopbegin2+1; 
For shift = 2000-pds downto 0 Begin
MyHigh = -999999;
MyLow = 99999999;
For counter =  shift to pds + shift Begin
PRICE= GetIndexValue2(counter);
If Price > MyHigh Then 
MyHigh = Price;
If pds <= 0 Then
MyHigh = Price;
If Price < MyLow Then 
MyLow = Price;
If pds <= 0 Then
MyLow = Price;
end;

prev1 = GetIndexValue(shift+1);
aa1=GetIndexValue2(shift);
bb=100*(aa1-mylow)/(myhigh-mylow);
MAValue = smconst * (bb-prev1) + prev1;
SetIndexValue(shift,mavalue);
loopbegin2 = loopbegin2-1; 
End;


loopbegin3 = loopbegin3+1; 
For shift = 2000 downto 0 Begin
prev2=GetIndexValue2(shift+1);
prev3=GetIndexValue(shift);
MAValue3= smconst1 * (prev3-prev2) +Prev2;

SetIndexValue2(shift,mavalue3);
loopbegin3 = loopbegin3-1;
end;
/*[[
Thank you very much!!
Hi Scott...

Try this....
Attached Files
File Type: mq4 TTM Stoch.mq4 (4.3 KB, 56 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #18 (permalink)  
Old 05-15-2006, 02:03 AM
scott TTM scott TTM is offline
Senior Member
 
Join Date: Apr 2006
Posts: 210
scott TTM is on a distinguished road
Hellkas,

i'm afraid that didn't quite work out. Go to www.compoundfx.com/mt3stoch.jpg to see how it should look on the MT3 chart - i tried to upload this but it didn't work.

thanks for your efforts, perhaps this will help?

When i plot it in MT4, i only see a magenta line and not a cyan - although i do see the input is there.

scott
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #19 (permalink)  
Old 05-15-2006, 12:33 PM
yousky yousky is offline
Member
 
Join Date: Dec 2005
Posts: 60
yousky is on a distinguished road
Hi,

First hellkas I will appreceate you keep my file header after converting the mql indicator with my tool Mql2Mq4 !!!

Then it's normal that the converted one does not work properly, if you look in Metatrade 4 in the Expert message log TabSheet (Panel) you will see "Zero Devide exception" like on this picture. In the Indicator script you use divide operator, with some times NULL :-( that's whyt this error, and I repeat, in Metatrade 3, there were no exceptions generated for that, nevertheless in Metatrade 4.

I put the converted one working like on MT 3, and you can see what type of change i've made.

Bye bye
Attached Images
File Type: jpg Exception.jpg (51.7 KB, 188 views)
Attached Files
File Type: mq4 TTMStoch.mq4 (4.9 KB, 68 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #20 (permalink)  
Old 05-15-2006, 12:45 PM
scott TTM scott TTM is offline
Senior Member
 
Join Date: Apr 2006
Posts: 210
scott TTM is on a distinguished road
yousky,

Thanks very much, it looks perfect! I appreciate it.

-SB
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert this into MT3 for me PLEASE scott TTM Indicators - Metatrader 4 6 08-10-2006 08:02 PM
How hard to convert to Easy Language (Tradestation) srbtop General Discussion 1 01-17-2006 02:53 PM


All times are GMT. The time now is 08:56 AM.