Sell after a sharp rise

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

    Hi. What code would you use to sell after the price has gone up sharply (out of ordinary) and is about to retrace? I use If Close – Close[n] > X but I wonder what other people use.

    S-2017-11-03-at-09.19.57-.png S-2017-11-03-at-09.19.57-.png
    #51368 quote
    robertogozzi
    Moderator
    Master

    Yes, you will have to compare “n” candles’ closing/highest/lowest prices or ranges, i.e.:

    // n        = number of lookback candles
    // PipLimit = number of pips to be considered as a sudden surge
    //
    //     check CLOSING prices
    IF (close - close[n]) * pipsize > PipLimit  THEN //check if BULLish surge of at least ... pips
    IF (close[n] - close) * pipsize > PipLimit  THEN //check if BEARish surge of at least ... pips
    //     or chech HIGHs/LOWs
    IF (high - high[n])   * pipsize > PipLimit  THEN //check if BULLish surge of at least ... pips
    IF (low[n] - low)     * pipsize > PipLimit  THEN //check if BEARish surge of at least ... pips
    //     or check RANGEs
    IF (range - range[n]) * pipsize > PipLimit  THEN //check if BULLish surge of at least ... pips
    IF (range[n] - range) * pipsize > PipLimit  THEN //check if BEARish surge of at least ... pips

    Everyone has his own way of measuring a spike, there’s no guarantee that one of them is the best.

    Roberto

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

Sell after a sharp rise


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Mansoor @mansoor Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzi
8 years, 4 months ago.

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