Belkhayate's Center Of Gravity

Here you can post and download custom indicators. PLEASE: Do not start topics unless you are posting your own indicator, they will be moved to appropriate section even if you do.

Moderator: admin

Re: Belkhayate's Center Of Gravity

Postby Hug Coder » Mon Feb 27, 2012 6:18 pm

Karlo_Karlo:
See if this works. I haven't tested it.

Code: Select all
    -- Indicator profile initialization routine
    -- Defines indicator profile properties and indicator parameters
    function Init()
    strategy:name("Gravity signal");
    strategy:description("Signals when Price hits Gravity Edges");

    strategy.parameters:addGroup("Gravity parameters");
    strategy.parameters:addInteger("N", "Number of bars", "", 120);
    strategy.parameters:addInteger("O", "Order", "", 3);
    strategy.parameters:addDouble("E", "Eccart value", "", 1.61803399);

    strategy.parameters:addGroup("Price parameters");
    strategy.parameters:addString("Period", "Time frame", "", "m1");
    strategy.parameters:setFlag("Period", core.FLAG_PERIODS);

    strategy.parameters:addGroup("Signal parameters");
    strategy.parameters:addBoolean("ShowAlert", "Show Alert", "", true);
    strategy.parameters:addBoolean("PlaySound", "Play Sound", "", false);
    strategy.parameters:addFile("SoundFile", "Sound file", "", "");
    strategy.parameters:setFlag("SoundFile", core.FLAG_SOUND);
    strategy.parameters:addBoolean("Recurrent", "RecurrentSound", "", false);

    strategy.parameters:addGroup("Email Parameters");
    strategy.parameters:addBoolean("SendEmail", "Send email", "", false);
    strategy.parameters:addString("Email", "Email address", "", "");
    strategy.parameters:setFlag("Email", core.FLAG_EMAIL);
    end



    -- Streams/Indicators
    local gSource, gTick;
    local BELCOG;
    local name;

    -- Parameters
    local SoundFile;
    local RecurrentSound;
    local Email;
    local ShowAlert;

    local N;
    local O;
    local E;

    -- Variables



    -- Init Routine
    function Prepare(onlyName)

       N = instance.parameters.N;
       O = instance.parameters.O;
       E = instance.parameters.E;


       ShowAlert = instance.parameters.ShowAlert;
       if instance.parameters.PlaySound then
       SoundFile = instance.parameters.SoundFile;
       else
       SoundFile = nil;
       end

       assert(not(PlaySound) or (PlaySound and SoundFile ~= ""), "Sound file must be specified");

       RecurrentSound = instance.parameters.Recurrent;
       local SendEmail = instance.parameters.SendEmail;
       if SendEmail then
       Email = instance.parameters.Email;
       else
       Email = nil;
       end
       assert(not(SendEmail) or (SendEmail and Email ~= ""), "Email address must be specified");


       name = profile:id() .. "(" .. instance.bid:instrument() .. "," .. N .. "," .. O .. "," .. E .. ")";
       instance:name(name);

       if onlyName then
          return;
       end

       assert(instance.parameters.Period ~= "t1", "Can't be applied on ticks!");

       gSource = ExtSubscribe(1, nil, instance.parameters.Period, true, "bar");
       gTick = ExtSubscribe(2, nil, "t1", true, "close");
       BELCOG = core.indicators:create("BELCOG", gSource, N, O, E);

    end

    -- Process data routine
    function ExtUpdate(id, source, period)

       -- If ticksource, use bar period
       if id == 2 then
          period = gSource:size() - 1;
       else
          return;
       end
       
       if period < BELCOG.DATA:first() + 1 then
          return;
       end
       
       BELCOG:update(core.UpdateLast);

       if core.crossesOver(gSource.high, BELCOG.L3, period) then
          Signal("Gravity OverBought");
       elseif core.crossesUnder(gSource.low, BELCOG.L6, period) then
          Signal("Gravity OverSold");
       end


    end

    function Signal(Label)
        if ShowAlert then
            terminal:alertMessage(instance.bid:instrument(), instance.bid[NOW],  Label, instance.bid:date(NOW));
        end

        if SoundFile ~= nil then
            terminal:alertSound(SoundFile, RecurrentSound);
        end

        if Email ~= nil then
            terminal:alertEmail(Email, Label, profile:id() .. "(" .. instance.bid:instrument() .. ")" .. instance.bid[NOW]..", " .. Label..", " .. instance.bid:date(NOW));
        end
    end

    dofile(core.app_path() .. "\\strategies\\standard\\include\\helper.lua");
Hug Coder
 
Posts: 38
Joined: Fri Jan 13, 2012 5:43 am

Re: Belkhayate's Center Of Gravity

