SHORT EUR USD (m15) // PAC MAN STRATEGY

Viewing 15 posts - 46 through 60 (of 86 total)
  • Author
    Posts
  • #71953 quote
    juanj
    Participant
    Master

    To assist with preventing trading during bullish trends we can apply the concept of RSI Ranges:
    https://blog.elearnmarkets.com/effectively-trade-using-rsi-andrew-cardwell-way/

    For example, the code will be as follow:

    If highest[3500](RSI[30](close)) > 80 Then
    PositionSize = 0
    Else
    PositionSize = 1
    EndIf

    This will prevent trading if we get a maximum RSI value exceeding a value of 80 on the RSI 30 period (which could signify a potential bullish trend).

    Variables to optimize would include x, y and z: highest[x](RSI[y](close)) > z

    immo_vienna and Balmora74 thanked this post
    #74476 quote
    Vonasi
    Moderator
    Master

    I’ve had two versions of this strategy on forward demo test for over a month now so just thought that I would post the results here so far.

    The first version is this which I think is the original from Balmora74 and has been on test since 19 May 2018:

    //-------------------------------------------------------------------------
    // Main code : PacMan BALMORA74
    //-------------------------------------------------------------------------
    // PAC MAN - PIP HUNTER
    // EUR / USD (M15)
    // By BALMORA74 19.05.2018
     
    DEFPARAM CumulateOrders = false
    DEFPARAM Preloadbars = 4000
     
    //VARIABLES
    x = 100
    
    MoneyManagement = 1 //0, 1or 2
    RiskManagement = 0 //0 or 1
    Capital = 10000
    MinBetSize = 1
    RiskLevel = 5
    
    Equity = Capital + StrategyProfit
    
    IF MoneyManagement = 1 THEN
    PositionSize = Max(MinBetSize, Equity * (MinBetSize/Capital))
    ENDIF
    
    IF MoneyManagement = 2 THEN
    PositionSize = Max(LastSize, Equity * (MinBetSize/Capital))
    LastSize = PositionSize
    ENDIF
    
    IF MoneyManagement <> 1 and MoneyManagement <> 2 THEN
    PositionSize = MinBetSize
    ENDIF
    
    IF RiskManagement THEN
    IF Equity > Capital THEN
    RiskMultiple = ((Equity/Capital) / RiskLevel)
    PositionSize = PositionSize * (1 + RiskMultiple)
    ENDIF
    ENDIF
    
    PositionSize = Round(PositionSize*100)
    PositionSize = PositionSize/100
                
    // STRATEGY
    Cv1 = (close < Average[100]) and (Average[50] < Average[50](close[1]))
    Cv2 = RSI[14](close) <= 28
    Cv3 = STD[10](close) >= 10.93 * pipsize
    Cv4 = close <= BollingerDown[13](close[2])
    OKSHORT = cv1 and cv2 and Cv3 and Cv4
     
    IF OKSHORT then
    Sellshort PositionSize CONTRACT at market
    SET STOP pLOSS 52
    SET TARGET PPROFIT 25
    ENDIF
     
    //EXIT ZOMBIE TRADE
    //IF POSITIONPERF < 0 THEN
    IF shortOnMarket AND BARINDEX-TRADEINDEX(1)>= x and close > TradePrice THEN
    EXITSHORT AT MARKET
    ENDIF
    //ENDIF
    

    …and the results so far:

    [attachment file=74477]
    [attachment file=74478]
    [attachment file=74479]

    I have also had on test for a slightly shorter time a slightly modified version for comparison.

    //-------------------------------------------------------------------------
    // Main code : PacMan v2
    //-------------------------------------------------------------------------
    // PAC MAN v2 - PIP HUNTER
    // EUR / USD (M15)
    // By BALMORA74 19.05.2018 - Vonasi modifications 20-5-18
     
    DEFPARAM CumulateOrders = false
    DEFPARAM Preloadbars = 4000
     
    MoneyManagement = 0 //0, 1or 2
    RiskManagement = 0 //0 or 1
    Capital = 10000
    MinBetSize = 1
    RiskLevel = 20
    
    Equity = Capital + StrategyProfit
    
    IF MoneyManagement = 1 THEN
    PositionSize = Max(MinBetSize, Equity * (MinBetSize/Capital))
    ENDIF
    
    IF MoneyManagement = 2 THEN
    PositionSize = Max(LastSize, Equity * (MinBetSize/Capital))
    LastSize = PositionSize
    ENDIF
    
    IF MoneyManagement <> 1 and MoneyManagement <> 2 THEN
    PositionSize = MinBetSize
    ENDIF
    
    IF RiskManagement THEN
    IF Equity > Capital THEN
    RiskMultiple = ((Equity/Capital) / RiskLevel)
    PositionSize = PositionSize * (1 + RiskMultiple)
    ENDIF
    ENDIF
    
    PositionSize = Round(PositionSize*100)
    PositionSize = PositionSize/100
                
    Cv2 = RSI[14](close) <= 28
    Cv3 = 0
    For i = 11 to 14 Do
    IF average[8](STD[i](close)) >= STD[i](close[3]) THEN
    Cv3 = 1
    ENDIF
    NEXT
     
    OKSHORT = cv2 and Cv3
     
    IF OKSHORT then
    Sellshort PositionSize CONTRACT at market
    SET STOP pLOSS 64
    SET TARGET PPROFIT 25
    ENDIF
     
    //EXIT ZOMBIE TRADE
    IF shortOnMarket AND BARINDEX-TRADEINDEX(1)>= 100 and close > TradePrice THEN
    EXITSHORT AT MARKET
    ENDIF
    

    The results for that since 23 May 2018 are:

    [attachment file=74480]
    [attachment file=74481]
    [attachment file=74482]

    To compare results over the same time period you need to deduct the first two trades off of the first version which were two wins for a total of £50. So the original is £46.72 up and the modified version £75 up. Make of it what you want as there is not much in it so far. Neither is lighting any great fires but at least neither of them is in a loss either. I’ll keep them on test until I need the space for something else.

    #74503 quote
    Nicolas
    Keymaster
    Master

    Thank you Vonasi. I didn’t know you were a professional gamer 🙂

    [attachment file=74504]

    #74523 quote
    Vonasi
    Moderator
    Master

    I did used to play it a lot on an arcade machine when I was a lot younger at my favourite rock club – but I was never any good at it. It may or may not have been due to the fact that it was usually at two o’clock in the morning and usually after ten pints of beer.

    Not sure why Balmora74 called it the PacMan strategy – maybe because it gobbles up candles in a downward direction? Maybe Balmora74 can tell us?

    #74560 quote
    Balmora74
    Participant
    Veteran

    Exactly Vonasi !! The strategy  gobbles up “red” candle like Pac Man who gobbles “ghost” 🙂

    The idea is to let go of Pac Man in the middle of the labyrinth represented by the price curve and ask him to hunt a maximum of red candles!

    So much for the analogy with video games…

    And thanks for sharing you results after one month in demo account.

    I have test it on a real account with the same result.

    #74594 quote
    Vonasi
    Moderator
    Master

    An interesting side effect is the positive overnight fees if a position is held at 2200. I have not had any other strategies running on the EUR/USD so I was able to go back through my IG account and add up the fees for this market since I started the forward testing up until today. The total is +£10.32.

    So I then went back through the performance report and noted how many times each version of the strategy held a position overnight. The original Balmora74 version held 7 positions overnight and my modified version held overnight 12 times. This is probably due to the fact that my version was in the market for an average of 9H 30m and Balmora74’s was only on the market for 6H 42m. Without matching each overnight payment to each position it is impossible to accurately say how much each strategy actually earned in overnight fees but we can guesstimate from the numbers that my version earned about £6.52 and Balmora74’s about £3.80

    It feels weird to be happy that a strategy is on the market for longer and holding overnight as often as possible – but it is more profitable. Fees of £6.52 represent an increase of 8.7% on the £75 strategy profit and £3.80 is an increase of 8.1% on the £46.72 strategy profit. Not to be sniffed at.

    I might have to start looking at other shorting forex ideas!

    #74654 quote
    Balmora74
    Participant
    Veteran

    An interesting side effect is the positive overnight fees if a position is held at 2200. I have not had any other strategies running on the EUR/USD so I was able to go back through my IG account and add up the fees for this market since I started the forward testing up until today. The total is +£10.32.

    So I then went back through the performance report and noted how many times each version of the strategy held a position overnight. The original Balmora74 version held 7 positions overnight and my modified version held overnight 12 times. This is probably due to the fact that my version was in the market for an average of 9H 30m and Balmora74’s was only on the market for 6H 42m. Without matching each overnight payment to each position it is impossible to accurately say how much each strategy actually earned in overnight fees but we can guesstimate from the numbers that my version earned about £6.52 and Balmora74’s about £3.80

    It feels weird to be happy that a strategy is on the market for longer and holding overnight as often as possible – but it is more profitable. Fees of £6.52 represent an increase of 8.7% on the £75 strategy profit and £3.80 is an increase of 8.1% on the £46.72 strategy profit. Not to be sniffed at.

    I might have to start looking at other shorting forex ideas!

     

    Exactly. Positive overnight fees improve the strategy profit. It’s a really interesting property of short strategies…

    This code is inspired by long hours of observation of price developments on this currency pair.

    I tried to adapt the code on other timeframes and currency pairs but without success for now ! Its seems to work only on EUR / USD M15….

    #74657 quote
    Vonasi
    Moderator
    Master

    It will be interesting to compare the two versions again in a few weeks time. The last trade for your version was a loss and a win for my version so comparing over the same test period yours is now in a slight loss and mine £100 up. Hopefully in a few weeks time we will have an answer as to which is the winner! Although I just noticed that I am running your version with my money management turned on and my version with it turned off. I won’t change it now as I don’t think it will make much difference at this stage of the strategy test period.

    #74658 quote
    Balmora74
    Participant
    Veteran

    It will be interesting to compare the two versions again in a few weeks time. The last trade for your version was a loss and a win for my version so comparing over the same test period yours is now in a slight loss and mine £100 up. Hopefully in a few weeks time we will have an answer as to which is the winner! Although I just noticed that I am running your version with my money management turned on and my version with it turned off. I won’t change it now as I don’t think it will make much difference at this stage of the strategy test period.

    Yes Nice idea and very interesting to have the results in a few months.

    Other things with a 200k backtest tick by tick :

    • Number of positions  = 1214 (Balmora74 code) versus 986 (Vonasi code) = better overnight fees profit with Balmora74 code
    • Less DrawDown with Balmora74 code
    • A better Profit Factor with Vonasi Code (1.47) versus Balmora74 Code (1.45)

    May the best win !! ( a beer 🙂 )

    #74659 quote
    Vonasi
    Moderator
    Master

    Number of positions  = 1214 (Balmora74 code) versus 986 (Vonasi code) = better overnight fees profit with Balmora74 code

    That would depend on length of time on market. My version has a looser stop loss so will likely be on the market longer per trade – so less trades but more chance of being held overnight per trade. It may just even out. May the best strategy win (or at least not lose as much as the other one)!

    Could you post the 200k results just for interest (I only have 100k at the moment as my 200k account was limited risk so I didn’t use it enough and IG decided to close it – no great loss as I do daily strategies normally anyway)

    #74666 quote
    Balmora74
    Participant
    Veteran

    These are the results with exactly the code above without using Money & Risk Management :

    • Tick by Tick 200k
    • PositionSize = 1
    Vonasi thanked this post
    #74668 quote
    Balmora74
    Participant
    Veteran

    RESULTS FOR BALMORA74 VERSUS

    #74671 quote
    Balmora74
    Participant
    Veteran

    RESULTS FOR VONASI VERSUS

    #74681 quote
    Vonasi
    Moderator
    Master

    Thanks for posting those. The differences are very small between the two. My version has slightly more profit overall which is always the end goal and I notice that your version is on the market for 15% of the time but mine is on for 25% of the time so that is a much higher probability of being on the market at the 2200 fees add on time. The draw down on mine is bigger as would be expected with a larger stop loss but both draw down levels are of very manageable size. The extra draw down on my version is more than compensated for by the extra run up which if coupled with money management could be compounded into even more profit (for example if fixing stakes at a % of capital and not reducing stakes after a loser).

    I notice that the number of positions opened is not how you listed it in the earlier post. My version opened 1468 positions and your version only 1220.

    #76853 quote
    Vonasi
    Moderator
    Master

    I have now had Balmora74’s version of his PacMan strategy and my slightly tweaked version v2 on forward demo test for a couple of months now. Here are the results so far:

    [attachment file=76854]
    [attachment file=76855]
    [attachment file=76856]

    We need to deduct two trades from the Balmora74 version (as I started it slightly earlier) so that we can compare the exact same test period. These trades were two wins totalling £50. So Balmora74’s version has produced a loss of -£11.80 and a win rate of 17 wins in 26 trades which equals a 65.38% win rate. My v2 has faired a little better with a gain of +£138.60 in more trades at a higher win rate. 21 wins in 30 trades which equals a 70% win rate.

    I checked my IG demo account and I have been paid £20.55 in interest over the test for the EURUSD and I have no other EURUSD strategies so this is all PacMan interest. I cannot allocate this exactly to each strategy (I could but it is a lot of work) so I counted the number of trades in each strategy that would have been on the market at the 2200 time when interest is paid. Balmora74’s version was on the market overnight 12 times and my v2 21 times. So if we allocate 63.6% of the positive fees to v2 and 36.4% to Balmora74’s version then v2 gets a gain of +£13.07 and Balmora74 version +£7.48.

    So overall the Balmora74 version made a loss of  -£4.32 and my v2 a gain of +£151.67.

    Sorry Balmora74 but I think your version is a little over optimized and with a stop loss that is too tight but to be honest neither of them is exciting me enough to rush to put them live yet. The good news I guess is that your’s has basically broken even and mine has made a small profit so at least we haven’t lost any money!

    GraHal and Balmora74 thanked this post
Viewing 15 posts - 46 through 60 (of 86 total)
  • You must be logged in to reply to this topic.

SHORT EUR USD (m15) // PAC MAN STRATEGY


ProOrder support

New Reply
Author
author-avatar
Balmora74 @balmora74 Participant
Summary

This topic contains 85 replies,
has 16 voices, and was last updated by Vonasi
5 years, 11 months ago.

Topic Details
Forum: ProOrder support
Language: English
Started: 05/01/2018
Status: Active
Attachments: 59 files
Logo Logo
Loading...