Can I put both a variable and hard stop?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #132078 quote
    buythehighs
    Participant
    New

    Hi all, first post. Apologies if this has been covered, I tried searching and couldn’t find what I was looking for. I’m new to programming and may be missing something really obvious.

    I have set my profit target to ATR*1, and stop to ATR*3. However, I also want to have a fixed stop amount so I don’t get a blowout loss (i.e. if the loss gets to 30, just close the position).

    How would I go about doing this?

     

    // Conditions to exit long positions
    c51 = MyATR*1
    c52 = MyATR*3
    
    // Stops and targets
    SET STOP pLOSS c52
    SET TARGET pPROFIT c51
    
    #132084 quote
    Vonasi
    Moderator
    Master

    You can’t have two stop losses because price has to pass through at least one of them to get to the other one!

    You could set a minimum level though:

    MaxStop = 30
    c51 = MyATR*1
    c52 = Min(MaxStop,MyATR*3)
    
    // Stops and targets
    SET STOP pLOSS c52
    SET TARGET pPROFIT c51
    buythehighs thanked this post
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Can I put both a variable and hard stop?


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by Vonasi
5 years, 9 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 05/18/2020
Status: Active
Attachments: No files
Logo Logo
Loading...