Forex



Go Back   Forex Trading > Training > Metatrader > Metatrader 4 mql 4 - Development course > Questions
Forex Forum Register More recent Blogs Calendar Advertising Others Help






Register
Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.

From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.

Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
  • Elite Section
    Get access to private discussions, specialized support, indicators and trading systems reported every week.
  • Advanced Elite Section
    For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
See more

Reply
 
Thread Tools Display Modes
  #1031 (permalink)  
Old 04-04-2008, 01:37 AM
Senior Member
 
Join Date: Oct 2007
Posts: 230
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #1032 (permalink)  
Old 04-04-2008, 01:56 AM
Senior Member
 
Join Date: Oct 2007
Posts: 230
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #1033 (permalink)  
Old 04-04-2008, 05:50 AM
Goen's Avatar
Member
 
Join Date: Apr 2007
Posts: 67
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web 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: 722
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web 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: 722
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #1036 (permalink)  
Old 04-04-2008, 02:24 PM
Senior Member
 
Join Date: Oct 2007
Posts: 230
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #1037 (permalink)  
Old 04-04-2008, 02:37 PM
Goen's Avatar
Member
 
Join Date: Apr 2007
Posts: 67
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #1038 (permalink)  
Old 04-05-2008, 09:10 PM
Badguy's Avatar
Member
 
Join Date: Jan 2006
Posts: 61
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #1039 (permalink)  
Old 04-06-2008, 02:01 AM
Junior Member
 
Join Date: Apr 2008
Posts: 2
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web 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!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


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 03:52 AM.



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