Get name of the horizontal line
-
Hello everyone
i am trying to make sort of a delayed stoploss , the main idea is to place a trade with a stoploss , and then the ea will automatically remove the stoploss and place a line where the stoploss was, and when the price is <= the line for a certain amount of time then close that trade.
there are 2 parts of the ea ,
1: first part detects the sl and places a horizontal line on the sl price and then remove the sl , while keeping the horizontal line on the chart, and the ticket number of the trade is used as name of the horizontal line to identify which horizontal line is associated to which trade on the chart.2: second part where the ea detects which line has been crossed and get the name of that line , (this name will be used to close the trade with which has the same ticket number as the name of the horizontal line )
closing and counting time delay isnt a big problem ,but i cant figure out how to start with the second part of the ea i-e how to detect which line has been breached and get the name of that line
here is my sample project https://fxdreema.com/shared/g7DbBmeJc
i will highly appreciate if someone can help me in figuring out how to do the second part
thanks -
@roar @miro1360 @fxdreema-1 can you guys please help
-
@zackry I would try something like this
https://fxdreema.com/shared/CLFOrVlpbPersonally I wouldn't rely on objects, though.. More safe approach would be to store the levels in an array, and make another array (or dimension) for the ticket numbers. Just in case you want to consider it - I'm not going to walk you through that lol
-
@roar funny story , you might not believe me but i was just looking into the arrays myself , and yeah you are absolutely right array would be a better option to do it
-
@zackry The only way to get what line has been crossed is checking it tick by tick. You should try it on the 'on tick' tab.