Forex



Go Back   Forex Trading > Training > Metatrader > Metatrader 4 mql 4 - Development course > Questions






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
 
Thread Tools Display Modes
  #1421 (permalink)  
Old 12-14-2008, 10:12 PM
Senior Member
 
Join Date: Nov 2006
Posts: 305
luxinterior is on a distinguished road
Quote:
Originally Posted by luu View Post
Hi Lux,

You mean I can change my EA's magic number:16763 to 16764 ; 16765 ect... ?

Thank you for your quick reply.

Luu
Exactly! As long as the number is unique it doesn't matter what number you choose.

You don't really need to change it unless you have a specific reason to.

Lux
__________________
Build An Expert Advisor. FREE E-course As Seen On TV
ForexArea.com
Users of Gap Trader from 'Forex-Assistant' MUST Read This
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!
Reply With Quote
  #1422 (permalink)  
Old 12-15-2008, 12:29 PM
luu luu is offline
Member
 
Join Date: Aug 2008
Posts: 30
luu is on a distinguished road
Quote:
Originally Posted by luxinterior View Post
Exactly! As long as the number is unique it doesn't matter what number you choose.

You don't really need to change it unless you have a specific reason to.

Lux
Thank you very much for your help Lux !

Luu
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!
Reply With Quote
  #1423 (permalink)  
Old 12-15-2008, 04:21 PM
Member
 
Join Date: Aug 2007
Posts: 30
falanca is on a distinguished road
EA closing order problems

Friends ı have an EA with support resistance indicator.EA must complete orders on target profit.But it lacks sometime.How can ı get rid of this problem.Please help me
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!
Reply With Quote
  #1424 (permalink)  
Old 12-18-2008, 10:46 PM
Junior Member
 
Join Date: Oct 2008
Posts: 1
picassoinactions is on a distinguished road
Please help with simple generic script.

Hi
Can some1 help me please with simple script.
Here is what i need.

Very generic script that can be used on any symbol that will place 3-4 orders for SELL_STOP and BUY_STOP
Let's say i want to place a buy_stop 20 points above current price, second order 40 points above current price, 3d 80 points and so on.
Same thing for Sell_Stop

I kinda was trying to assemble the script based on some examples but since i am not familiar with C language i am having some problems.

"""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""" """"// improved.mq4

int start()

{
int ticket,i;
int cnt=1;
int Dist_SL =10; // Preset SL (pt)
int Dist_TP =100; // Preset TP (pt)

string Symb=Symbol(); // Symbol
RefreshRates();

double bid =MarketInfo(Symb,MODE_BID);
double ask =MarketInfo(Symb,MODE_ASK);
double point =MarketInfo(Symb,MODE_POINT);
int Min_Dist=MarketInfo(Symb,MODE_STOPLEVEL);



if (Dist_TP < Min_Dist) // If it is less than allowed
{
Dist_TP=Min_Dist; // Set the allowed
Alert(" Increased the distance of TakeP = ",Dist_TP," pt");
}

//-------------------------------------------------------------------- 6 --
Alert("The request was sent to the server. Waiting for reply..");

for(i=100;i<400;i=i+100)

{
double TP=(ask+i*Point) + Dist_TP*Point; // Requested price of TP
ticket=OrderSend(Symb,OP_BUYSTOP,0.1,ask+i*Point,1 ,(ask+i*Point)-Dist_SL*Point,TP);
Sleep(500);
int Error=GetLastError(); // Failed :(
switch(Error) // Overcomable errors
{



case 130:Alert("The SL is wrong. Retrying..");
RefreshRates(); // Update data
if (Dist_SL < Min_Dist) // If it is less than allowed
{
Dist_SL=Min_Dist; // Set the allowed
Alert(" Increased the distance of SL = ",Dist_SL," pt");
}


i=i-50;
Alert (i);
Alert (Dist_SL);
cnt=cnt+1;
Alert (cnt);
if (cnt==3)break;


continue; // At the next iteration

case 135:Alert("The price has changed. Retrying..");
RefreshRates(); // Update data
continue; // At the next iteration
case 136:Alert("No prices. Waiting for a new tick..");
while(RefreshRates()==false) // Up to a new tick
Sleep(1); // Cycle delay
continue; // At the next iteration
case 146:Alert("Trading subsystem is busy. Retrying..");
Sleep(500); // Simple solution
RefreshRates(); // Update data
continue; // At the next iteration
}
switch(Error) // Critical errors
{
case 2 : Alert("Common error.");
break; // Exit 'switch'
case 5 : Alert("Outdated version of the client terminal.");
break; // Exit 'switch'
case 64: Alert("The account is blocked.");
break; // Exit 'switch'
case 133:Alert("Trading forbidden");
break; // Exit 'switch'
default: Alert("Occurred error ",Error);// Other alternatives
}
//break;



}


//-------------------------------------------------------------------------- 9 --
Alert ("The script has completed its operations ---------------------------");
return; // Exit start()

}


"""""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""""""""


It kinda of works but many times i am having problem with stop loss.

Last edited by Linuxser; 12-19-2008 at 01:24 AM.
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!
Reply With Quote
  #1425 (permalink)  
Old 12-21-2008, 04:44 AM
Junior Member
 
Join Date: Feb 2006
Posts: 4
wyobenjamin is on a distinguished road
New Question: 5th Decimal and Money Management

In another forum I frequent that is for customers of a particular EA, one customer was complaining about the fact that the EA developer hadn't yet fixed the 5th decimal / fractional pricing issue for their EA.

