long-short when Moving average changed color

Viewing 9 posts - 16 through 24 (of 24 total)
  • Author
    Posts
  • #23607 quote
    Sofitech
    Participant
    Master

    @Dave.

    Results seems to be very good. And maybe too good to be true. How many 0 bars when the position close in this backtest ?
    Could you insert the code so we can try to understand if results are realistic.

    #23642 quote
    Dave
    Participant
    Senior

    @enzo, done simply with a 50 trailing stop. As humans we always try to make things complex!. 🙂


    @sofitech
    , as you can see in the image, no 0 bars.maybe it is too good to be true given my more than basic programming skills!. I’m mobile so can’t post the code yet for fear of reprimand from @nicolas  who has to keep correcting:-)… Maybe later from PC.

    Dave

    #23688 quote
    Joachim Nilsson
    Participant
    Average

    Hey!

    Can someone upload the file? I cant get it to work if I copy the code?

    #23727 quote
    Dave
    Participant
    Senior

    Ok, here it is for you to try. Be kind enough to feedback how it performs longer term as I don’t have any historic data to work with. If it performs well then maybe I’ll get some fame if @Nicolas considers it for the library?. Any ideas for improvement are also welcome although I would probably need help to implement it!.

    Dave

    (Test was done on DAX daily – I read on here recently “why does everybody trade DAX” – Simple = Volatility!)

    DEFPARAM CumulateOrders = False // Cumulating positions deactivated
    //DEFPARAM FLATBEFORE = 080000
    //DEFPARAM FLATAFTER = 180000
    
    
    //takeprofit = 50 //takeprofit in points
    //stoploss = 100 //stoploss in points
    fastma = ExponentialAverage[75](close)
    slowma = ExponentialAverage[195](close)
    
    //fastma bullish and bearish conditions
    
    fastbullish = fastma>fastma[1] and fastma[1]<fastma[3] and fastma>slowma
    fastbearish = fastma<fastma[1] and fastma[1]>fastma[3] and fastma<slowma
    
    //conditions for long = fast ma ABOVE slow ma and turning in agreement with slow ma trend
    if not longonmarket and fastbullish  then
    buy 10 share at market
    endif
    
    //conditions for short = fast ma BELOW slow ma and in agreement with slow ma trend
    if not shortonmarket and fastbearish then
    sellshort 10 share at market
    endif
    
    //set target pprofit takeprofit
    //set stop ploss stoploss
    set stop ptrailing 50
    
    EMA-Change-colour-1.itf
    #23751 quote
    enzo_52
    Participant
    Senior

    HI GUYS, I DID NOT BACKTEST ABOUT STRATEGY, JUST I FOUND THE RIGHT SETTING ABOUT  PRINCIPAL TREND WITH THE CROSSES OF 2 EMA  (75 AND 195) (NOT GREEN AND RED ) THEN I WONTED ANOTHER MOVING AVERAGE FOR TO GO ONLY SHORT  WHEN PRINCIPAL TREND WAS DOWN  AND GO LONG WHEN PRINCIPAL TREND WAS UP.

    DAVE DID ANOTHER SYSTEM  THAT WORKS GREAT  ….

    I THINK FOR IMPROVED THE RESULT TO DO A POSITION SIZE TOO  ABOUT 2% OF CAPITAL

    #23752 quote
    enzo_52
    Participant
    Senior

    I TRAIED THE TS..BUT SEEM DOES NOT WORK..

    CatturaDAX.png CatturaDAX.png
    #23775 quote
    Joachim Nilsson
    Participant
    Average

    Thanks Dave

    This is how it looks when I backtest it with v10.3 live. Dosen´t seem to work…

    Skärmbild-57.png Skärmbild-57.png
    #23778 quote
    Dave
    Participant
    Senior

    I’m on 10.2 whether that has an effect on it, I’m not sure?.As you can see the code is pretty simple so cannot explain it.

    Dave

    #26758 quote
    Dave
    Participant
    Senior

    @Enzo,sofitech,joachim.

    Now I’m on 10.3 I’ve had a look at the code and got it working. As predicted, the results are not favourable, on one test only making £300/10yrs! and most of the others negative. I think beacause the large ma’s are so flat it could not initiate  a trade without increasing lookback. Fast ma’s with little lag perform much better with the code as they need to reflect PA on whichever timeframe your using. Dave

Viewing 9 posts - 16 through 24 (of 24 total)
  • You must be logged in to reply to this topic.

long-short when Moving average changed color


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
enzo_52 @enzo_52 Participant
Summary

This topic contains 23 replies,
has 5 voices, and was last updated by Dave
9 years ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 01/30/2017
Status: Active
Attachments: No files
Logo Logo
Loading...