Manual stop loss – call me paranoid but…!

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #35771 quote
    robdav
    Participant
    Veteran

    Hi

    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.

    SET STOP PLOSS 20

    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?

    Thanks

    Rob

    #35773 quote
    robdav
    Participant
    Veteran

    Does this seem correct please?

    manualstoploss = 20 // manual stop loss pips/points
    
    // LONGS
    // Test if the price has moved to the manual stop loss level
    
    IF LONGONMARKET AND close-tradeprice(1)>=manualstoploss*pipsize THEN
     SELL AT MARKET
    ENDIF
     
    // SHORTS
    // Test if the price has moved to the manual stop loss level
    
    IF SHORTONMARKET AND close+tradeprice(1)>=manualstoploss*pipsize THEN
     EXITSHORT AT MARKET
    ENDIF
    

    Cheers

    Rob

    #35775 quote
    Nicolas
    Keymaster
    Master

    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 🙂

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Manual stop loss – call me paranoid but…!


ProOrder support

New Reply
Author
author-avatar
robdav @robdav Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by Nicolas
8 years, 8 months ago.

Topic Details
Forum: ProOrder support
Language: English
Started: 05/17/2017
Status: Active
Attachments: No files
Logo Logo
Loading...