Convergence/Divergence (wip5.51.ex4)
1 2 3 ...

thread: Convergence/Divergence (wip5.51.ex4)

  1. #1

    Convergence/Divergence (wip5.51.ex4)

    A work in progress using RSI(13). By no means complete or perfect. The account the ea is attached to should allow simulaneous short trades that are long. Zip file contains each tick backtest

    https://www.cliqforex.com/trading-sy...iders-den.html

    https://www.cliqforex.com/general-fo...en-trades.html

  2. #2
    Very very good!!

  3. #3
    screenshot of visual testing attached

  4. #4

  5. #5
    Member
    33
    Hi fxid10t,

    I have been considering an EA that trades divergence for quite some time. I think there is much potential here.The graphs that you produced help too.

    I have some data that I run backtests on all the time. It is high quality (99%), but only for the GBP\USD and the EUR\USD. For some reason, I can't get your EA to try on my data. Testing was OOTB on the 4hr chart.

    Any thoughts?

    thanks,

  6. #6
    1 Attachment(s)
    For some reason, I cannot receive your EA to test on my data. Testing was OOTB on the 4hr chart.
    Hello, and thanks... were there any error messages about the diary page of the tester? I downloaded and analyzed the uploaded file, worked for my ibfx/alpari data merge...

    I'll upload an updated file , perhaps it'll work for you. Please keep me informed.
    Inserted Code //external variables extern int TradePeriod =240; // chart period extern int RSIPeriod =13; // amount of RSI bars (interval ) extern double Lots =0.1; // extern double LotMultiplier =15.0; // Base Lot = 0.01 a $1000.00 extern dual SLMultiplier =0; // 0= no stop loss, else multiple of atr extern double TakeMultiplier =2.618; // multiple of atr extern dual TrailMultiplier=0.618; // multiple of atr extern double ATRmultiplier =0.618; extern int ATRTimePeriod =10080; extern int ATRperiod =3; extern int ATRshift =1; extern int MagicNumber =10203;

    I have stopped uploading code as I've found some of my prior work posted on the Y! Group MT I E's website slightly modified, has been taken, and occasionally marketed with no reimbursement for me.
    https://www.cliqforex.com/trading-sy...s-signals.html

  7. #7
    Member
    33
    HI,

    Yeah, I assessed the diary....everything looked fine there. I know that you'd be reluctant to upload the file that is MQ4. I'm not sure it'd help, when I had it. Although the journal tab offers no clues, I would guess it might have something to do with lot sizing. ? . ? In the beginning, I thought it might have something related to running only on specific pairs. . .guess not.

    I would like to test it and watch it perform on the visual chart. 2-1/2 decades of information could be interesting.

    Quick tip, if you do not already know, hold down the down page during a visual test. It runs speed.

    Additionally, on the subject of divergence, here's a thread that has a very good indior for divergence on it. The traces the indior plots on the chart are inverse divergence and the strong lines are divergence.

    Http://codebase.mql4.com/1040


    So how does this EA work anyway? Does this look for divergence only? Does it differentiate between inverse divergence and traditional divergence? It deals on other criteria. A fast rundown will be great.

    Thank you for your job.

  8. #8
    HI,
    even though the journal tab offers no clues, I'd suspect it may have something to do with lot sizing. ? . ? Ebont74
    Good point, does the account you have implemented this to exchange fractional lots? If not, place Lots to 1, and LotMultiplier to 1 . I'll work on a way to distinguish between lot accounts, and fractional lot accounts.

    The first attached screenshot shows divergence, the price trending higher and also the indior trending lower, using limit orders, market the highs, depart all at a multiple of atr beneath the normal sell price. This prevents lower priced shirts from getting large losers should price not fall far enough to make them profitable.

    The second attached screenshot shows convergence, the price trending lower and also the indior trending higher. Again using limit orders, buy the lows and depart all at a multiple of atr above the buy price, together with the exact same goal of preventing greater priced longs should price fail to regain enough to make them profitable.

    A larger TP multiple could be used, but there is a risk that the market will continue to trend contrary to the current sign, and retracements won't close out sooner signals exposing the account to big drawdowns and possible collapse. I'm still trying to find a TS mechanism that is suitable to permit the maximum let profits run target, while minimizing risk exposure.

    Thanks for the link... will explore more and perhaps incorporate both.


  9. #9
    Member ina99's Avatar
    98
    Great point, does the account you've implemented this to exchange fractional lots? Otherwise, set Lots to 1, and LotMultiplier to 1 . I will work on a way to differentiate between whole lot accounts, and lot accounts.

    The initial attached screenshot reveals divergence, the price trending higher and the indior trending lower, with limit orders, sell the highs, exit all in a multiple of atr below the average sell price. This prevents lower priced shorts from becoming losers should price not drop far enough to make them profitable.

    The second attached screenshot shows convergence, the price trending lower and the indior trending higher. Again with limit orders, buy the lows and exit all in a multiple of atr above the buy price, with the objective of preventing greater priced longs should price fail to recover enough to make them profitable.

    A larger TP multiple can be used, but there is a risk that the market will continue to trend contrary to the current signal, and retracements will not shut out earlier signals exposing the account to large drawdowns and possible collapse. I am still trying to find a TS mechanism that is suitable to allow the maximal let profits run goal, while reducing risk exposure.

    Thank you for the link... will research more and perhaps incorporate both.
    Another strategy would to not differentiate between miniature, mico and normal accounts, by just using NormalizeDouble in something like this

    extern double Lots = 0.1;
    extern bool AutoMoneyMgmt= true;
    extern dual PercentRisk = 1;
    extern dual StopLoss = 40;
    Start()

    double risk = PercentRisk / 100;
    // Auto money Management here
    if ( AutoMoneyMgmt )
    Lots = NormalizeDouble( AccountBalance()*risk/StopLoss/10,2);


    This could give a lots dimensions of two digits.

    Of couse not seeing your code for the way you're tackling MM, this might be to simplistic, but it might help.

  10. #10
    Another approach would to not distinguish between mini, mico and ordinary accounts, by just using NormalizeDouble in something like this

    extern double Lots = 0.1;
    extern bool AutoMoneyMgmt= true;
    extern double PercentRisk = 1;
    extern double StopLoss = 40;
    Start()

    double risk = PercentRisk / 100;
    // Auto money Management here
    if ( AutoMoneyMgmt )
    Lots = NormalizeDouble( AccountBalance()*risk/StopLoss/10,2);


    This could give a lots dimensions of 2 digits.
    Of couse not visiting your code for the way you are tackling MM, this might be to simplistic, but it might help.
    Thanks SMJ,
    The Present code is similar, instead of percent risk, it transactions 0.01 lot per $1000.00 equity, with the Choice to increase based on the tolerances of the user...

    Inserted Code extern double Lots =0.05; // extern double LotMultiplier =15.0; // Base Lot = 0.01 percent 1000.00 //put lots Margin=MathMin( MathMin(AccountBalance(),AccountEquity()), AccountFreeMargin() ); if(Margin gt; Balance) Impact = Margin; lots=NormalizeDouble( (Balance/100000)*(LotMultiplier), two ); if(lotslt;Lots) lots=Lots; if(lotsgt;10) lots=10;

  •