Expert advisor start when i open trade
-
Hello i want my expert advisor to begin when i open a trade. I want to draw a line for a buy stop pendind order and sell stop pending order and then when one of the two trades opens the other cancels.
-
So if I understand it correctly, you will draw 2 lines on the chart, one for buy and another one for a sell. When price hits one of them a trade is immediately open and then the second line is immediately removed. Correct?
-
yes thats correct
-
Ok. The first thing you will need is to identify the name of the objects (your lines) and then use this setting (for a buy):

In this example you need to insert the name of your lines in the place of 'my-object-name.
That is how you will identify when one of the lines is crossed. This block needs to be positiones on the 'on Tick' tab.Then you will need these blocks on the 'on Trade' tab (for buys):

That will delete all lines on the chart. You will have to duplicate both trees for sells.
-
Hello i tried to create this project but it doesnt work. No horizontal line drawn on the chart countes as a buy or sell order.
Also the status on the chart says still waitng for tick
-
Are objects defined in blocks 95 and 101 manually inserted horizontal lines? Additionally, blocks 111 and 112 ara partially overlapping each other. Both of them are programmed to deal with manual trades. You'd better avoid that by selecting manually only and automatic anly options.