Buying an Outside candle via BuyStop

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #146974 quote
    f1_maik
    Participant
    Junior

    How do I program this?

    Stopbuy at  High Outside + 25% * (High of the Outsidecandle -Low of the Outsidecandle)

    the stopbuy should only be executed within the next 3 candles

    Target Profit = High Outside + 50% *  (High of the Outsidecandle – Low of the Outsidecandle)
    Stop Loss = Low Outsidecandle

    #146996 quote
    robertogozzi
    Moderator
    Legend

    There you go (not tested):

    Defparam CumulateOrders = false
    Outside1 = high > high[1] and low < low[1]
    Outside2 = max(open,close) > max(open[1],close[1])
    Outside3 = min(open,close) < min(open[1],close[1])
    OutsideBar = Outside1 and Outside2 and Outside3
    If OutsideBar then
       Entry = high + (range * 0.25)
       TP     = abs(Entry - (high + (range * 0.50)))
       SL     = abs(Entry - low)
    Endif
    If summation[3](OutsideBar) then
       Buy 1 contract at Entry STOP
       Set Target Profit TP
       Set Stop    Loss   SL
    Endif
    f1_maik thanked this post
    #147001 quote
    f1_maik
    Participant
    Junior

    i thank you very much

    #147065 quote
    f1_maik
    Participant
    Junior

    Maybe one more step back. Maybe you can help me again.

    I understand that this part of code,  define entry, sl, tp – correct?

    If OutsideBar then
       Entry = high + (range * 0.25)
       TP     = abs(Entry - (high + (range * 0.50)))
       SL     = abs(Entry - low)
    Endif

     

     

    Which part of the code says that the StopBuy is only executed with the next 3 candles? With this one?

    If summation[3](OutsideBar) then
       Buy 1 contract at Entry STOP
       Set Target Profit TP
       Set Stop   Loss   SL
    Endif
    
    

    and if so and I would set n=5, then the StopBuy would only be possible within the next 5 candles – correct?

    n = 5
    If summation[n](OutsideBar) then
       Buy 1 contract at Entry STOP
       Set Target Profit TP
       Set Stop    Loss   SL
    Endif

     

    Allright?

    #147067 quote
    robertogozzi
    Moderator
    Legend

    All of your assumptions are correct.

    #147157 quote
    f1_maik
    Participant
    Junior

    So fine and a big thank you to you.

    The first step of the strategie is done.

    robertogozzi thanked this post
Viewing 6 posts - 1 through 6 (of 6 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

Buying an Outside candle via BuyStop


ProOrder: Automatischer Handel & Backtesting

New Reply
Author
author-avatar
f1_maik @f1_maik Participant
Summary

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

Topic Details
Forum: ProOrder: Automatischer Handel & Backtesting
Language: German
Started: 10/10/2020
Status: Active
Attachments: No files
Logo Logo
Loading...