Simple Constant Buy and Sell at a TP

 
Dear Guys,

My name is Mihajlo Tomic, I live in Serbia (a smaller country in Europe) and I started trading in CFDs.

I have a little bit of knowledge and experience but I believe in myself and some of my good ideas!

I need 2 small simple MT4 Expert Advisor programs to help me try something.

The first program should be such that when it starts it opens 2 positions at the same time. One would be buy another sell, on the same instrument at the same time. Both positions should have only TP without SL! And after that, whenever a TP event occurs the program should re-open new buy and sell positions at the current price with the same TP without SL and so on ... So every time, any buy or sell position is closed, with TP event, the program should open one new buy and sell position.

The second program should contain almost identical behavior with the difference that it always opens the same quantitative difference in the number of buy and sell positions, so that at all times the number of buy positions is equal to the number of sell positions. For example: when starting a program, one buy and one sell position should be opened. Then if the price touches the TP of the sell position, we now have only 1 buy position, so the program should open 1 new buy and 2 new sell positions. Then, if the price closes now 2 sell positions, which are at the same level because they are open at the same time, now we have only 2 buy positions and the program should now open 1 new buy position and 3 new sell positions, so now we have 3 buy positions and 3 sell positions. Then if the price closes 1 buy position, now the program should open 2 buy and 1 sell positions to have 4 buy and 4 sell positions in total. And so, over time, the number of buy and sell positions would grow steadily until the program was shut down. Simply put: whatever position the price closes with a TP event, the program opens 1 opposite position (for example buy) and more of these positions that are closed (for example sell) so that there is always the same number of buy and sell after any TP event. The point is that at any closed position by TP program opens 1 buy and 1 sell positions and the rest of the quantity difference of positions, to always have the same number of buy and sell positions.

In doing so, I would just like the method OrderSend's parameters of numbers of lots (contracts) and the amount of TP to be variables in the code, so that I can change the values for both programs.

If you have any questions, please do not hesitate to ask, and sorry for my bad English.

***

Thank in advance,
Mihajlo Tomic
 

Please use the Freelance section to place a Job request. You will receive several developers offering to do the job. Speak to them and then choose one to do the job for you at the price you negotiate with them.

Trading applications for MetaTrader 5 to order
Trading applications for MetaTrader 5 to order
  • 2021.06.24
  • www.mql5.com
The largest freelance service with MQL5 application developers
 
Mihajlo Tomic:
Dear Guys,

My name is Mihajlo Tomic, I live in Serbia (a smaller country in Europe) and I started trading in CFDs.

I have a little bit of knowledge and experience but I believe in myself and some of my good ideas!

I need 2 small simple MT4 Expert Advisor programs to help me try something.

The first program should be such that when it starts it opens 2 positions at the same time. One would be buy another sell, on the same instrument at the same time. Both positions should have only TP without SL! And after that, whenever a TP event occurs the program should re-open new buy and sell positions at the current price with the same TP without SL and so on ... So every time, any buy or sell position is closed, with TP event, the program should open one new buy and sell position.

The second program should contain almost identical behavior with the difference that it always opens the same quantitative difference in the number of buy and sell positions, so that at all times the number of buy positions is equal to the number of sell positions. For example: when starting a program, one buy and one sell position should be opened. Then if the price touches the TP of the sell position, we now have only 1 buy position, so the program should open 1 new buy and 2 new sell positions. Then, if the price closes now 2 sell positions, which are at the same level because they are open at the same time, now we have only 2 buy positions and the program should now open 1 new buy position and 3 new sell positions, so now we have 3 buy positions and 3 sell positions. Then if the price closes 1 buy position, now the program should open 2 buy and 1 sell positions to have 4 buy and 4 sell positions in total. And so, over time, the number of buy and sell positions would grow steadily until the program was shut down. Simply put: whatever position the price closes with a TP event, the program opens 1 opposite position (for example buy) and more of these positions that are closed (for example sell) so that there is always the same number of buy and sell after any TP event. The point is that at any closed position by TP program opens 1 buy and 1 sell positions and the rest of the quantity difference of positions, to always have the same number of buy and sell positions.

In doing so, I would just like the method OrderSend's parameters of numbers of lots (contracts) and the amount of TP to be variables in the code, so that I can change the values for both programs.

If you have any questions, please do not hesitate to ask, and sorry for my bad English.

***

Thank in advance,
Mihajlo Tomic

about first program, 

1 whats the amount for tp?

2 for example after 10 cycle

i was opened 20 position(10 sell & 10 buy)

and 10 of them closed with tp

what should we do with the other remaining?