4H Short with Repulse-Stop

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #54000 quote
    JohnScherJohnScher
    Participant
    Veteran
     
    // Dax 1 Euro Mini
    // TimeFrame 4H  
    // Hauptcode : 4H Short with Repulse-Stop
    // created by JohnScher
    
    // tested 08.04.2013 - 26.11.17 with PRT 10.3
    // 2 Points Spread
    // won 161 loose 212
    // max DrawDown 853 Euro max RunUp 5.035
    // winnings total 4,473 Euro
    
    
    defparam flatafter = 210000
    defparam cumulateorders = true
    
    Once position = 1
    
    cx1 = cci[11] (close) <+90
    cx2 = cci[21] (close) >-90
    cx3 = PriceOscillator[5,25](close)<0.5
    cx4 = TR (close) >15
    cx5 = repulse [3] <0.1
    
    
    TradingTimeShort =  time = 090000 or time = 130000 or time = 170000 
    
    IF  TradingTimeShort Then
    IF   cx1 and cx2 and cx3 and cx4 and cx5  Then
    IF Exponentialaverage [1] (close) < ExponentialAverage [4] (close) THEN
    sellshort position CONTRACTS AT MARKET
    Endif
    Endif
    Endif
    
    If repulse [3] >0.2 then
    Exitshort at market
    Endif
    
    // not tested 
    // on other major indizes
    // with Saisonalpatternmultipler from Pathfinder-Systems
    // with some Re-invest-Stategies 
    
    // greets JohnScher
    hi there. Is it correct and clean coded? I would like to ask if someone can check the results of the backtest and let you know if they have the same results? kind regards JohnScher
    #54017 quote
    DespairDespair
    Blocked
    Master

    This is what i get with spread=2. 

    BTW: This post belongs in the proorder section.

    Bildschirmfoto-2017-11-26-um-15.08.31.png Bildschirmfoto-2017-11-26-um-15.08.31.png Bildschirmfoto-2017-11-26-um-15.08.43.png Bildschirmfoto-2017-11-26-um-15.08.43.png
    #54020 quote
    JohnScherJohnScher
    Participant
    Veteran

    Hi, thanks a lot!

    You have gone much further back with the beginning of the backing test.
    Can PRT return the data back valid so far? That would be very nice.

    I would like to check this again and ask you if you can give me the exact start date of your back test?

    #54021 quote
    DespairDespair
    Blocked
    Master

    This was a 10000 bar backtest starting 23rd january 2011 (as you see on the first picture).

    #54022 quote
    JohnScherJohnScher
    Participant
    Veteran

    Thank you very much again.

    I don’t have that result.
    I’ll try to find the bug and then report back to you.
    So thank you again!

    #54216 quote
    JohnScherJohnScher
    Participant
    Veteran

    Hello again.

    I couldn’t find any mistakes.
    But here are the screenshots.

    4H-Repulse-No1.png 4H-Repulse-No1.png 4H-Repulse-No2.png 4H-Repulse-No2.png
    #60627 quote
    JohnScherJohnScher
    Participant
    Veteran
    Strategy in the demo version    
    //-------------------------------------------------------------------------
    // Hauptcode : 4H Short Repulse
    //-------------------------------------------------------------------------
    // Dax 1 Euro Mini
    // TimeFrame 4H
    // Hauptcode : 4H Short with Repulse-Stop
    // created by JohnScher
    
    // backtest 08.04.2013 - 26.11.17 with PRT 10.3
    // 2 Points Spread
    // won 161 loose 212
    // max DrawDown 853 Euro max RunUp 5.035
    // winnings total 4,473 Euro
    
    
    defparam flatafter = 210000
    defparam cumulateorders = true
    
    // define saisonal position multiplier for each month 1-15 / 16-31 (>0 - long / <0 - short / 0 no trade)
    ONCE January1 = 3   //0 risk(3)
    ONCE January2 = 0   //3 ok
    ONCE February1 = 3  //3 ok
    ONCE February2 = 3  //0 risk(3)
    ONCE March1 = 3     //0 risk(3)
    ONCE March2 = 2     //3 ok
    ONCE April1 = 1     //3 ok
    ONCE April2 = 3     //3 ok
    ONCE May1 = 1       //0 risk(1)
    ONCE May2 = 2       //0 risk(2)
    ONCE June1 = 1      //1 ok
    ONCE June2 = 2      //3 ok
    ONCE July1 = 3      //1 chance
    ONCE July2 = 2      //3 ok
    ONCE August1 = 2    //1 chance 1
    ONCE August2 = 3    //3 ok
    ONCE September1 = 3 //0 risk(3)
    ONCE September2 = 0 //0 ok
    ONCE October1 = 3   //0 risk(3)
    ONCE October2 = 2   //3 ok
    ONCE November1 = 1  //1 ok
    ONCE November2 = 3  //3 ok
    ONCE December1 = 3  // 1 chance
    ONCE December2 = 2  //3 ok
    
    
    // set saisonal multiplier
    currentDayOfTheMonth = OpenDay
    midOfMonth = 15
    IF CurrentMonth = 1 THEN
    IF currentDayOfTheMonth <= midOfMonth THEN
    saisonalPatternMultiplier = January1
    ELSE
    saisonalPatternMultiplier = January2
    ENDIF
    ELSIF CurrentMonth = 2 THEN
    IF currentDayOfTheMonth <= midOfMonth THEN
    saisonalPatternMultiplier = February1
    ELSE
    saisonalPatternMultiplier = February2
    ENDIF
    ELSIF CurrentMonth = 3 THEN
    IF currentDayOfTheMonth <= midOfMonth THEN
    saisonalPatternMultiplier = March1
    ELSE
    saisonalPatternMultiplier = March2
    ENDIF
    ELSIF CurrentMonth = 4 THEN
    IF currentDayOfTheMonth <= midOfMonth THEN
    saisonalPatternMultiplier = April1
    ELSE
    saisonalPatternMultiplier = April2
    ENDIF
    ELSIF CurrentMonth = 5 THEN
    IF currentDayOfTheMonth <= midOfMonth THEN
    saisonalPatternMultiplier = May1
    ELSE
    saisonalPatternMultiplier = May2
    ENDIF
    ELSIF CurrentMonth = 6 THEN
    IF currentDayOfTheMonth <= midOfMonth THEN
    saisonalPatternMultiplier = June1
    ELSE
    saisonalPatternMultiplier = June2
    ENDIF
    ELSIF CurrentMonth = 7 THEN
    IF currentDayOfTheMonth <= midOfMonth THEN
    saisonalPatternMultiplier = July1
    ELSE
    saisonalPatternMultiplier = July2
    ENDIF
    ELSIF CurrentMonth = 8 THEN
    IF currentDayOfTheMonth <= midOfMonth THEN
    saisonalPatternMultiplier = August1
    ELSE
    saisonalPatternMultiplier = August2
    ENDIF
    ELSIF CurrentMonth = 9 THEN
    IF currentDayOfTheMonth <= midOfMonth THEN
    saisonalPatternMultiplier = September1
    ELSE
    saisonalPatternMultiplier = September2
    ENDIF
    ELSIF CurrentMonth = 10 THEN
    IF currentDayOfTheMonth <= midOfMonth THEN
    saisonalPatternMultiplier = October1
    ELSE
    saisonalPatternMultiplier = October2
    ENDIF
    ELSIF CurrentMonth = 11 THEN
    IF currentDayOfTheMonth <= midOfMonth THEN
    saisonalPatternMultiplier = November1
    ELSE
    saisonalPatternMultiplier = November2
    ENDIF
    ELSIF CurrentMonth = 12 THEN
    IF currentDayOfTheMonth <= midOfMonth THEN
    saisonalPatternMultiplier = December1
    ELSE
    saisonalPatternMultiplier = December2
    ENDIF
    ENDIF
    
    
    //-------------------------------------------------------------------------------------
    
    
    
    Once position = 1
    
    cs1 = cci[11] (close) <+90
    cs2 = cci[21] (close) >-90
    cs3 = PriceOscillator[5,25](close)<0.5
    cs4 = TR (close) >24
    cs5 = repulse [3] (close) <0.1
    
    
    TradingTimeShort =  time = 090000 or time = 130000 or time = 170000
    
    IF  TradingTimeShort Then
    IF   cs1 and cs2 and cs3 and cs4 and cs5  Then
    IF Exponentialaverage [1] (close) < ExponentialAverage [4] (close) THEN
    sellshort position*saisonalPatternMultiplier CONTRACTS AT MARKET
    Endif
    Endif
    Endif
    
    If repulse [3] (close) >0.1 then
    Exitshort at market
    Endif
    
    
     
    
    // not tested
    // on other major indizes
    // with some Re-invest-Stategies
    
    // greets JohnScher
    
    Screenshot_1-10.png Screenshot_1-10.png
    #60675 quote
    robertogozzirobertogozzi
    Moderator
    Legend
    I moved the topic to ProOrder support.
    #61415 quote
    JohnScherJohnScher
    Participant
    Veteran
    Thanks. I converted the 4H Short with Repulse Stop into a 4H Long with Repulse Stop. In this way..
    Defparam cumulateorders = false
    
    TradingDay = Opendayofweek = 1 or Opendayofweek = 2 or Opendayofweek = 3 or Opendayofweek = 4 or Opendayofweek = 5
    
    TradingTime = time >=090000 and time <=210000
    
    position = 1
    
    // DetrendedPriceOszillaator past data
    p = 3
    avg = average[p](close)
    r = round(p/2) +1
    c = close - avg[r]
    
    // maincode
    If TradingDay and TradingTime then
    IF c > 0 and Repulse [5] >= 0.3 then
    buy position contracts at market
    Endif
    
    If Repulse [5] <0.3 then
    sell position contracts at market
    Endif
    
    Endif
    
    Set Stop %Loss 1
    //Set Target %Profit 1
      That should go far enough good. If necessary, can someone check the backtest result?     However, I have a question about Repulse. This is provided by PRT as an indicator. I would like to check how the repulses relate to the rejecting average. For example, for Is it profitable? when you go long if the reject average >0 and the repulse crosses the reject average upwards if the reject average <0 and the repulse crosses the reject average upwards Unfortunately my programming skills are not so good, so I wanted to ask if someone could put the code for the repulse in here? I could then continue my deliberations. Enclosed the last picture. The red line is the rejecting average. Translated with http://www.DeepL.com/Translator   Translated with http://www.DeepL.com/Translator
    Screenshot_5.png Screenshot_5.png Screenshot_6.png Screenshot_6.png Screenshot_7.png Screenshot_7.png Screenshot_8.png Screenshot_8.png
Viewing 9 posts - 1 through 9 (of 9 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

4H Short with Repulse-Stop


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
JohnScher @johnscher Participant
Summary

This topic contains 8 replies,
has 3 voices, and was last updated by JohnScherJohnScher
8 years, 8 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 11/26/2017
Status: Active
Attachments: 9 files
ProRealCode ProRealCode
Loading...