1. Welcome back! Thank you for being a part of this Traders Community. Let's discuss and share :)
    Selamat datang kembali! Trimakasih telah menjadi bagian dari Komunitas Trader ini. Mari berdiskusi dan berbagi :)
    Dismiss Notice

Suggestion I will make a Free EA with your Indicator

Discussion in 'Expert Advisor atau Robot Forex' started by kamel, 17 Dec 2019.

  1. kamel

    kamel Active Member Credit Hunter

    Equity
    Credit
    Ref Point
    assar :)
     
    Last edited by a moderator: 18 Dec 2019
  2. Ron L

    Ron L New Member

    Equity
    Credit
    Ref Point
    Hi everyone,

    This is my first post on this forum so please forgive me if I make administrative error by posting a request here.
    BARer is an open source oscillator which I follow for a reasonable amount of time. I could not find that it repaints once the current bar is closed. I noticed however that it has an uncanny ability to find early trend changes and that because of this quality it can serve for early entries and timely exits while keeping you in the market in-between. It's a very short and simple indicator. It also has a "Buy" and "Sell" signals in the code but they do not appear on the chart at the current version that I have. The default length of 26 is pretty good for almost all TFs but occasionally you want to change it to a shorter length to deal with ranging markets.
    With my newbie knowledge in MQL4 coding I'm starting to see whether I can add arrows to it and then convert it to an EA,, but if someone here would do us all a favor and convert it to an EA I'm sure we all would be greatly grateful for him/her. Just add this indicator to your favorite pair and see how it faithfully finds the main trend changes without delay and keep you in the market as long as the trend continues, despite the usual market's ebb of minor ups and downs.
    Among the 2 available external variables the 1st one "modes" can be removed as it doesn't serve anything here. The second one (controlling the length) should be kept in the EA. I would however add a 3rd one which will allow to control when to fire the buy and sell signal. Currently Buffer zero color shows where that signal should be taken according to the original coder opinion but it will be better if this additional external variable would draw it's information from the same source that the number at the left upper corner of the screen draws it's information from (Buffer 0?) and allows us to control at what level the signal would be fired (0.0001 and above for buys and -0.0001 and below for sells).

    Would appreciate continued discussion on this indicator here and of course an EA.
     

    Attached Files:

  3. ademola moses

    ademola moses Member Credit Hunter

    Equity
    Credit
    Ref Point
    Buy and sell when confirmation comes on the arrow. Take profit and stop lost and trailing and basket profit. Opposite close and open can also be added.
     

    Attached Files:

  4. Ron L

    Ron L New Member

    Equity
    Credit
    Ref Point


    Hi guys,

    I'm glad that this post is hidden somewhere where no one noticed it yet. As I'm gradually delving into MQL4 coding I started to analyze the code of BARer and noticed that it might be a repainting indicator despite the fact that it was not clear to me at first sight. Please do not say now Ahaa - this is a repainting indicator and let's move on.

    First, I decided to analyze it according to the excellent article from here (www.mqlsoft.com/article/indicators) and I suggest to everyone who wants to code an EA based on a certain indicator to read it before they start the effort. BARer passed the first 2 tests but in the 3rd test it failed by showing a high Redraw Factor of 58-61. When I got this high number I started to analyze it under a magnifying glass and noticed that indeed it redraws.

    So now what? As I said above I like very much the entries, exits and sustainability of this indicator (which of course may be caused by the redrawing). Its algorithm though calls for early entries and when it gives a signal to enter more often than not the trend follows in the indicated direction. Of course, as expected, the exits and sustainability are much more dependent on redrawing. So I started to run it by testing it in the visual mode and marking all the given signals in “real time” and I noticed that despite the redrawing it still, potentially, can generate profits.

    So as an exercise to myself I decided to see if the indicator can be improved in 3 steps:

    Step 1: Try to change the current loop that calculates the indicator on bars for which calculations have not been made to loops available in open source non-repainting indicators.

    If we look closely, the current code is similar to the classical one:

    int counted_bars = IndicatorCounted();

    if(counted_bars > 0) counted_bars--;

    int CalculateBars = Bars – counted_bars;

    for (int Count = CalculateBars; Count >=0; Count--)

    {

    // Indicator calculations

    }

    I do not believe that the problem lies here as some pretty simple NRP indicators use this approach, but it worth exploring.

    Step 2: RARer has 3 buffers but only 1 is useful for our needs (buffer 0). I have read that occasionally when there are 3 buffers and 2 of them are used to chart the positive (above 0) line while the other to chart the negative (below 0) line it causes repainting. So I’ll try to eliminate buffers 1 &2 and see if it helps. Between you and me though I do not believe that this is the case, but we will see.

    Step 3: Somehow I do believe that the problem lies in the indicator calculations. For that I need to decipher from the available code what is the algorithm and where the redrawing problem may arise. So I’ll see if it’s not too big of a project for a beginner.

    Of course, if someone who is versed in writing NRP indicators would by mistake stumble on this post and would be kind enough to pitch in – this would be great exercise for all of us.

    Finally, I’m aware that by changing the algo of an indicator we may solve the repainting issue at the expense of making the indicator not attractive at all, but this rest for us to see.

    I’m planning to report what is going on at every step of this exercise. Keep tuned in.
     
  5. Ron L

    Ron L New Member

    Equity
    Credit
    Ref Point
    During the last couple of weeks I took my time to broaden the horizon a little more.

    I first found that there are several indicators that are doing the same or similar job to BARer. The most notable are the "Modified Forex Sweep" indicator and the "RangeFactor" indicator from the old Synergy Trading System (from CompassFx). I actually found that the coding style of BARer and RangeFactor was too similar to be a coincidence (the variables seem almost the same) so I now believe that BARer is some modification of Synergy’s Range Factor. I will post the source code for all these indicators, the original and the ones that I modified, in the next relevant future posts.

    Without being too concerned about the copyrights of these indicators, as they are freely available for distribution on the web, my mission still remains to find which one of these indicators can best serve for an EA, i.e which one of them has the earliest entry, better sustainability and timely exits during a trend while being a non-repainting indicator.

    So the first step was to find if we can make BARer a non-repainting indicator. Indeed there is no point to compare indicators when they are repainting, as the signals for entries or exits are “moving objects” on historical data. So in the next post I will describe how this task was accomplished and evaluated.
     

Share This Page