Help to write a very simple script

 

Hi guys,

i'm new to mql4 and would need a little bit help on a simple script.


what i want is to find the lowest price & highest price between 1pm GMT - 5pm GMT, and enter a long position 50 pips above the high, or enter a short position 50 pips below the low.


i know it may only take several lines of code, but i need some sample code to start with. Really appreciate your helps!

 

It seems like all new guys want to run this strategy of opening below the low or above the high.

I actually wrote one such expert for someone (for a price) and as I look at it now it contains 648 lines, and took about a week or two to perfect.

People new to programming think that if they got a simple idea in their head, it takes only a few lines to code.

Nothing could be further from the truth. It actually is a very hard and tediious work, and quite tricky too (especially coding experts as opposed to indicators).

 
irusoh1:

It seems like all new guys want to run this strategy of opening below the low or above the high.

I actually wrote one such expert for someone (for a price) and as I look at it now it contains 648 lines, and took about a week or two to perfect.

People new to programming think that if they got a simple idea in their head, it takes only a few lines to code.

Nothing could be further from the truth. It actually is a very hard and tediious work, and quite tricky too (especially coding experts as opposed to indicators).

i work as a programmer myself, so i know it isn't a piece of cake to program. this strategy works for me quite well and i've manually tested it for several months with high success. it all depends what timeframe you pick as the opening and what pair you are trading. it doesn't have to be complicated strategy to make money.


honestly speaking, and no offense, 600 lines of codes is really nothing to a project which consists of hundred thousands lines of code.

 
irusoh1:

It seems like all new guys want to run this strategy of opening below the low or above the high.

I actually wrote one such expert for someone (for a price) and as I look at it now it contains 648 lines, and took about a week or two to perfect.

People new to programming think that if they got a simple idea in their head, it takes only a few lines to code.

Nothing could be further from the truth. It actually is a very hard and tediious work, and quite tricky too (especially coding experts as opposed to indicators).

irusoh1, I'm totally with you 100%.

My last EA was about 750 lines.

The actual trading strategy algorithm accounted for about 50 lines of that. The rest was about modularity, robustness, user friendliness and email communication.

And it took about 3 months, 5 major versions and, including minor versions, about 20 versions in total to perfect.


So haoqfu, if 600 lines of code "is really nothing" - go learn to write it yourself.

 
cloudbreaker:

irusoh1, I'm totally with you 100%.

My last EA was about 750 lines.

The actual trading strategy algorithm accounted for about 50 lines of that. The rest was about modularity, robustness, user friendliness and email communication.

And it took about 3 months, 5 major versions and, including minor versions, about 20 versions in total to perfect.


So haoqfu, if 600 lines of code "is really nothing" - go learn to write it yourself.

ya i will just write by myself. the reason i was asking is b/c there might be some free source available so i can just save some time from reading thru the manual.


i guess you guys have never programmed any project of even small size, 600 lines of script should be just couple of days of work once u get familiar with syntax, and it's quite normal to revise the program from time to time.

 
Reason: