want to put a blue line on the chart
-
I want to put a blue line on the chart for every buy transaction and a red color for every sell transaction, so that when the price exceeds the blue line, a buy opens, and when the price crosses the red line, a sell opens.
So buying and selling is based on the chart lines only.
https://fxdreema.com/builder -
No project is visible through your link.
-
In this example, I tried to explain what is required better than writing alone.
Let's look at the picture
Green numbers indicate the deal that was opened first in the order.
That means I opened a sell at 40, then bought at 50, then bought at 60, then bought at 70, then bought at 80, then sold at 70, then sold at 60, then bought at 90.
You will notice that the price jumped from 60 to 90 immediately at the end of the process and did not open in the space between them.
This is explained by the red and blue lines under the numbers.
When opening any purchase or sale transaction, I want to place a line on the chart that specifies a color for each purchase or sale transaction, so that every time the price exceeds the existing line, whether red or blue, the expert will go to check whether there is a blue or red line. If there are two lines, nothing will open. If there is one line, only the opposite side opens.
So that no more than one buy and sell is opened at a point -
Do you really need lines? They are unnecessary for the bot calculations, only for visual effect. That would make the structure far easier.
-
My problem is not with the lines, but my problem is with repeatedly buying or selling at the same point.
If the topic is easy, please explain how? -
Not, it's not easy. You will need at least two variables controlling that sequence of movements up and down. There are no blocks doing that automatically. Are you familiar with variables?
-
yes i know variables
-
Then you need one variable storing the price level of each new open trade open. Then recalculate the potential noew proce to trigger the conditions you need and repeat again when that price is hit. Obviously those variables will have to be carefully reset in order to avoid miscalculations.
