Forex
Google
New signals service!

Go Back   Forex Trading > Metatrader Training > 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
 
LinkBack (2) Thread Tools Display Modes
  #551 (permalink)  
Old 03-29-2007, 01:46 AM
MiniMe's Avatar
Senior Member
 
Join Date: Nov 2006
Location: Montréal
Posts: 1,297
MiniMe is on a distinguished road
Thumbs up

Quote:
Originally Posted by ralph.ronnquist
You find where it says
PHP Code:
price_p1=lap;
price_p0=lap+dhm/2;
price_p2=lap+dhm;
price_01=la0;
price_00=la0+dhm/2;
price_02=la0+dhm
and change that to say
PHP Code:
price_p2=lap;
price_p0=lap+dhm/2;
price_p1=lap+dhm;
price_02=la0;
price_00=la0+dhm/2;
price_01=la0+dhm
THANKS A LOT
__________________
x.x.x.x.x. $$$ x.x.x.x.x.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #552 (permalink)  
Old 03-29-2007, 02:37 AM
ocm1's Avatar
Member
 
Join Date: Dec 2005
Location: Ukraine
Posts: 66
ocm1 is on a distinguished road
Dear coder,

asking mt4 programming question,

if (!IsDemo())return(0);

what is means ? that only can run on demo account? can't run on real account?

thank you

from ocm
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #553 (permalink)  
Old 03-29-2007, 03:42 PM
Junior Member
 
Join Date: Feb 2007
Posts: 6
inversionesingles is on a distinguished road
A simple question (i hope that): I have a buy position with trailing stop. I want to open a sell position when the open position hit the trailing stop, but the sell position must be open in the same price that the buy position close:
let me explain:
trailing stop:1.3075
buy orde:1.3080
if the buy order hit 1.3075, then the EA must open a short position at 1.3075
The problem is that the trailing is moving and i have to modified the open of sellstop acording to the triling movement.
I don{t know how can i code that
Please, help me.
Thanks in advance
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #554 (permalink)  
Old 03-30-2007, 07:52 PM
Junior Member
 
Join Date: Nov 2006
Posts: 6
little4xtrader is on a distinguished road
Does MQL4 support pass by reference in the function? I want to return 2 values from the same function. Instead of writing all the code within start(), I want to create a function just to make the code cleaner and more easy to read. Can anyone point me to any previous EA that is using this type of technique or give me a one liner example?

I am familiar with programming in C/C++ but new to the MQL4 language. Any help is appreciated. Thanks in advance.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #555 (permalink)  
Old 03-31-2007, 06:41 PM
iscuba11's Avatar
Senior Member
 
Join Date: May 2006
Location: Houston
Posts: 399
iscuba11 is on a distinguished road
Smile How do I get rid of zeroes in my variable??

I figured out my answer!


Dave
<><<<

Last edited by iscuba11; 04-01-2007 at 02:57 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #556 (permalink)  
Old 04-02-2007, 08:33 AM
Junior Member
 
Join Date: Jan 2007
Posts: 12
gdreporter is on a distinguished road
newbie Question

Dear All
I have an Ea That is working well. But I think that some parameters are not optimized.

All the parameters are putted in arrays:

Array1[0] = "EURUSD";/Currency
Array2[0] = 60;//ime frame
Arra3[0]= 20;//Parameter1
Array[4]=xx;//Parameter 2

What I need is to put thoses value as extern parameter that I can optimize them in back testing.

How to procced. A sample code is highly appreciated.

i Tried to put

extern int par1= 60

and

Arra3[0]= par1;

i've got par1 is not initialized.

Thanks for your help.

Kindest Regards
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #557 (permalink)  
Old 04-11-2007, 07:48 AM
Member
 
Join Date: Dec 2005
Posts: 68
asmdev is on a distinguished road
Quote:
Originally Posted by gdreporter
Dear All
I have an Ea That is working well. But I think that some parameters are not optimized.

All the parameters are putted in arrays:

Array1[0] = "EURUSD";/Currency
Array2[0] = 60;//ime frame
Arra3[0]= 20;//Parameter1
Array[4]=xx;//Parameter 2

What I need is to put thoses value as extern parameter that I can optimize them in back testing.

How to procced. A sample code is highly appreciated.
You could use strings to store you extern parameters.
extern string Par1 = "20,30,40,50";

Then you'll have int arrays.
int _par1[10];

Then you need function to parse the line and store everything in _par1[] variable that will be used in your program.

I copied some code from my indicator:

int line_cnt = 0;
double params[10];
string names[10];

int parse_line(string line){
int len = StringLen(line), i = 0, startPos = 0, par = -1;
if(len < 6) return(0);
string str;

while(i <= len){
if(len == i || StringGetChar(line, i) == sep1){
par++;
str = StringSubstr(line, startPos, i-startPos);
if(par < 6) params[line_cnt][par] = StrToInteger(str);
else if(par == 6) names[line_cnt] = str;
else{
if(StringFind(str, "false") != -1) nPar[line_cnt][par-6] = 0;
else if(StringFind(str, "true") != -1) nPar[line_cnt][par-6] = 1;
else nPar[line_cnt][par-6] = StrToDouble(str);
}
i++;
startPos = i;
}
i++;
}
//nPar[line_cnt][0] = par-6;
}


which can be used this way:
parse_line("Hehe,10,203,40,5.34");
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #558 (permalink)  
Old 04-12-2007, 07:43 AM
Junior Member
 
Join Date: Oct 2006
Posts: 5
beeker is on a distinguished road
I posted this on another forum, but still have yet to figure this out:

Hi everyone. I'm trying to code a simple MTF stochastic cross indicator, but I'm having a few problems. I used Scorpion's '3 MAs Cross Arrows' indicator as the base and modified it for stochastics (thank you Scorpion!).

Basically I want to have 2 stochastics; one for the current time frame and one for the 4 hour. If the current time frame stochastic turns up and the 4 hour stochastic is turned up, an arrow will be placed. If the current time frame stochastic turns up but the 4 hour stochastic is turned down, an arrow will not be placed.

The indicator I've attatched draws the arrows, however it will draw buy arrows when the 4 hour is turned down, and vice versa. I appreciate any help!
Attached Files
File Type: mq4 MTFStochCross.mq4 (2.8 KB, 15 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #559 (permalink)  
Old 04-12-2007, 03:55 PM
tracej's Avatar
Member
 
Join Date: Jan 2007
Location: TN & FL USA
Posts: 88
tracej is on a distinguished road
Question Point ?

Can someone explain what Point means in MT4/MQL?

For example - in FX what would be the point value for EUR/USD? What about USD/JPY? Would it be .0001 for EUR and .01 for JPY?

How about index futures? What would be a point for ES, ER2, YM? .25, .10, 1?

Sorry I am trying to figure out exactly what it means by point because it seems more like it really means pip for FX or tick for futures. There is a big difference between point and tick though.

Thanks.
__________________
TraceJ
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #560 (permalink)  
Old 04-12-2007, 11:25 PM
Junior Member
 
Join Date: Feb 2007
Posts: 7
clippertm is on a distinguished road
Hello Coder's Guru,

Just a little message to thank you for your pdf guides.
They are very helpful and well done.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Tags
histogram, forex, 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

LinkBacks (?)
LinkBack to this Thread: http://www.forex-tsd.com/questions/270-ask.html
Posted By For Type Date
OzFx System:) - Page 639 This thread Refback 06-21-2008 10:53 PM
Forex SRDC Sidus Sibkis EA MT4 Forum OTCSmart This thread Refback 12-08-2007 12:46 PM


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



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