The developer claimed several months ago that this issue required special scripting to solve. Now, 4 months later, I basically said it was ridiculous that it had not been fixed yet - and claimed that it only required a few lines of code to redefine "Point" similar to the method described here.

So here comes the question. The developer still insists this problem is super complicated and requires special script programming to fix it. Here is the explanation from the developer:

Quote:
Hi John. You’re right. More and more brokers are going to fractional pips. However, the fractional pips issue is not a bug in [name removed]. It’s an issue with the way the MT4 platform defines the difference in the number of decimal places. We’re reprogramming the EA and the indicators so that they recognize the difference. This is supposed to be contained within the definition of the variable “Point” within the MT4 platform and EAs use this definition to determine the decimal places. However, many MT4 platforms don’t pass more than 4 decimal places on the EA, so special scripting needs to be included. Our challenge is that we use the “Point” variable throughout the EA and all of the indicators. Thus, it’s not as simple as adding a couple of lines of code to redefine “Point.” I’m hoping to have a working fractional pip program by the end of next week.
So my question is this: Have any of you experienced programmers encountered this complicated scripting requirement or issues with the MT4 Platform's value of "Point"?

Even if you assume "Point" is limited to 4 decimals, then that would mean you only have to worry about pairs with Point = 0.001 ----which still only takes a line or two of code.

Or, you could use "Digits" instead of "Point" - which still uses only a few lines of code.

Or you could just use a boolean variable like "UseFractionalPips = true;" to redefine "Point".

I really feel like the developer is either making the problem more complicated than it is (or perhaps other motives). I simply have never read or heard of this issue with "Point" being limited to only 4 decimals - and even if it is you could use "Digits" or other methods to redefine point without some special scripting.

I'm only been programming in MT4 for 18 months, so I thought I would defer to some more experienced programmers as to how complicated the "fix" is for dealing with fractional pip pricing in MT4.

Any thoughts?

Thanks in advance for your help,
-B
__________________
FX Robot Man - Live Demo Statements
http://www.fxrobotman.com

Last edited by wyobenjamin; 12-21-2008 at 05:45 AM.
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!
Reply With Quote
  #1426 (permalink)  
Old 12-21-2008, 05:44 AM
Member
 
Join Date: Mar 2008
Location: San Francisco,CA
Posts: 92
sfmain is on a distinguished road
Heres my idea if we can switch the snake with the gaussian sr rate inside the

ssrc indicator it may pay dividends what do you think?so instead of it being

the ssrc it would be the one side gaussian sr rate spearmen rank correlation

"osgsrspc" lol .(i tryed to code it but it went over my head)


SSRC_bar.mq4

SSRC.mq4

OS Gaussian SR Rate.mq4
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!
Reply With Quote
  #1427 (permalink)  
Old 12-21-2008, 06:26 PM
Member
 
Join Date: Sep 2007
Posts: 37
pigfx is on a distinguished road
This is the question that may not make any sense to your guys. I don't know how to code and I am not a programmer either. Anyhow have anyone written an indicator that calculated on 2 or 3 minutes then runs with one minute chart? All your help is appreciated.
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!
Reply With Quote
  #1428 (permalink)  
Old 12-21-2008, 07:10 PM
Member
 
Join Date: Mar 2008
Location: San Francisco,CA
Posts: 92
sfmain is on a distinguished road
i think is what you are looking for put it on a 1 minute chart then chnage the mulitplier to what you want example : 2 min. multiplier 2, 3 min multiplier 3 etc
and dont forget to check the allow .dll imports in the common tab.then go to file/open offline and your chart should be there.good luck



Period_Converter_Opt.mq4
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!
Reply With Quote
  #1429 (permalink)  
Old 12-22-2008, 02:11 PM
Member
 
Join Date: Sep 2007
Posts: 37
pigfx is on a distinguished road
Quote:
Originally Posted by sfmain View Post
i think is what you are looking for put it on a 1 minute chart then chnage the mulitplier to what you want example : 2 min. multiplier 2, 3 min multiplier 3 etc
and dont forget to check the allow .dll imports in the common tab.then go to file/open offline and your chart should be there.good luck



Attachment 75093
Would you please modify this indicator as an sample for me. Thank you again in advance for all your kind help. BTW this indicator from FOREX TSD Forum, MTF indicator, posted by Keris 2112 and Linuxser. I'm not the author many thanks for their effort so others will have them.
Attached Files
File Type: ex4 #MTF_RSI.ex4 (2.7 KB, 17 views)
File Type: mq4 #MTF_RSI.mq4 (3.8 KB, 16 views)

Last edited by pigfx; 12-23-2008 at 02:52 AM.
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!
Reply With Quote
  #1430 (permalink)  
Old 12-25-2008, 02:54 PM
Member
 
Join Date: Sep 2007
Posts: 37
pigfx is on a distinguished road
Quote:
Originally Posted by sfmain View Post
i think is what you are looking for put it on a 1 minute chart then chnage the mulitplier to what you want example : 2 min. multiplier 2, 3 min multiplier 3 etc
and dont forget to check the allow .dll imports in the common tab.then go to file/open offline and your chart should be there.good luck



Attachment 75093
Thank you for your patient sfmain, how idiot could I be? Your instruction is so clear. The offline chart is up now. My next questions are:
How could I run this 2 M chart live?
Besides just like my last message, will there be possible to modify any MTF indicator to 2 minutes time frame and attach them separately on 1 min. chart live?
Many thanks again for your kind help.
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!
Reply With Quote
Reply

Bookmarks

Tags
forex, histogram, JMASlope, ToR 1.20, ZUP_v1.mq4

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

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


All times are GMT. The time now is 10:18 PM.



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