Weekend evening - page 36

 
Vladimir Karputov:

The branchrules are published in the first post:


Yes, sorry, didn't notice it was only EA, but generally speaking, what do you think?

 
Yuriy Suslov:

Yes, I'm sorry, I didn't notice it was just the councillor, but in general, what do you think?

What do you think? It's just another idea with no real tores - just to test the idea. Such speculation is not interesting.

 
Good evening, weekend!

Make an owl based on this strategy. The strategy is not complicated.

Since the strategy requires market monitoring 24/7, which is physically impossible, a robot is needed.
The essence of the system:
We set trend lines manually. One is higher than the current price, let's call it L1. The other one is lower, let's call it L2. When the price crosses the line L1 from the bottom upwards we buy. Further, if the price turns and crosses the line L1 downwards, we close buying and open selling.
The same with the line L2:. When L2 is crossed from the top downwards - Sell. Upon reversal and crossing of L2 from the bottom upwards - we close Sell and open Buy.
When performing operations on the line L2, the order opened on the line L1 is not touched.
At the end of the trading session, all the orders will be closed.

Requirements to the robot

1) The Expert Advisor shall take as the basis the trend lines set manually. We will call them "L1" and "L2". L1 is higher than the current price. L2 - below.
2) Upon crossing of L1 line from bottom to top, the Expert Advisor opensa Buy(BUY)order. There are no stops, no trailing stops, no takeoffs. If price turns and crosses L1 line from above downwards, Expert Advisor closes BUY order, and opens SELL order. All orders opened on the L1 line should have a certain symbol, for example "OrderL1". This allows the Expert Advisor to know which orders to work with, instead of pinging all of them.

3) If the price keeps going down and reaches the line L2 and crosses it downwards, the Expert Advisor will open one more order. This is an SELL order named "OrderL2". The order named L1 remains untouched. It is still open.
4) When the price turns upwards and the L2 line is crossed from the bottom to the top, the SELL order named "OrderL2" is closed, and the BUY order is opened.

5) All orders opened on a particular line should be named according to the trend line on which they were opened, so that the Expert Advisor knows which order to touch and which not to.

6) The Expert Advisor starts working on the first hour candle in a period of a day. I.e., a new day has started. The day has come to the end (23:58), the orders are closed, and the Expert Advisor waits for the start of a new session (00:00). The time is exaggerated. You should use the time of the broker, when it starts a new candle of the new day.


ADDITIONAL: In the tester, the Expert Advisor can only test the correctness of opening and closing positions along the lines. In order for it to be profitable, it needs to move the trend lines every day before the start of a new session. So far, we only need the implementation of these features of the Expert Advisor. In the future, we may prepare an upgrade that allows the EA to set the lines for the previous day.

 
Rad89:
Good evening, weekend!

Make an owl based on this strategy. The strategy is not complicated.

Since the strategy requires 24/7 market monitoring, which is physically impossible, we need a robot.
The essence of the system:
We manually draw the trend lines. One is higher than the current price, let's call it L1. The other is lower, let's call it L2. When the price crosses the line L1 from the bottom upwards we buy. Further, if the price turns and crosses the line L1 downwards, we close buying and open selling.
The same with the line L2:. When L2 is crossed from the top downwards - Sell. Upon reversal and crossing of L2 from the bottom upwards - we close Sell and open Buy.
When performing operations on the line L2, the order opened on the line L1 is not touched.
At the end of the trading session all orders are closed.

Requirements to the robot

1) The Expert Advisor shall take as the basis the trend lines set manually. Let's call them "L1" and "L2". L1 is higher than the current price. L2 - below.
2) Upon crossing of L1 line from bottom to top, the Expert Advisor opensa Buy(BUY)order. There are no stops, no trailing stops, no takeoffs. If price turns and crosses L1 line from above downwards, Expert Advisor closes BUY order, and opens SELL order. All orders opened on the L1 line should have a certain symbol, for example "OrderL1". This allows the Expert Advisor to know which orders to work with, instead of pinging all of them.

3) If the price keeps going down and reaches the line L2 and crosses it downwards, the Expert Advisor will open one more order. This is an SELL order named "OrderL2". The order named L1 remains untouched. It is still open.
4) When the price turns upwards and the L2 line is crossed from the bottom to the top, the SELL order named "OrderL2" is closed, and the BUY order is opened.

5) All orders opened on this or that line should be named according to the trend line, on which they were opened, so that the Expert Advisor would know which order to touch, and which not.

6) The Expert Advisor starts working on the first hour candle in a period of a day. I.e., a new day has started. The day has come to the end (23:58), the orders are closed, and the Expert Advisor waits for the beginning of a new session (00:00). The time is exaggerated. we should use the broker's time, when it starts a new candle of a new day.


ADDITIONAL: In the tester, the Expert Advisor can only test the correctness of opening and closing positions along the lines. In order for it to be profitable, it needs to move the trend lines every day before the start of a new session. So far, we only need the implementation of these features of the Expert Advisor. In the future, we may prepare an upgrade that the EA itself would set the lines for the previous day.

I give the name to the Expert Advisor "Two Trend Line.mq5".

 
Vladimir Karputov:

I name my Expert Advisor "Two Trend Line.mq5".

Whatever you want. The main thing: to make it work as you want it to)

 
Rad89:

Whatever you like. As long as it works properly)

Are you sure you want to use trend lines? Or do you want to use horizontal lines?

 
Rad89:

Whatever you like. The main thing: to make it work properly.)

if above and below the current price, the lines must be stopped or they will move
 
Vladimir Karputov:

Are you sure you want to use trend lines? Or do you want horizontal lines?

Yes, whatever you want. You can use horizontal lines as well. What would be easier in the code? The main thing is that it should take them all into account separately. For each individual line, our own orders so to speak.

Renat Akhtyamov:
if above and below the current price, the lines must be stopped or they will move

Lines should be set manually. Therefore, they will not go anywhere. The Expert Advisor will not do anything with them. It will not touch them. It only uses them. We will move them ourselves.

 

 

So, it is clear. It will be better if the Expert Advisor itself, at the moment of a new candle's birth on the period D1, moves the line "L1" to the maximum (OPen or CLose) of the previous day and the line "L2" to the minimum (OPen or CLose) of the previous day.

It is supposed that the lines "L1" and "L2" are on the chart and they were drawn manually. Both lines should be"Horizontal line", but not "Trend line".