stop loss linked to a moving average

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #140796 quote
    George65
    Participant
    Senior

    Hi,

     

    Can someone help me please how I can give a stop loss order with the SMA?

    I’ve tried it two different ways, none of them are executed.

    1. IF not longonmarket and c1 and c2 and c3 and c9 THEN
      BUY 1 CONTRACT AT MARKET
      set stop loss Average[20](close)
    2. IF not longonmarket and c1 and c2 and c3 and c9 THEN
      BUY 1 CONTRACT AT MARKET
      sell at Average[20](close) stop

    thanks

    George

    #140803 quote
    robertogozzi
    Moderator
    Master

    The correct form is:

    1. stop loss abs(close – Average[20](close))      because SET STOP LOSS requires a difference in price, not a price
    2. correct, provided the current price (CLOSE) il higher than Average[20]
    #140808 quote
    George65
    Participant
    Senior

    Thanks Roberto for your support!

    Though you write version 2 is correct, it is not executed.

    I’ll try version 1

    Thanks again!

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

stop loss linked to a moving average


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
George65 @george65 Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by George65
5 years, 6 months ago.

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