NAS 2m HULL-SAR trading system

Viewing 15 posts - 31 through 45 (of 344 total)
  • Author
    Posts
  • #147201 quote
    robertogozzi
    Moderator
    Master

    @Matchsolo

    Always use the ‘Insert PRT Code’ button when putting code in your posts to make it easier for others to read.

    Thanks 🙂

    #147207 quote
    nonetheless
    Participant
    Master

    Yes, i’m getting the same error message today although backtests worked fine at the weekend. For now I’m running tests without tick by tick and getting the same results that I got at the weekend with tick by tick checked.

    #147213 quote
    turame
    Participant
    Master

    I am reassured to note that I am not the only one…

    #147214 quote
    ullle73
    Participant
    Senior

    paul, could you send the complete version of yours? 🙂

    #147229 quote
    nonetheless
    Participant
    Master

    new version with Paul’s TS and modification to the MaxPositionsAllowed code – thanks to @fifi743

    boonet, Paul and fifi743 thanked this post
    #147241 quote
    Paul
    Participant
    Master

    Looks very nice and found more performance! I start doubting too btw how the tick by tick & spread is handled with cumulative positions.

    ullle73, there are too many changes i’am making (layout) and still experimenting.

    About the strategy, i’am taking another approach. The equitycurve is very nice, however it’s depended on multiple positions, which could be a warning? I’am not sure.

    So i’am testing a different way to see if it can work with 1 position, but taking every signal into account. And that works too it seems.

    Nonetheless, try set maxallowedpositions to 1. Something seems off if that’s used in v5

    Here’s an early pic with 1 position.

    #147257 quote
    nonetheless
    Participant
    Master

    this is v5 with max positions =1

    looks ok to me, except that it’s with tick by tick unchecked. the result is consistent with what i was seeing at the weekend though, so seems to me that either this result is correct or none of our results is correct.

    are you getting backtests with t-b-t ?

    #147290 quote
    deletedaccount051022
    Participant
    New

    Hi

    Thank you very much for sharing this strategy, it’s a great approach to run a strategy with just a few entry criteria.  I  have been learning to keep entry signals to a minimum, and that the exit and position sizing are as important as the entry signals (highly recommend ‘Quantitative Trading’ by E. Chan, and ‘Building Winning Algorithmic Trading Systems’ by K. Davey).  I ran the results of the latest strategy through a Monte Carlo Simulatro (provided by the author of the second book) which uses a random sampling and replacement approach.  The parameters I’ve used are below, but it’s another way of looking at a strategy to test it’s future robustness.

    Capital: 3,000

    Risk per trade: 5

    As you can see, even at these levels, the risk of ruin is only 4%, provided you can live with a 33.3% drawdown.  Keeping the Risk per trade constant, it would be wiser to run a starting equity of closer to 5,000.

    Regardless, it’s another way of seeing how it may perform in the future, and the results are very strong.  Thank you once again.

    HannesA thanked this post
    #147292 quote
    deletedaccount051022
    Participant
    New

    Results from the PRT platform with the same test parameters, for comparison.

    #147361 quote
    Paul
    Participant
    Master

    The test I did was with tbt. Didn’t check the difference with on/off. But I’ve lost my settings (own fault) for that equitycurve. That was without optimised sl/pt & ts.

    In demo strategy, one trade exits on stoploss and positionsize went from 8 to 7. I thought in the live version it only can go from 8 to 0, maybe with exception of exits on stoploss?

    #147573 quote
    Roger
    Participant
    Veteran

    new version with Paul’s TS and modification to the MaxPositionsAllowed code – thanks to @fifi743

    Thanks for the great work. I ve spotted an error concerning the enter conditions : when you use CountOfPosition when you are short on market, the result is negative so you need to use ABS function. Otherwise the condition is always true and you can sellshort an unlimited number of contracts.

    IF Ctime and c1 and c1a AND C3 and c3a AND C5 and c5a and abs(CountOfPosition) <= MaxPositionsAllowed THEN
    
    IF Ctime and c2 and c2a AND C4 and c4a AND C6 and c6a and abs(CountOfPosition) <= MaxPositionsAllowed THEN
    
    #147611 quote
    Roger
    Participant
    Veteran

    Sorry the correct code is :

     

    // Conditions to enter long positions
    IF Ctime and c1 and c1a AND C3 and c3a AND C5 and c5a and abs(round(CountOfPosition/positionsize)) < MaxPositionsAllowed THEN
    BUY positionsize CONTRACT AT MARKET
    SET STOP %LOSS 1.3
    SET TARGET %PROFIT 2
    ENDIF
     
    // Conditions to enter short positions
    IF Ctime and c2 and c2a AND C4 and c4a AND C6 and c6a and abs(round(CountOfPosition/positionsize)) < MaxPositionsAllowed THEN
    SELLSHORT positionsize CONTRACT AT MARKET
    SET STOP %LOSS 1.1
    SET TARGET %PROFIT 1.4
    ENDIF
    GraHal thanked this post
    #147618 quote
    nonetheless
    Participant
    Master

    I ve spotted an error concerning the enter conditions

    Thanks Roger, you’re absolutely right, it won’t work the way it was. I went for a slightly different solution:

    Once MaxPositionsAllowed = 5*positionsize
    
    // Conditions to enter long positions
    IF Ctime and c1 and c1a AND C3 and c3a AND C5 and c5a and COUNTOFLONGSHARES <= MaxPositionsAllowed THEN
    BUY positionsize CONTRACT AT MARKET
    SET STOP %LOSS 1.3
    SET TARGET %PROFIT 2.1
    ENDIF
     
    // Conditions to enter short positions
    IF Ctime and c2 and c2a AND C4 and c4a AND C6 and c6a and COUNTOFSHORTSHARES <= MaxPositionsAllowed THEN
    SELLSHORT positionsize CONTRACT AT MARKET
    SET STOP %LOSS 1
    SET TARGET %PROFIT 1.4
    ENDIF

    This uses a different definition of “Maxpositionsallowed” – not the total number of contracts, but the number of entries regardless of size. This way it will work with MM as the positionsize changes.

    GraHal, Paul and NickBeam thanked this post
    #147665 quote
    nonetheless
    Participant
    Master

    Here’s another variation using 1m, 5m, 15m with the alternative entry conditions (beginning the run when the 5m changes direction, then adding positions on each 1m dip). Goes without saying that it is curve fit to these few months, but could be worth forward testing on demo to see how it plays out.

    boonet, fifi743, swedshare, Roger and Midlanddave thanked this post
    #147668 quote
    fifi743
    Participant
    Master

    Hi nonetheless
    You add this line at the end of the algo and make a test?

    Mrsi=RSI[14](close)
    if longonmarket and CurrentDayOfWeek=5 and close>positionprice and Mrsi crosses under 70 then
    sell at market
    endif
    if shortonmarket and CurrentDayOfWeek=5 and close<positionprice and Mrsi crosses over 30 then
    exitshort at market
    endif
    boonet thanked this post
Viewing 15 posts - 31 through 45 (of 344 total)
  • You must be logged in to reply to this topic.

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 bege
3 years, 1 month ago.

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