MQL4 issue

Hi Guys ,

I am not sure if here is the right place to ask this question or not . Sorry if I am in wrong topic .

I am completely beginner in MQL4 programming . Just have to 2 quick questions.

1- If I have a script or expert … and if I need to run this 24 hours , can I quit meta trader and shutdown my machine or I have to keep open my MT4 24 hours ?

2- I need a simple script which opens a buy position with current price and 4 buy pending orders below the open position(current price). The pending orders should be created with 100 pip difference from the open trade AND if one of each pending orders OR the current open position hit the “Take Profit” it automatically close all other pending orders AND open a new buy position and new set of 4 pending orders again with the same condition .

I am sure it’s very simple script but as I am beginner I’m very confused how to run it ? As a script or Expert Advisor

Could somebody please help me about this ? It’s really a great help that caused bad problem for me .

Thanks so much for your help in advance.

  1. No, MT4 needs to be open on a machine with Internet access if you want to run an EA constantly. The difference between a script and an EA is that a script will run once, execute a given action(s) and shut down, whereas an EA will run the start() code every tick. So a script is a simple drag-and-drop onto your chart for one action whereas for an EA you would drag it onto your chart and let it run.

  2. Your best bet to solve this is to create an EA. It’s really simple and wouldn’t take yourself too long to create.

Good luck! :slight_smile:

Clark

In programming, there is no better way to learn than by doing. That is particularly true with MQL4. The learning resources are sparse, but the language itself is very simple.

The EA you are attempting to write is called a grid trader. There are plenty of examples and discussion of this kind of EA. I would suggest that writing one from scratch is not feasible for a first project. Try something easier like a breakout.

Thanks Guy for the replies , I am not familiar with programming but according to CalrkFX found out that EA is my answer because this program should be running constantly as it after hitting a TP by every position it should delete all pending orders and start the code again ( open a new buy position with current price and 4 buy pending orders below that ) . I had some research about closing all pending orders but I have no idea how I CAN CHECK IF A TP HAS BEEN HIT REAL TIME so I can remove all current pending orders and goto the first line of my code to create a new set of position???

Could you please help me about this ? A code than can realize a TP in platform has been triggered ???

Thanks so much

I need a simple Expert Advisor which opens a buy position with current price and 4 buy pending orders with 100 pip difference below the open position(current price). ’

AND if one of each pending orders OR the current open position hit the “Take Profit” it automatically close all other pending orders . In fact , a code than can realize a TP in platform has been triggered ???

I am sure it’s very EA but as I am beginner I’m very confused how to do it ? It caused a bad problem for me . Could somebody please help me about this ?

What you are trying is beyond your skill level. Learn to code by doing something easier.

Can you do it for me ?

A grid trading app is no fun - lots of work, mostly boring.