Stop Loss at last swing low

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #121803 quote
    George Summers
    Participant
    New

    Hi All,

    I’m new to automated trading so your kind help would be much appreciated.

    I want to provide a stop loss at the last swing low, for example just below the low (e.g. 2 points) of the last 3 bars, however, I want the stop to be fixed at that price and not trail (not last 3 bars from current bar as time passes).

    Thanks very much 🙂

    Kindest Regards,

    George

    #121807 quote
    robertogozzi
    Moderator
    Master

    You have to set your Stop Loss when you place an order, so it will not move (LONG example):

    IF MyLongConditions AND Not OnMarket THEN
       BUY 1 CONTRACT AT MARKET
       SET STOP LOSS abs(close - (lowest[3](low) - 3 * pipsize))
    ENDIF
    George Summers thanked this post
    #121808 quote
    George Summers
    Participant
    New

    Hi Roberto,

    Thank you very much, I will give it a shot.

    George

    #121809 quote
    George Summers
    Participant
    New

    Hi Roberto,

    Yep, that works.

    And if I wanted to set my profit say 2 times my risk?

    Thanks again.

    George

    #121820 quote
    robertogozzi
    Moderator
    Master

    Then you have to save your stop loss in a variable, then use it with a multiplier:
    [scode]
    IF MyLongConditions AND Not OnMarket THEN
    BUY 1 CONTRACT AT MARKET
    SL = abs(close – (lowest[3](low) – 3 * pipsize))
    SET STOP LOSS SL
    SET TARGET PROFIT SL * 2
    ENDIF
    [/scode]

    George Summers thanked this post
    #122103 quote
    George Summers
    Participant
    New

    Thanks again Roberto.

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

Stop Loss at last swing low


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 5 replies,
has 2 voices, and was last updated by George Summers
5 years, 11 months ago.

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