NAS 2m HULL-SAR trading system

Viewing 15 posts - 226 through 240 (of 344 total)
  • Author
    Posts
  • #165907 quote
    RyuginRyugin
    Participant
    Senior

    I am referring to NAS-2m-HULL-SAR-v5.3L and NAS-2m-HULL-SAR-v5.3-L, it happened the same on both versions (at least in my account). Did you have the same problem?

    #165912 quote
    nonethelessnonetheless
    Participant
    Master

    No, I haven’t seen that. I’m running v5.5, it opened 2 positions, still open with the trail in place, behaving as it should.

    What I have found is that the Target Profit doesn’t register, and maybe has to be entered after each buy instruction, but that won’t effect the Trail.

    // Conditions to enter long positions
    if tradetype=1 or tradetype=2 then
    IF not longonmarket and CB and Flag THEN
    BUY positionsize CONTRACT AT MARKET
    SET STOP %LOSS sl
    SET TARGET %PROFIT tp
    elsif Ctime and longonmarket and CB2 and COUNTOFLONGSHARES < MaxPos and Flag then
    BUY positionsize CONTRACT AT MARKET
    SET STOP %LOSS sl
    SET TARGET %PROFIT tp
    Flag = 0
    elsif longonmarket and CB2 and positionperf <0 and COUNTOFLONGSHARES < MaxPos2 and Flag1 then
    BUY positionsize CONTRACT AT MARKET
    SET STOP %LOSS sl
    SET TARGET %PROFIT tp
    Flag1 = 0
    elsif longonmarket and CB2 and positionperf <0 and COUNTOFLONGSHARES < MaxPos2 and Flag2 then
    BUY positionsize CONTRACT AT MARKET
    SET STOP %LOSS sl
    SET TARGET %PROFIT tp
    Flag2 = 0
    elsif longonmarket and CB2 and positionperf <0 and COUNTOFLONGSHARES < MaxPos2 and Flag3 then
    BUY positionsize CONTRACT AT MARKET
    SET STOP %LOSS sl
    SET TARGET %PROFIT tp
    Flag3 = 0
    ENDIF
    ENDIF
    Ryugin and Midlanddave thanked this post
    #165965 quote
    OboeOptOboeOpt
    Participant
    Veteran

    Is anyone running v5.3 SHORT (Tradetype = 3 to go Short) on a real account, in any market, without problems?
    See #165505 for what i´m struggeling with.

    #165967 quote
    nonethelessnonetheless
    Participant
    Master

    I had a quick look at DJ 2m HULL-SAR v5.3S and I think there’s something wrong with the trail – try replacing it with this. Backtests ok but I haven’t tried running it.

    The DJ looks like it might have some potential going short, I don’t think the NAS is worth the effort.

    // %trailing stop function incl. cumulative positions
    once trailingstoptype1= 1
    if trailingstoptype1 then
    //====================
    trailingpercentlong  = .28 // %
    trailingpercentshort = TP02 // %
    once acceleratorlong = .029 // [1] default; always > 0 (i.e. 0.5-3)
    once acceleratorshort= ACC0022 // 1 = default; always > 0 (i.e. 0.5-3)
    ts2sensitivity  = 2 // 1 = close 2 = High/Low 3 = Low/High 4 = typicalprice (not use once)
    //====================
    once steppercentlong  = (trailingpercentlong/10)*acceleratorlong
    once steppercentshort = (trailingpercentshort/10)*acceleratorshort
    if onmarket then
    trailingstartlong = positionprice*(trailingpercentlong/100)
    trailingstartshort = positionprice*(trailingpercentshort/100)
     
    trailingsteplong = positionprice*(steppercentlong/100)
    trailingstepshort = positionprice*(steppercentshort/100)
    endif
     
    if not onmarket or ((longonmarket and shortonmarket[1]) or (longonmarket[1] and shortonmarket)) then
    newsl           = 0
    mypositionprice = 0
    endif
    positioncount = abs(countofposition)
    if newsl > 0 then
    if positioncount > positioncount[1] then
    if longonmarket then
    newsl = max(newsl,positionprice * newsl / mypositionprice)
    else
    newsl = min(newsl,positionprice * newsl / mypositionprice)
    endif
    endif
    endif
    if ts2sensitivity=1 then
    ts2sensitivitylong=close
    ts2sensitivityshort=close
    elsif ts2sensitivity=2 then
    ts2sensitivitylong=high
    ts2sensitivityshort=low
    elsif ts2sensitivity=3 then
    ts2sensitivitylong=low
    ts2sensitivityshort=high
    elsif ts2sensitivity=4 then
    ts2sensitivitylong=typicalprice
    ts2sensitivityshort=typicalprice
    endif
    if longonmarket then
    if newsl=0 and ts2sensitivitylong-positionprice>=trailingstartlong*pipsize then
    newsl = positionprice+trailingsteplong*pipsize
    endif
    if newsl>0 and ts2sensitivitylong-newsl>=trailingsteplong*pipsize then
    newsl = newsl+trailingsteplong*pipsize
    endif
    endif
    if shortonmarket then
    if newsl=0 and positionprice-ts2sensitivityshort>=trailingstartshort*pipsize then
    newsl = positionprice-trailingstepshort*pipsize
    endif
    if newsl>0 and newsl-ts2sensitivityshort>=trailingstepshort*pipsize then
    newsl = newsl-trailingstepshort*pipsize
    endif
    endif
    if barindex-tradeindex>1 then
    if longonmarket then
    if newsl>0 then
    sell at newsl stop
    endif
    if newsl>0 then
    if low crosses under newsl then
    sell at market
    endif
    endif
    endif
    if shortonmarket then
    if newsl>0 then
    exitshort at newsl stop
    endif
    if newsl>0 then
    if high crosses over newsl then
    exitshort at market
    endif
    endif
    endif
    endif
    mypositionprice = positionprice
    endif
    OboeOpt and thanked this post
    #165977 quote
    OboeOptOboeOpt
    Participant
    Veteran

    Thanks nonetheless!

    For me the algo has stopped within a few seconds after start, so no positions then. But maybe still can be problems with the trail? I will try your code!

    I have cumulative = false, but maybe that doesn´t matter with your code above?

    #165983 quote
    OboeOptOboeOpt
    Participant
    Veteran

    I tried you code on DOW 5.3S but I get:

    “The trading system was stopped because the historical data loaded was insufficient to calculate at least one indicator during the evaluation of the last candlestick.”

    I got the same after changing to Preloadbars = 15000

    #165985 quote
    nonethelessnonetheless
    Participant
    Master

    in backtest or  autotrading?

    #165986 quote
    OboeOptOboeOpt
    Participant
    Veteran

    autotrading

    Well, if you (or anyone else) gets 5.3 to work for shorts on any market I would be very interested to test it!

    #167028 quote
    LaurentBZH35LaurentBZH35
    Participant
    Average

    I will try DJ 2m HULL-SAR v5.3S and tell you back

    Boris and OboeOpt thanked this post
    #167054 quote
    LaurentBZH35LaurentBZH35
    Participant
    Average

    Here is the backtest of Dow 2m Hull SAR v5.3S.

     

    Looks good in 200k in short only

    Dow-2m-Hull-SAR-v5.3S-200k.jpg Dow-2m-Hull-SAR-v5.3S-200k.jpg
    #167056 quote
    LaurentBZH35LaurentBZH35
    Participant
    Average

    I curiously has trouble when i want launch in autotrading the Dow 2m Hull SAR v5.3S

     

    Line 24. Message say end of code ?

    default-line-24.jpg default-line-24.jpg
    #167058 quote
    FrancescoFrancesco
    Participant
    Veteran

    I curiously has trouble when i want launch in autotrading the Dow 2m Hull SAR v5.3S

    Line 24. Message say end of code ?

    You can’t launch the system in autotrading because there are variables in the optimization boxes; you have first to define the values through the code, delete the optimization boxes and then you can run it.

    #167059 quote
    LaurentBZH35LaurentBZH35
    Participant
    Average

    Here is the backtest of Dow 2m Hull SAR v5.3S.

    And looks good too in 1M barres

    Dow-2m-Hull-SAR-v5.3S-1M.jpg Dow-2m-Hull-SAR-v5.3S-1M.jpg
    #167061 quote
    LaurentBZH35LaurentBZH35
    Participant
    Average

    You can’t launch the system in autotrading because there are variables in the optimization boxes; you have first to define the values through the code, delete the optimization boxes and then you can run it.

    I don’t think i have to do it with the last version of prorealtime V11.

     

    The problem doesn’t come from it in my opinion

    #167062 quote
    GraHalGraHal
    Participant
    Legend

    Line 24. Message say end of code ?

    It may be that the code needs an extra Endif adding as the last line of the code?

    LaurentBZH35 thanked this post
Viewing 15 posts - 226 through 240 (of 344 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

NAS 2m HULL-SAR trading system


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 343 replies,
has 42 voices, and was last updated by begebege
3 years, 9 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 10/09/2020
Status: Active
Attachments: 129 files
ProRealCode ProRealCode
Loading...