Stops in relation to previous candles/bars

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #9585 quote
    Dymjohn
    Participant
    Senior

    Is it possible to set a moving stop at the level of say low of candle three candles ago less 2 points.

    e.g. entry price 6500, low of three candles ago 6420 so stop 6418.

    on next bar price 6490 low of 3 bars ago 6645 so stop 6643?

    #9589 quote
    Nicolas
    Keymaster
    Master

    Yes, you can code it this way:

    SELL AT Low[3]-2*pipsize STOP

    (for a long position).

    #9610 quote
    Dymjohn
    Participant
    Senior

    Hi Thanks for the information. I’d worked something similar out.

    Firstly, I’d put the following

    BuyPrice = High[1]+2*Pipsize

    then the instruction to buy:

    BUY 1 SHARES AT BuyPrice STOP

    However, I don’t think it works as I’ve been unable to establish how the tester sets the buy price. I have concerns about the tester as I thought reducing the trailing stop would reduce my profits in test mode but they increase e.g. trailing stop on DAX (a volatile market) reducing trail from 10 to 7 increased profit. Even 10 in my view will lead to many stop outs.  Is my scepticism unfounded?

    #9616 quote
    Nicolas
    Keymaster
    Master

    What you have coded don’t act as a stoploss, but as a pending buy stop order instead, above the current price. My code refer to a sell stop order to sell the current long position.

    #9622 quote
    Dymjohn
    Participant
    Senior

    Thanks Nicolas,

    I think I confused myself trying to solve both my entry point and stop loss. Have you any thoughts about the tester and the apparent anomaly of reducing a tight stop and improving profitability of the strategy?

    #9624 quote
    Nicolas
    Keymaster
    Master

    The profitability of which strategy? 🙂

    #31870 quote
    Menghan
    Participant
    Junior
    "SELL" AT Low[3]-2*pipsize STOP
    
    i want to know how to do "sell" become "set STOP LOSS"or"set target profit"
    
    sorry,nicolas my english not well.
Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.

Stops in relation to previous candles/bars


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Dymjohn @dymjohn Participant
Summary

This topic contains 6 replies,
has 3 voices, and was last updated by Menghan
8 years, 10 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 06/20/2016
Status: Active
Attachments: No files
Logo Logo
Loading...