Stop loss from horizontal line

 

Hello, I am currently using an EA that places two line on the chart. When price touches the top one it order a buy order an the botton one a sell order.

 

Is it possible instead of using a fixed stop loss value, draw two other lines on the chart, one BuyOrderStopLoss and SellOrder StopLoss, so that when a buy or sell order is activated

the stop loss is put automatically??

I managed to draw the lines... 

 
Yes it's possible. What is your problem ?
 

How to I do it ?

 
ovatsug:

How to I do it ?

Show your attempt if you want help.
 
Alain Verleyen:
Show your attempt if you want help.

[ decompiled code removed ]

 

I manage to draw the line, but it is referenced instead of pips its uses the price as the value 

 
ovatsug:

[ decompiled code removed ]

 

I manage to draw the line, but it is referenced instead of pips its uses the price as the value 

You may not be aware, but the code you posted was decompiled.

It is strictly prohibited to post decompiled code on the forums, so I have removed it.

 
ovatsug:

[ decompiled code removed ]

 I manage to draw the line, but it is referenced instead of pips its uses the price as the value 

  1. Decompiled code is stolen code. Either you are a thief, a fence, or the receiver of stolen (intellectual) property. Either way we will not be an accomplice after the fact to theft. See also https://www.mql5.com/en/forum/134317#comment_3411571

    If you post decompiled code again, you will likely be banned.

    Don't tell us you found it on the 'net: if someone stole your bank details and uploaded them on to the internet, is it OK for everyone to use them because "someone uploaded it, I don't know why I can't use that"?

  2. A line and a SL is a price.