Using Supertrend as stop loss

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #105763 quote
    AlgoAlex
    Participant
    Master

    Guys, how should I use a value in supertrend as initial stop loss?

    I don’t wanna close the order when close crosses over/under it, what I want is to use the value of Supertrend (or a moving average) at the bar of opening order as a level for stop loss.

    #105764 quote
    Nicolas
    Keymaster
    Master

    A the time you open an order, calculate the stoploss size by substracting the supertrend to the current Close:

    if condition then 
     buy at market 
     stoploss = close-supertrend[3,10]
     set stop loss stoploss
    endif

    (for a buy order, considering the Supertrend is below the price).

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

Using Supertrend as stop loss


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
AlgoAlex @alexf Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by Nicolas
6 years, 6 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 08/28/2019
Status: Active
Attachments: No files
Logo Logo
Loading...