Stop loss placement and guaranteed stop losses

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #124401 quote
    jayvee
    Participant
    Average

    Greetings – hope everyone is keeping well and safe. Salute to all those helping!

    I have a question around the placement of stop losses and was hoping someone could help. Do you place them after a condition such as

    IF Bearish0 THEN
    SELLSHORT (100/(atr)) perpoint AT MARKET
    set stop loss (atr)
    ENDIF

    or is it done separate after the condition such as

    IF Bearish0 THEN
    SELLSHORT (100/(atr)) perpoint AT MARKET
    ENDIF
    
    set stop loss (atr)

    I noticed you get different results and I couldn’t understand why?

    Also when setting up for automatic trading, there’s an option to select ‘use guaranteed stops’ – part of the condition of using this feature as stated when you hover over the blue bubble is “guaranteed stops must be attached at the time the position is opened or a buy/sell order is placed (in your code, the instruction SET STOP LOSS can not be placed within a condition)”.

    Does this mean to use this feature you have to have the ‘set stop loss’ separate as per the second code example above?

    #124413 quote
    Vonasi
    Moderator
    Master

    If in your code the value of atr changes at the close of every bar then in your first example only when bearish0 is true a new stop order will be sent to the market with the new value. In your second example an order with the new value will be sent at the close of every candle no matter what. That is why you have different results. Anything in an IF  THEN ENDIF will only happen when the conditions are met and your order is in one in the first example.

    As for guaranteed stops I have no experience of them I’m afraid but I guess that if you want to use them then from what the T&C’s say you can only use them as per your second example.

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

Stop loss placement and guaranteed stop losses


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
jayvee @jayvee Participant
Summary

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

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