Low Volume Reversal Strategy

Forums ProRealTime English forum ProOrder support Low Volume Reversal Strategy

Viewing 15 posts - 1 through 15 (of 17 total)
  • #176098

    Hi,

    Here is another strategy that uses 2 simple entry criteria and one filter as the core requirements.  As volume is better at the start and end of the week it doesn’t trade mid-week or Sundays.  It is an adaptation of a strategy from……Kevin Davey (well guessed).  Adapted from a Daily time frame to a 15 minute.  As you will see in the code, I have added in various snippets of code from nonetheless and robertogozzi, thank you.

    The strategy looks for a low volume bar compared to a look back period of 5 and a new lowest close over a look back period of 4 in order to go long.  As it uses volume as an entry criteria I can only back test to June 2016.

    Work in progress, but I wanted to share to see if it sparks any interest for new ideas on how to evolve it.  Walkforward has proven well so fat.  Am working on possible short entry and ways to reduce drawdown.

    Thank you, hope you enjoy and welcome any feedback.

    5 users thanked author for this post.
    #176101

    Good job samsampop. Thank you for sharing your code 🙂

     

    1 user thanked author for this post.
    #176140

    Lets try to help https://www.prorealcode.com/user/samsampop to improve his code.
    How to create good short entrys?
    How to reduce Drawdown?
    Is something from here helfull: https://docs.google.com/spreadsheets/d/1rgboqj7sVwsP9ZRhOduOefye48QMWC07jWVXCl-KJPU/edit#gid=0

    #176142

    I think this might be the most promising of the KD codes you have posted. This is a fairly quick revision, could be more room for improvement, eg short.

    I added MM, replaced the breakeven with a trail, disabled the “detect direction” (which didn’t seem to be helping), added % stop and target, re-opt the averages.

    I always use minimum size for testing (0.2), so x50 to compare with your results.

    thanks for sharing!

    4 users thanked author for this post.
    #176148

    Thanks for the improvements nonetheless.  Are these improvements possible to ad to NASDAQ Mean Reversion 

    #176150

    se minimum size for testing (0.2),

    Wow – that’s an amazing piece of work.  Thank you so much.  I am working through each of the modifications you have made to ensure I fully understand them.  What an incredible series of enhancements.

    #176159

    Are these improvements possible to ad to NASDAQ Mean Reversion

    no, each would have to be treated separately. I’ll have a look at it when I get a chance.

    #176891

    Great strategy.  Anyone got further with short?

    #177065
    s83

    Can anyone help me with this error?

    #177073

    Remove all variables used for optimization wih values or other variables not to be optimized.

    There can’t be variables in the optimization window.

     

    #177096

    This is essentially the version 2 of Nonetheless (rif. 176142) with the max daily loss and  split winning position (v.3.1).

    [Test 200K: v3.1 on the right side]

     

    //TS KD LowVolume v3.1 – DowJones 15 min – cfd 1 contract

    //spread 4 points

    DEFPARAM CUMULATEORDERS = false

    PositionSize=1

    //———————————————SETUP

    avgHull11=average[45,7]

    avgHull2=average[135,7]

    avgHull3=average[145,7]

    c1 = avgHull11>avgHull2 and avgHull2>avgHull3

    lowVol = round(volume[4])

    c2 = volume < lowVol

    lowBars = 5

    c3 = close>lowest[lowBars](low)

    IF c1 and c2 AND c3 and tradeAllowed = 1 THEN

    BUY PositionSize CONTRACTS AT MARKET

    ENDIF

    //———————————————————————

    EZT = 1

    if EZT then

    IF longonmarket and (barindex-tradeindex(1)>= 640 and positionperf>0) or (barindex-tradeindex(1)>= 160 and positionperf<0) then

    sell at market

    endif

    endif

    //———————————————————————

    myrsiM5=rsi[14](close)

    if myrsiM5<30 and barindex-tradeindex>1 and longonmarket and close>positionprice then

    sell at market

    endif

    if myrsiM5>70 and barindex-tradeindex>1 and shortonmarket and close<positionprice then

    exitshort at market

    endif

    //—————————————————————-

    maxDailyLoss = 200

    realPosition=positionPerf*positionPrice/pointSize*pointValue

    once tradeAllowed = 1

    if intradayBarIndex=0 then

    myProfit=strategyProfit

    tradeAllowed=1

    endif

    if (strategyProfit+realPosition) <= (myProfit-maxDailyLoss) then

    tradeAllowed=0

    endif

    //—————————————————————————————–

    SET STOP %LOSS 0.9

    SET TARGET %PROFIT 3.5

    //—————————————————————————————–

    once trailingstop = 1

    if trailingstop then

    trailingpercentlong = 0.29

    once acceleratorlong = 0.035

    once steppercentlong = (trailingpercentlong/10)*acceleratorlong

    if onmarket then

    trailingstartlong = positionprice*(trailingpercentlong/100)

    trailingsteplong = positionprice*(steppercentlong/100)

    endif

    IF NOT ONMARKET THEN

    newSL=0

    ENDIF

    IF LONGONMARKET THEN

    IF newSL=0 AND high-tradeprice(1)>=trailingstartlong THEN

    newSL = tradeprice(1)+trailingsteplong

    ENDIF

    IF newSL>0 AND high-newSL>trailingsteplong THEN

    newSL = newSL+trailingsteplong

    ENDIF

    ENDIF

    IF newSL>0 THEN

    SELL AT newSL STOP

    ENDIF

    endif

    //———————————————————————————————————————–

    once partialcloseGain = 1

    If partialcloseGain then

    ONCE PerCent = 0.5 //close 1/2 size

    ONCE PerCentGain = 0.023 //0.005 = 0.5%

    ONCE MinLotSize = 0.5

    ExitQuantity = abs(CountOfPosition) * PerCent

    LeftQty = max(MinLotSize,abs(CountOfPosition) – ExitQuantity)

    CloseQuantity = abs(CountOfPosition) – LeftQty

    IF Not OnMarket THEN

    Flag = 1

    ENDIF

    IF partialcloseGain AND LongOnMarket and close >= (PositionPrice * (1 + PerCentGain)) AND Flag THEN

    SELL CloseQuantity Contracts AT Market

    Flag = 0

    endif

    endif

    //——————————————————————–

    2 users thanked author for this post.
    #177098

    Hi.

    What is

    in your backtest?

    #216029

    I am on it but as of now, I ain’t successful at all…

    #218637

    Nice strategy. Have performed alright since you posted exempt for in downtrend. How come the strategy dosen´t take any trades before 2016 even if i test it on higher timeframes?

    #218638

    Hi, assuming you have made your backtest with IG, there was no volume data on major indexes before 2016 (forex goes back earlier). Reading the code script, at least one condition necessary to start a trade involves volume not being zero, so even with plenty of history loaded on a big timeframe taking a trade with those conditions wouldn’t happen until volume data is provided sometime in 2016.

    If on the other hand you were not on IG (or on an asset providing volume long before 2016), then more details on broker and asset used need to be provided to be able to replicate the issue in same conditions.

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

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