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
  #1351 (permalink)  
Old 10-10-2008, 12:05 PM
bluesky123's Avatar
Junior Member
 
Join Date: Oct 2008
Posts: 16
bluesky123 is on a distinguished road
Smile

Thanks!!!it'great!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1352 (permalink)  
Old 10-17-2008, 02:11 PM
increase's Avatar
Senior Member
 
Join Date: May 2006
Posts: 690
increase is on a distinguished road
Back to the drawing board
__________________
Free Forex Signals: Click Here
Get my Hot Forex System: Click Here

Last edited by increase; 10-17-2008 at 02:28 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1353 (permalink)  
Old 10-17-2008, 02:43 PM
Member
 
Join Date: Jul 2008
Posts: 42
yast77 is on a distinguished road
Smile Embeded custom indicator into expert advisor

Hi folks, anyone know how to add the custom indicator below into an expert advisor ? So that we no need use the icustom to call it from the file ?

Code:
//+------------------------------------------------------------------+ 
//| ARSI.mq4 
//+------------------------------------------------------------------+ 
#property copyright "Alexander Kirilyuk M." 
#property link "" 

#property indicator_separate_window
//#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 DodgerBlue

extern int ARSIPeriod = 14;

//---- buffers 
double ARSI[]; 

int init()
{ 
	string short_name = "ARSI (" + ARSIPeriod + ")";

	SetIndexStyle(0,DRAW_LINE); 
	SetIndexBuffer(0,ARSI); 
	//SetIndexDrawBegin(0,ARSIPeriod);

	return(0); 
} 

