Stops in relation to previous candles/bars

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #9585 quote
    DymjohnDymjohn
    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
    NicolasNicolas
    Keymaster
    Legend

    Yes, you can code it this way:

    SELL AT Low[3]-2*pipsize STOP

    (for a long position).

    #9610 quote
    DymjohnDymjohn
    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
    NicolasNicolas
    Keymaster
    Legend

    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
    DymjohnDymjohn
    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
    NicolasNicolas
    Keymaster
    Legend

    The profitability of which strategy? 🙂

    #31870 quote
    MenghanMenghan
    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.
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

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 MenghanMenghan
9 years, 5 months ago.

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