Postby virgilio » Tue Feb 28, 2012 5:49 pm

Hello developer(s), this is truly a nice treat. There is also another indicator that should be used with this Center of Gravity. It is a timing indicator that reinforces the Center of Gravity's entry and exit points. It can be viewed at the bottom of page 2 in the attached pdf document (Hot to use Belkhayate). The indicator is is called Belkhayate Timing. Is this something you would you be able to replicate and offer in conjunction with the Center of Gravity?
If so, then we have a formidable tool to use.
Thank you!
virgilio
 
Posts: 66
Joined: Mon Aug 23, 2010 12:16 pm

Re: Belkhayate's Center Of Gravity

Postby Hug Coder » Wed Feb 29, 2012 4:35 am

virgilio:
This viewtopic.php?f=17&t=715 ?
Hug Coder
 
Posts: 38
Joined: Fri Jan 13, 2012 5:43 am

Re: Belkhayate's Center Of Gravity

Postby Karlo_Karlo » Thu Mar 01, 2012 6:56 am

Thank you gentlemen, but it looks no different than it was before.
There is the MBFX Timing Indicator subject also; MT4 version gives a color line while the lua version gives something very different, which I do not understand how to use. I understand that it's a subject of intellectual property but it very much looks like that the MT4 Timing Indicator is a colorized version of some common indicator. I tried to look for but did not succeed.
What do you think about it?
Karlo_Karlo
Karlo_Karlo
 
Posts: 11
Joined: Fri Jan 07, 2011 4:48 am

Re: Belkhayate's Center Of Gravity

Postby Hug Coder » Fri Mar 02, 2012 7:27 am

Karlo_Karlo:
You have to define what you want exactly otherwise it's not so easy.

If you are requesting another indicator please make a proper request in the request forum, with enough information to make something out of it, e.g. a link or code (and picture+description) of the MT4 version.
Hug Coder
 
Posts: 38
Joined: Fri Jan 13, 2012 5:43 am

Re: Belkhayate's Center Of Gravity

Postby Karlo_Karlo » Sat Mar 03, 2012 8:49 am

Thank you Hug Coder,
Below is the "MBFX Timing.ex4" file, which is the additional indicator for MBFX system. But It is for the MT4 and we do not have a lua version. As it is said in the beginning of this thread that this system is an intellectual property of Mr.Belkhayate and it is not allowed to make a lua version of his indicator without his permission. But I think that this indicator is not a very sophisticated one. I tried to compare it with other common indicators in the MT4 but I could not find anything similar yet. In my recent post I was simply asking your opinion about this indicators resemblance with others.
Attachments
MBFX Timing.ex4
(4.56 KiB) Downloaded 2706 times
Karlo_Karlo
Karlo_Karlo
 
Posts: 11
Joined: Fri Jan 07, 2011 4:48 am

Re: Belkhayate's Center Of Gravity

Postby trendwatch » Sun Mar 04, 2012 7:50 am

I've read several statements of mr. Belkhayate wherein he states he is in no way related to MBFX. So the MBFX inidcators are not the same as those mr. Belkhayate uses in his system. Just thought you might like know this before you started using these indicators.
trendwatch
 
Posts: 33
Joined: Wed Jul 13, 2011 2:49 am

Re: Belkhayate's Center Of Gravity

Postby Hug Coder » Tue Mar 06, 2012 5:15 am

Karlo_Karlo:
As I said, if you want another indicator, you shouldn't post requests in this thread. If what you are looking for is a different version of the Belkhayate's Timing Indicator (viewtopic.php?f=17&t=715) then post there, otherwise post a new request thread for what you want, with proper descriptions etc.

The file you posted seems to be a compiled file which has no clear text/code so it's of no use.
Hug Coder
 
Posts: 38
Joined: Fri Jan 13, 2012 5:43 am

Re: Belkhayate's Center Of Gravity

Postby elliotwave5 » Thu May 31, 2012 8:33 pm

a) Can the Belkhayate indicators (BF long term reg and timing indicators) be used publicly? I believe reading that they are proprietary to him exclusively or are they public?
b) currently reviewing an H4 chart and the GBP/USD is way outside the L7 band. am i correct in that this indicates that one should take a long position? how many pips to risk on the stop and what would his limit be on profit taking?
any comments or suggestions would be greatly appreciated
elliotwave5
 
Posts: 13
Joined: Wed Aug 10, 2011 7:40 pm

Re: Belkhayate's Center Of Gravity

Postby Apprentice » Fri Jun 01, 2012 3:17 am

I am not aware of such limitations.
Everything posted here can be used for your own private use.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

PreviousNext

Return to Custom Indicators

Who is online

Users browsing this forum: Google [Bot] and 55 guests