I’m fully aware that we can use the code below to set a stop loss of 20 points but this is visible to the broker.
1
SET STOPPLOSS20
Twice now, my stop loss has been hit by 1 or 2 points and then gone on to achieve the 100 point target. This annoys me.
I’m assuming it would be possible to not set a stop loss as above but to achieve it via code. Yes I’m aware this would carry more risk but has anyone done this who could share their code?
Yes, but be aware that your code would be only read once per bar and thus the stoploss triggered much larger than your “manualstoploss” value. It would not be so important in a 1 second timeframe, but a lot more in an 1 hour one obviously 🙂
To help us continually offer you the best experience on ProRealCode, we use cookies. By clicking on "Continue" you are agreeing to our use of them. You can also check our "privacy policy" page for more information.Continue