please review my strategy Code Completed

Viewing 15 posts - 1 through 15 (of 18 total)
  • Author
    Posts
  • #175611 quote
    SpreadBetMH
    Participant
    Average

    Hello,
    I’ve finished working with this program and before I start using it, I was wondering if someone could give it a look and tell me what faults, if any that there are and make suggestions
    Its my first ProOrder build,

     
    
    // Definition of code parameters
    DEFPARAM CumulateOrders = False // Cumulating positions deactivated
    
    // Prevents the system from placing new orders on specified days of the week
    daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
    
    // Conditions to enter long positions
    indicator1 = Average[10](close)
    indicator2 = ExponentialAverage[50](close)
    c1 = (indicator1 CROSSES OVER indicator2)
    indicator3 = RSI[14](close)
    c2 = (indicator3 CROSSES OVER 24)
    
    IF (c1 OR c2) AND not daysForbiddenEntry THEN
    BUY 1 PERPOINT AT MARKET
    ENDIF
    
    // Conditions to exit long positions
    indicator4 = ExponentialAverage[73](close)
    indicator5 = Average[17](close)
    c3 = (indicator4 CROSSES OVER indicator5)
    indicator6 = RSI[14](RSI[14](close))
    c4 = (indicator6 CROSSES OVER 70)
    
    IF c3 OR c4 THEN
    SELL AT MARKET
    ENDIF
    If not OnMarket then
    // Do your Buy or Sell thing.
    Endif
     
    // or :
     
    If not LongOnMarket then
    // Do your Buy thing.
    Endif
     
    // or :
     
    If ShortOnMarket then
    // Do your Exit Short thing.
    Endif
    
    
    // Conditions to enter short positions
    indicator7 = ExponentialAverage[98](close)
    indicator8 = Average[18](close)
    c5 = (indicator7 CROSSES OVER indicator8)
    indicator9 = RSI[14](RSI[14](close))
    c6 = (indicator9 CROSSES UNDER 78)
    
    IF (c5 OR c6) AND not daysForbiddenEntry THEN
    SELLSHORT 1 PERPOINT AT MARKET
    ENDIF
    
    // Conditions to exit short positions
    indicator10 = Average[29](close)
    indicator11 = ExponentialAverage[77](close)
    c7 = (indicator10 CROSSES OVER indicator11)
    indicator12 = RSI[14](RSI[14](close))
    c8 = (indicator12 CROSSES UNDER 34)
    
    IF c7 OR c8 THEN
    EXITSHORT AT MARKET
    ENDIF
    If not OnMarket then
    // Do your Buy or Sell thing.
    Endif
     
    // or :
     
    If not LongOnMarket then
    // Do your Buy thing.
    Endif
     
    // or :
     
    If ShortOnMarket then
    // Do your Exit Short thing.
    Endif
    
    
    // Stops and targets
    SET STOP pLOSS 20
    SET TARGET pPROFIT 124
    #175614 quote
    phoentzs
    Participant
    Master

    Over-optimized, I would say.

    #175617 quote
    MAKSIDE
    Participant
    Veteran

    what does that give with “standard” MM values ?

    do you have screens about the backtest of it ?

    also do a test with a trailing stop

    #175624 quote
    XORANDNOT
    Participant
    Senior

    Moving averages allow you to curve fit anything perfectly to the past by finding out seemingly “ideal” period lengths. Usually, this does not work well in reality.

    SpreadBetMH thanked this post
    #175626 quote
    phoentzs
    Participant
    Master

    I always use fixed, logical MAs and build the strategy on them. But never again optimize the MAs afterwards. I also had to learn first.

    SpreadBetMH thanked this post
    #175627 quote
    nonetheless
    Participant
    Master

    first pic is a 10 year backtest of your algo, second pic is after a quick and dirty revision – % stop and target, trailing stop, refreshed all the numbers.

    not too bad for a first effort. Interesting that you’re using an RSI of the RSI … I’d never seen that before but it seems to work.

    SpreadBetMH thanked this post
    eurgbp-1h-SpreadbetMH-v1.jpg eurgbp-1h-SpreadbetMH-v1.jpg eurgbp-1h-SpreadbetMH-v2.jpg eurgbp-1h-SpreadbetMH-v2.jpg eurgbp-1h-SpreadbetMH-v2.itf
    #175632 quote
    XORANDNOT
    Participant
    Senior

    I always use fixed, logical MAs and build the strategy on them. But never again optimize the MAs afterwards. I also had to learn first.

    What is a good, logical and fixed MA for you ?

    SpreadBetMH thanked this post
    #175634 quote
    phoentzs
    Participant
    Master

    EMA200 or as a tandem EMA55 and EMA89, for example, seems to work well. In this case, it is more about the proportions of the course than an exact line. My opinion.

    SpreadBetMH and thanked this post
    #175635 quote
    XORANDNOT
    Participant
    Senior

    in DAX ? on all time scales ?  sounds a little like the magical Fibonacci numbers

    SpreadBetMH thanked this post
    #175636 quote
    phoentzs
    Participant
    Master

    Not just in the DAX, everywhere. There is no such thing as magic. I think you only need a fixed size as a trend line for example or something similar and build the other sizes of the strategy around it without changing this size again at some point. So I try and it seems to work fine without over-optimizing.

    #175637 quote
    XORANDNOT
    Participant
    Senior

    Backtest only…

    #175638 quote
    SpreadBetMH
    Participant
    Average

    OK Thanks for the advice,

    So, I pick SMA & EMA values and stick to them, So, SMA would be 20 Period and EMA would be 50 Period ?

    What can be optimised?  e.q. RSI 14, MACD 12,26,9      Can those numbers be optimised and by how much?

     

    Thanks for taking the time to respond

    #175642 quote
    XORANDNOT
    Participant
    Senior

    This is not science. There are no reproducible numbers. You have to find out yourself what methods work for you and which do not.

    #175644 quote
    phoentzs
    Participant
    Master

    Exactly, sometimes one works, sometimes the other. It always depends on how the respective market behaves in exactly this time frame. I think … Here’s a little example of me with just one EMA. The system has been successful for over 8 years, for whatever reason with this EMA. But it works.

    RSI-EMA EurUsd M15

    #175645 quote
    XORANDNOT
    Participant
    Senior

    @Nicolas : Happiness is now.

Viewing 15 posts - 1 through 15 (of 18 total)
  • You must be logged in to reply to this topic.

please review my strategy Code Completed


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 17 replies,
has 6 voices, and was last updated by Nicolas
4 years, 6 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 08/18/2021
Status: Active
Attachments: 3 files
Logo Logo
Loading...