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
  #1031 (permalink)  
Old 04-04-2008, 01:37 AM
Senior Member
 
Join Date: Oct 2007
Posts: 223
Dave137 is on a distinguished road
Smile

Thanks Linuxser!

I have never used this statement before and now I shall add this to my collection for future reference. You made my day, and now I can proceed with my logic for my EA.

May God Bless You and give you a Long and Healthy Life!

Dave
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1032 (permalink)  
Old 04-04-2008, 01:56 AM
Senior Member
 
Join Date: Oct 2007
Posts: 223
Dave137 is on a distinguished road
Smile

Quote:
Originally Posted by Linuxser View Post
Maybe:
Code:
         Lowest_RSI=MathMin(Lowest_RSI,iRSI(NULL,0,Periods,MODE,i));
         Highest_RSI=MathMax(Highest_RSI,iRSI(NULL,0,Periods,MODE,i));
This gives me the value at a lowest or highest particular RSI bar, but I also need to find out the bar back number for i.

There is a statement:
PHP Code:
Highest_bar iHighest(NULL,0,MODE_HIGH,BarsBack,StartBar
that gives me the highest bar back number, but I need a modified statement to work with the RSI. Any suggestions on this??

Dave
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1033 (permalink)  
Old 04-04-2008, 05:50 AM
Goen's Avatar
Member
 
Join Date: Apr 2007
Posts: 64
Goen is on a distinguished road
Hai GURU,

I have problem with my EA, I use buystop and sellstop with TP.
In by backtest, most of times it could execute with no problem but other times it's error INVALID_STOPS (130)
I already check when it's error, my active price and pending position in acceptable range.
What happen ?

Thanks in advance
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1034 (permalink)  
Old 04-04-2008, 08:52 AM
Kalenzo's Avatar
Senior Member
 
Join Date: Dec 2005
Location: Bydgoszcz - Poland
Posts: 696
Kalenzo is on a distinguished road
Quote:
Originally Posted by Goen View Post
Hai GURU,

I have problem with my EA, I use buystop and sellstop with TP.
In by backtest, most of times it could execute with no problem but other times it's error INVALID_STOPS (130)
I already check when it's error, my active price and pending position in acceptable range.
What happen ?

Thanks in advance
Try to use NormalizeDouble(price,Digits). Sometimes price of metatrader is not 1.2000 but 1.20020031023012 and the rest of the digits is a problem for metatrader when placing pending order. Use NormalizeDouble and it will be ok
__________________
You need proffesional mql coder? Contact me! I will help you!
........................................
http://www.fxservice.eu/
........................................
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1035 (permalink)  
Old 04-04-2008, 08:55 AM
Kalenzo's Avatar
Senior Member
 
Join Date: Dec 2005
Location: Bydgoszcz - Poland
Posts: 696
Kalenzo is on a distinguished road
Quote:
Originally Posted by Dave137 View Post
This gives me the value at a lowest or highest particular RSI bar, but I also need to find out the bar back number for i.

There is a statement:
PHP Code:
Highest_bar iHighest(NULL,0,MODE_HIGH,BarsBack,StartBar
that gives me the highest bar back number, but I need a modified statement to work with the RSI. Any suggestions on this??

Dave
Here is the suggestion:
add your rsi values to an array, and then use ArrayMaximum and ArrayMinimum functions. They return index of array instead of value, so you will know which i is it.
__________________
You need proffesional mql coder? Contact me! I will help you!
........................................
http://www.fxservice.eu/
........................................
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1036 (permalink)  
Old 04-04-2008, 02:24 PM
Senior Member
 
Join Date: Oct 2007
Posts: 223
Dave137 is on a distinguished road
Smile

I will try to work with the array.

Thanks

Dave
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1037 (permalink)  
Old 04-04-2008, 02:37 PM
Goen's Avatar
Member
 
Join Date: Apr 2007
Posts: 64
Goen is on a distinguished road
Quote:
Originally Posted by Kalenzo View Post
Try to use NormalizeDouble(price,Digits). Sometimes price of metatrader is not 1.2000 but 1.20020031023012 and the rest of the digits is a problem for metatrader when placing pending order. Use NormalizeDouble and it will be ok
Thanks so much Kalenzo, it's works now.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1038 (permalink)  
Old 04-05-2008, 09:10 PM
Badguy's Avatar
Member
 
Join Date: Jan 2006
Posts: 46
Badguy is on a distinguished road
Thumbs up Define trading days

Deleted

Solution found!

Hi Coders

I try to insert a function in my EA to choose the trading days.

The function for trading hours works well.

For trading hours i use following:

extern string TradingHours = "TRADING HOURS";
extern bool UseHourTrade = True;
extern int FromHourTrade = 8;
extern int ToHourTrade = 18;

and later after int start:

if (UseHourTrade){
if (!(Hour()>=FromHourTrade && Hour()<=ToHourTrade)) {
Comment("Time for trade has not come else!");
return(0);


But what is needed for select the trading days?

When I define the extern as follow:

extern string TradingDays = "TRADING Days";
extern bool UseDayTrade = True;
extern int FromDayTrade = DayOfWeek;
extern int ToDayTrade = DayOfWeek;

then I have follow two messages:

'DayOfWeek'-variable expected

what's to do?

Somebody can help me?

Thanks for any help

Last edited by Badguy; 04-06-2008 at 04:54 PM. Reason: Solution found
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1039 (permalink)  
Old 04-06-2008, 02:01 AM
Junior Member
 
Join Date: Apr 2008
Posts: 1
Kieruwin is on a distinguished road
Please Help everyone

i had a problem , how to make only 1 position open and 2 pending.
let just say Buy and Buystop , Sellstop.
i had an info before from someone in mql4, he use :

if(buystoporder>0 && sellstoporder>0)return(0);

and before that , he use switch(OrderType()).
I am confuse , where do i have to change the code?
i am ended in the buystop and sellstop open several times when i change the code, while if not, it wait until one is trigerred , reach their SL or TP and then make a new 2 pending.

My goal is 1 open and 2 pending, so when the open reach the SL or TP, one of the pending is trigerred, one isnot trigerred will be deleted. and make another 2 pending.

and Is it possible to put magic number in switch() option?

Greatly thanks for your help.

Last edited by Kieruwin; 04-07-2008 at 06:59 AM. Reason: no response
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1040 (permalink)  
Old 04-06-2008, 06:44 AM
granpa's Avatar
Junior Member
 
Join Date: Oct 2006
Posts: 24
granpa is on a distinguished road
GURU!!! Please Helpppp

Nevermind.....

Last edited by granpa; 04-07-2008 at 03:07 AM.
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 04:18 AM.



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