GridRange EA

Post Reply
mast83

GridRange EA

Post by mast83 »

Dear fellow members,

I'm trying learn how to write programs via MQL4.
Currently I'm working on a project called GridRange EA.
I've never learned how to write programs and so I'd like to ask if you can help me to finish this EA.

The rules which the EA has to work are the following ones:

--> This EA tries to perform in a Range and reaches it's TP. When TP is reached all other orders will be closed and you shall be in profit. It works with a martingale system but I think that this EA will work conservative.

1. Place market orders long as well as short (hedged positions)
2. The orderopenprice from step one will be added with 20. This is now the TP for orders in their direction. (As Example: long 1,3000 with 0,01 lots TP = 20 @ 1,3020 / short 1,2999 with 0,01 lots TP = 20 @ 1,2979)
3. If quote moves for example 10 Pips from 1,3000 to 1,3010 than open new market order @ 1,3010 long with 0,01 lots and no TP.
4. If quote reaches 1,3020 and triggers TP of long order in step 2 than close all other active orders.
5. If quote moves back from 1,3010 (step 3) to 1,3000 open new market order short with faktor x (for example 2). So you have a new market order with 0,02 lots at 1,2999.
6. If quote moves down to 1,2989 than open new short order with factor x in matter of last lotsize used at step 5. So 0,02 * 2 = 0,04. You have a new active market order with 0,04 lots @ @ 1,2989.
7. If quote still moves down to the TP of the 1st short order (step 2) TP is triggered, order will be closed with profit and all other orders will be closed too.

I hope you all understand the way this EA shall work. I know that it is not perfect now and that it has some weak points, but I think if skeletal structure is okay and works it is easier to modify it.

Attached you can find my written mql4-file with annotations (currently in German).

Thank you very much for your help! I appreciate your effort.

Regards

Marc
You do not have the required permissions to view the files attached to this post.
SWG123
Trader
Posts: 565
Joined: Wed Nov 16, 2011 3:02 pm
Location: Cape Town

Re: GridRange EA

Post by SWG123 »

It might be better to move this to Coders' Hangout? :)
mast83

Re: GridRange EA

Post by mast83 »

Hi Everybody,

still nobody here who can help me with my issue?

Regards

Marc
User avatar
nanningbob
Trader
Posts: 4564
Joined: Sun Dec 04, 2011 1:23 pm

Re: GridRange EA

Post by nanningbob »

Go to this thread where my 100x40 grid EA is at. I havent used it in years so dont know if it works but you can see the code and use it to adapt yours or adapt it. I used the EA for years so I know it worked well back then. Just set an entrance point and how many pips for that point and it will automatically reenter at those points. Good luck.

http://www.stevehopwoodforex.com/phpBB3 ... =38&t=1415
I trade http://www.stevehopwoodforex.com/phpBB3 ... =38&t=3964,
I talk about my philosophy of trading here.
http://www.stevehopwoodforex.com/phpBB3 ... =38&t=3627
"The key to converting something useful to others is simplicity. Complexity is the enemy to execution." Tony Robbins
Post Reply

Return to “Coders Hangout”