IDNR4 STRATEGY

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #38448 quote
    enzo_52enzo_52
    Participant
    Senior

    HI , I wanted to ask SOMEONE, if I’m not too disturbed, TO SOMEONE GOOD IN the break-out strategies, if you could tell me how to modify the following code of a TS on the IDNR4 pattern,the TS goes long to overcome of candle -high ,and sellshort to inverse conditions, but IDRN4 writer says that if we enter long (or shortsell) and prices go-back and break the minimum of the same set- Up candle the system close the trade long and open sell-short , the author says it could have up to 3 false breaks after which the Ts goes flat

     

    THANKS

     

    ID = high<high[1] and low>low[1]
    rang = range
    NR4 = rang<range[1] and rang<range[2] and rang<range[3]
    
    if NR4 then
    test = 1
    hh = highest[4](high)
    ll = lowest[4](low)
    endif
    
    if test = 1 then
    BUY 1 SHARE AT hh STOP
    SELL 1 SHARE AT ll STOP
    endif
    
    if longonmarket then
    SELL AT ll STOP
    test = 0
    elsif shortonmarket then
    EXITSHORT AT hh STOP
    test = 0
    endif
    #153301 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    I just read this topic.

    Line 5 should be replaced by:

    if ID and NR4 then

    In any case, this is the correct code, modified as you requested, no more than 3 trades until a new patterns occurs. I also added a Target Profit equal to the range HH-LL  (not tested):

    DEFPARAM CumulateOrders = false
    ID   = high<high[1] and low>low[1]
    NR4  = range<range[1] and range<range[2] and range<range[3]
    if ID and NR4 then
       count = 0
       hh    = highest[4](high)
       ll    = lowest[4](low)
    endif
    If StrategyProfit <> StrategyProfit[1] then
       count = count + 1
    endif
    if count < 3 then
       If not LongOnMarket THEN
          BUY       1 SHARE AT hh STOP
       Elsif not ShortOnMarket THEN
          SELLSHORT 1 SHARE AT ll STOP
       Endif
       SET TARGET PROFIT hh - ll
    endif
    GraHal thanked this post
Viewing 2 posts - 1 through 2 (of 2 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

IDNR4 STRATEGY


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
enzo_52 @enzo_52 Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzirobertogozzi
5 years, 10 months ago.

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