int start() 
{ 
	int i, counted_bars = IndicatorCounted(); 
	int limit;

	if(Bars <= ARSIPeriod) 
		return(0);

	if(counted_bars < 0)
	{
		return;
	}
	
	if(counted_bars == 0)
	{
		limit = Bars;
	}
	if(counted_bars > 0)
	{
		limit = Bars - counted_bars;
	}
	
	double sc;
	for(i = limit; i >= 0; i--)
	{
		sc = MathAbs(iRSI(NULL, 0, ARSIPeriod, PRICE_CLOSE, i)/100.0 - 0.5) * 2.0;

		if( Bars - i <= ARSIPeriod)
			ARSI[i] = Close[i];
		else		
			ARSI[i] = ARSI[i+1] + sc * (Close[i] - ARSI[i+1]);
	}
Print ("Try2 : " , ARSI[0], ":", ARSI[1]);

	return(0); 
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1354 (permalink)  
Old 10-18-2008, 03:52 AM
Senior Member
 
Join Date: Feb 2007
Posts: 947
FerruFx is on a distinguished road
Quote:
Originally Posted by yast77 View Post
Hi folks, anyone know how to add the custom indicator below into an expert advisor ? So that we no need use the icustom to call it from the file ?

Code:
//+------------------------------------------------------------------+ 
//| ARSI.mq4 
//+------------------------------------------------------------------+ 
#property copyright "Alexander Kirilyuk M." 
#property link "" 

#property indicator_separate_window
//#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 DodgerBlue

extern int ARSIPeriod = 14;

//---- buffers 
double ARSI[]; 

int init()
{ 
	string short_name = "ARSI (" + ARSIPeriod + ")";

	SetIndexStyle(0,DRAW_LINE); 
	SetIndexBuffer(0,ARSI); 
	//SetIndexDrawBegin(0,ARSIPeriod);

	return(0); 
} 

int start() 
{ 
	int i, counted_bars = IndicatorCounted(); 
	int limit;

	if(Bars <= ARSIPeriod) 
		return(0);

	if(counted_bars < 0)
	{
		return;
	}
	
	if(counted_bars == 0)
	{
		limit = Bars;
	}
	if(counted_bars > 0)
	{
		limit = Bars - counted_bars;
	}
	
	double sc;
	for(i = limit; i >= 0; i--)
	{
		sc = MathAbs(iRSI(NULL, 0, ARSIPeriod, PRICE_CLOSE, i)/100.0 - 0.5) * 2.0;

		if( Bars - i <= ARSIPeriod)
			ARSI[i] = Close[i];
		else		
			ARSI[i] = ARSI[i+1] + sc * (Close[i] - ARSI[i+1]);
	}
Print ("Try2 : " , ARSI[0], ":", ARSI[1]);

	return(0); 
}
You must use the iCustom function in your EA to call this indicator:

iCustom(Symbol(),0,"ARSI",ARSIPeriod,0,0);

The number in red is the bar you want to look at. Change it as you need.

FerruFx
__________________
THE HEART of FOREX & THE PROBABILITY METER - Trade with 100% confidence and ... Stress Less!!!
Coding services: Experts Advisors, indicators, alerts, etc ... more info by PM
NEW: video presentation of the Probability Meter ... 24hrs action on the website
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1355 (permalink)  
Old 10-18-2008, 03:05 PM
Member
 
Join Date: Jul 2008
Posts: 42
yast77 is on a distinguished road
Quote:
Originally Posted by FerruFx View Post
You must use the iCustom function in your EA to call this indicator:

iCustom(Symbol(),0,"ARSI",ARSIPeriod,0,0);

The number in red is the bar you want to look at. Change it as you need.

FerruFx
Thanks for your reply. Ya, i know that we can use the icustom function, but as i know, we can embed the indicator function by input the coding from the indicator, the following website Indicators embedding in Expert Advisors (iCustom alternative) | www.metatrader.info that explained by codersguru describe about that, but for the ARSI indicator, i not sure how to embed it into an expert advisor. Thanks for any recommendation !!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1356 (permalink)  
Old 10-18-2008, 07:28 PM
marcelcorzo's Avatar
Senior Member
 
Join Date: Oct 2007
Location: Colombia
Posts: 119
marcelcorzo is on a distinguished road
improvement of 10points3

Hi everyone.
We are trying to improve 10points3. We need to change the code to close last third trade. Please refer to the last posts here:
10points 3.mq4.
We are getting good results here.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1357 (permalink)  
Old 10-18-2008, 08:13 PM
FXX FXX is offline
Junior Member
 
Join Date: Oct 2008
Posts: 2
FXX is on a distinguished road
suspend order

Hello folks,

with respect to programming in MQL4 I'm a real newbie, but I'm learning every day. Currently I'm trying the following:

in the main loop of my EA, when certain conditions are met, an order is opened. This order is with a given entry, stoploss and takeprofit using the OrderSend function.

Only one order at the time is allowed:
total = OrdersTotal();
if(total < 1)
{ etc etc

What I'd like to build is that when the order's stoploss or takeprofit is hit, the EA waits with taking new orders until the current hourly bar (the bar within the stoploss or takeprofit is hit) finishes.

The problem at the moment is that as soon as the stoploss or takeprofit is hit, immediately another order is taken in the main loop.

Can you guys please help me out ?
FXX
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1358 (permalink)  
Old 10-19-2008, 10:27 AM
Junior Member
 
Join Date: Oct 2008
Posts: 13
Bill FX is on a distinguished road
Combine EA need help

Hi all,

Any one know how to combine 2 difference EA in 1 EA ? Please show me step by step how to do this ?

Thanks in advance for your help !
__________________
Bill FX
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1359 (permalink)  
Old 10-20-2008, 03:16 AM
primajaya's Avatar
Senior Member
 
Join Date: Aug 2006
Posts: 181
primajaya is on a distinguished road
Depends on The EA's Logic

Each EA has different logic, so the method to combine two ea's depends on their logic..

So Where's the ea's you would like to combine?

Quote:
Originally Posted by Bill FX View Post
Hi all,

Any one know how to combine 2 difference EA in 1 EA ? Please show me step by step how to do this ?

Thanks in advance for your help !
__________________
You said "why?".. I said "why not?!"
Broker for 5$ Free
Trading system 4free
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1360 (permalink)  
Old 10-20-2008, 03:42 AM
primajaya's Avatar
Senior Member
 
Join Date: Aug 2006
Posts: 181
primajaya is on a distinguished road
How To Rank Values ? Need Helps

Anybody can help me how to create rank function

for example I have some double value like theese:
a=3.0; b=4.0; c=5.0; d=2.0; e=1.0; f=6.0; g=0.0;

from higher to lower value (6.0, 5.0, 4.0, 3.0, 2.0, 1.0, 0.0)
or the value of (f,c,b,a,d,e,g)

So the rank's should be like this
rank number: (th)
f=1 ; c=2; b=3; a=4; d=5; e=6; g=7;

What I need is a function than return the rank if I input the value

int rank (double value)
{
process all value's;


return (the rank of a value from all value's)
}


I know it is easy if we just make a function like this

for example value of "a"
int rank (double value)
{
if(a>b && a>c && a>d && a>e && a>f && a>g)
return (1);
.
.
.

if(a<b && a<c && a<d && a<e && a<f && a<g)
return(7);
}

The Problem is when the variations of value are 2 the combination only a few, but when the variations increase for example 5,7 or 10 etc so the combination to make the rank will very very a lot..

Hope somebody can help me for this kind of problem..

Thank's berfore, Sorry for my poor english, but I'm learning..
Pj..
__________________
You said "why?".. I said "why not?!"
Broker for 5$ Free
Trading system 4free
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 09:36 AM.



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