Average True Range to create Stops

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #206805 quote
    danmseadanmsea
    Participant
    New

    Hello,

     

    I’m new to this. The strategy I want to backtest through automatic trading is fairly simple. I want to know how to set up a stop loss which is 2x the average true range reading of the entry candle.

    For example, when the 10 EMA crosses over the 150EMA, and at the candle close, the ATR reading is 8. I would like a stop loss of 16 points under the entry.

    I’m not sure if this is simple or not but if someone could help me that would be great.

    Thanks

     

    Dan

    #206813 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    There you go:

    IF MyLongConditions THEN
       MyATR = AverageTrueRange[14](close)
       BUY AT MARKET
       SET STOP LOSS MyATR * 2
    ENDIF
    danmsea thanked this post
    #206835 quote
    danmseadanmsea
    Participant
    New

    Legend thanks!

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

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

Average True Range to create Stops


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
danmsea @danmsea Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by danmseadanmsea
3 years, 9 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 01/04/2023
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...