Unable to back test RSI and Hull average strategy

Forums ProRealTime English forum ProOrder support Unable to back test RSI and Hull average strategy

Viewing 15 posts - 1 through 15 (of 54 total)
  • #132563

    Hi,

    I am trying to automate a possible system I use manually and unable to back test it?…….this is a first for me. It doesn’t want to back test irrespective of the dates I insert? It uses, standard RSI indicator, 15 and 30 Hull moving averages all with 5000 tick time frame. I have attached a file of the possible system – what am I doing wrong? It sounds simple in theory but not working – I’ve obviously missed something? Sorry I’m not a programmer

    Basically, for a LONG – RSI to reach 29 or less, then confirmation of long to be 15 Hull crossing above 30 Hull……….Trade closing to be  – RSI to reach 71 or more and  15 Hull crossing below 30 Hull to close the trade, that’s it !!

    Basically, for a SHORT – RSI to reach 71 or more, then confirmation of short to be 15 Hull crossing under 30 Hull……….Trade closing to be  – RSI to reach 29 or less and  15 Hull crossing above 30 Hull to close the trade, that’s it !!

    Ideally, when in long mode, until it reaches closing ie.  the RSI to reach 71 or more and close of 15 Hull crossing below 30 Hull, I would like it to buy any subsequent 15 Hull crossing above 30 Hull on the way up adding to the original position…….same for short mode………

    Any help greatly appreciated.  Mike

     

    #132568

    bearbull – Welcome to the forums.

    It is much easier if you use the ‘Insert PRT Code’ button and then add the code to your post rather than expecting others to launch their platforms and then download and save your file and then import it just to see your code.

    Also always try to give your topics meaningful titles as required by the forum rules otherwise we end up with a forum full of topics all with the same title. I will edit your title.

    #132572

    Ok Vonasi – noted, here is the code which I have inserted via ‘Insert PRT code’ button………i hope.

     

    #132573

    unable to back test it?…….this is a first for me. It doesn’t want to back test irrespective of the dates

    Do you mean you get an error message or you just get no trades when you do backtest?

    Change Crosses Over / Under for > and < and you will get attached.

    Or maybe keep the Over / Under and change the values of the RSI?

    #132577

    There is no Hull MA in your code.

    #132578

    Perhaps your conditions are never met or a trade is opened and exit conditions are never met so it is still open on the latest bar but shows as no trades..

    Run this dummy version of your strategy and you will simply see when conditions are met.

    • 1 = BUY
    • -1 = SELL
    • 2 = SELLSHORT
    • -2 = EXITSHORT

     

    #132581

    If you have v11 then you can use HullAverage[15](close)

    Otherwise you need to hard code it:

    I tend to prefer typicalprice, (high + low + close)/3 but you can change that to (close) if you want.

    #132582

    Wow thank you for that prompt response.

    Prior to posting on here, I originally coded it with the ‘simplified creation‘ version of doing things, which is really cool for a novice like me, but doesnt work.

    I copied and pasted your code into a new Trading System file, after deleting the template instructions therein and leaving the form blank for your code that I inserted, but still nothing, zero results?!

    Could it possibly be the 5000 tick time frame that it doesn’t like?

    #132583

    5000 ticks on the DJ is around 50 minutes. Try with 1 hour, see what you get. Most people tend to use minutes / hours etc as a TF

    #132585

    I am using the ProTrend  version 10.3 and when coding in the “simplified version” which I did originally,  it clearly shows the hull moving averages.

    I tried using a 1 hour time frame but still nothing? 5000 tick time frame smooths it all out coupled with the two smooth Hulls it works well. Just want to back test it over a large period.

    thanks

    #132590

    For some reason the Hull Average is shown in 10.3 strategy creation tool but it only exists in v11 and defaults to a simple moving average in v10.3.

    You will have to hard code it in your strategy using the code provided by nonetheless.

    Also as nonetheless says 5000 ticks will take barely any time at all on an instrument such as the DJI so you will need to switch to a slower time frame if you want lots of data to test on.

    The code I provided you with was a dummy strategy that takes no trades but just plots a graph to show you any time that your conditions were met. If you got a flat line at zero then your conditions were never met which will be why you got no trades.

    #132597

    If the 5000 tick time frame works then just change the number of units to go further back. You’ll have at least 100k units, or 200k if you have the Premium version.

    #132613

    Guys thanks for your inputs and I have taken this on board. As nonetheless mentioned 5000T is around 50 mins or so.

    Nonetheless I will code those 15 and 30 Hull moving averages into Vonasi dummy code and see what happens.

    After thinking about it, in lay-mans terms  – can you advise if the programmed conditions mean that the trades will only be triggered if both the RSI and HULL cross over happen simultaneously? Hence no signals?

    I want it so the first condition RSI is met then after however long its takes (even if the RSI moves away from the original condition ) that the trade is only taken if the 15/30 Hull cross over.

    Perhaps I should get some screen shots to explain.

    Again thanks Guys, I appreciate your time

     

    #132622

    There is no cross over of the RSI in your code it is either above  71 or below 29 so any cross of the MA’s whilst the RSI is anywhere from 0 to 29 or 71 to 100 will be a condition met.

    If you want the RSI crossing under 29 or over 71 to be your first trigger then hold out for an MA cross no matter what the value of the RSI then you need to set a flag to show that the cross has happened.

    Something like this (long only shown):

     

    #132626

    Vonasi, you’ve hit the nail on the head!!

    Ok i will try to merge all this info together.

    Again many thanks for your help in this.

     

    Mike

Viewing 15 posts - 1 through 15 (of 54 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login