Guppy's Multiple Moving Average and Convergence/Divergence

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: Guppy's Multiple Moving Average and Convergence/Divergence

Postby Alexander.Gettinger » Wed Jan 18, 2012 4:29 am

Jigit Jigit wrote:Great job. Thank you.
Could you possibly add a line following the ends of the bars of the histogram - something like the slow CCI line in Woodies CCI indicator. It would make the indicator even more readable. Its colour could be specified by the user.

Cheers


Please, see this version of indicator.
Download:
GMMACD2.lua
(1.93 KiB) Downloaded 2091 times
Alexander.Gettinger
FXCodeBase: Confirmed User
 
Posts: 3785
Joined: Wed Mar 31, 2010 9:40 pm
Location: Russia, Omsk

Re: Guppy's Multiple Moving Average and Convergence/Divergence

Postby Jigit Jigit » Fri Jan 20, 2012 6:15 am

Thank you Alexander.
Jigit Jigit
 
Posts: 54
Joined: Tue Aug 31, 2010 1:04 pm

Re: Guppy's Multiple Moving Average and Convergence/Divergence

Postby Jigit Jigit » Fri Jan 27, 2012 12:52 pm

Could you please make it change its colour depending on whether it is above or under the zero line. Ideally, I'd like it to change colours like e.g. Golden MACD http://www.fxcodebase.com/code/viewtopi ... macd#p5549

So the first couple of bars after crossing the 0 line could be e.g. gray.

Thanks for all your great work!
Jigit Jigit
 
Posts: 54
Joined: Tue Aug 31, 2010 1:04 pm


Re: Guppy's Multiple Moving Average and Convergence/Divergence

Postby waelsaleem » Sat Jan 28, 2012 12:36 pm

Hello,

I have a request to make this strategy even better: Breakout-GMMACD Strategy:
This would be identical to the breakout strategy. The only difference is that the trade is triggered only if it is confirmed by the GMMACD indicator histogram. if the histogram (GMMACD value) is in the same direction of the trade, then the trade is triggered. Exit strategies are identical to the original strategy.

Note the diagram attached. The improved strategy would prevent the 2 potentially losing triggers that would have been otherwise triggered by the standard strategy.

This will likely prevent many losing trades triggered against the overal trend. Let me know what you think.

Great job as always.
Attachments
Breakout-GMMACD strategy.JPG
waelsaleem
 
Posts: 14
Joined: Mon Jan 16, 2012 10:57 am

Re: Guppy's Multiple Moving Average and Convergence/Divergence

Postby Jigit Jigit » Sun Jan 29, 2012 4:48 am

Hi guys,
while waiting for my request (above) to be dealt with I've tried to modify the lua script myself. Would you be so kind as to have a look and let us know what's wrong with it.

What I'm trying to achieve is to make the indicator change its colour depending on its position against the zero line.


Code: Select all
function Init()
    indicator:name("Guppy's Multiple Moving Average Convergence/Divergence with colouring");
    indicator:requiredSource(core.Tick);
    indicator:type(core.Oscillator);

    indicator.parameters:addColor("COLOR1", "Indicator's Color", "", core.rgb(0, 168, 0));
    indicator.parameters:addColor("COLOR2", "Indicator's Color", "", core.rgb(168, 0, 0));
end

local source = nil;
local GMMA = nil;
local out = nil;
local out1 = nil;
local out2 = nil;
local first = nil;

function Prepare()
    source = instance.source;
    local name;
    -- set the indicator name (use the short name of our indicator: GMMA)
    name = profile:id() .. "(" .. source:name() .. ")";
    instance:name(name);
    GMMA = core.indicators:create("GMMA", source);
    first = GMMA:getStream(11):first();
    out1 = instance:addStream("H", core.Bar, name .. ".H", "H", instance.parameters.COLOR1, first);
    out2 = instance:addStream("H", core.Bar, name .. ".H", "H", instance.parameters.COLOR2, first);
    out:addLevel(0);
end

function Update(period, mode)
    GMMA:update(mode);

    if (period >= first) then
        local f, s;
        f = GMMA:getStream(0)[period] + GMMA:getStream(1)[period] + GMMA:getStream(2)[period] +
            GMMA:getStream(3)[period] + GMMA:getStream(4)[period] + GMMA:getStream(5)[period];
        s = GMMA:getStream(6)[period] + GMMA:getStream(7)[period] + GMMA:getStream(9)[period] +
            GMMA:getStream(9)[period] + GMMA:getStream(10)[period] + GMMA:getStream(11)[period];
       
        out[period] = (f - s) / s * 100;
   
        if out[period] > 0 then out1;
        elseif out[period] <0 then out2;
    end
end



Cheers
Jigit Jigit
 
Posts: 54
Joined: Tue Aug 31, 2010 1:04 pm

Re: Guppy's Multiple Moving Average and Convergence/Divergence

Postby Apprentice » Sun Jan 29, 2012 1:40 pm

Try this Version of GMMACD.
I have add Coloring Option.
GMMACD.lua
(1.63 KiB) Downloaded 2229 times
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Guppy's Multiple Moving Average and Convergence/Divergence

Postby Jigit Jigit » Mon Jan 30, 2012 5:15 pm

Thank you Apprentice. It certainly does the trick.
Jigit Jigit
 
Posts: 54
Joined: Tue Aug 31, 2010 1:04 pm

Re: Guppy's Multiple Moving Average and Convergence/Divergence

Postby zmender » Mon Feb 06, 2012 10:10 pm

Would it be possible to have a multi frame (BF) version of this indicator?
zmender
 
Posts: 43
Joined: Thu Nov 10, 2011 11:00 pm

Re: Guppy's Multiple Moving Average and Convergence/Divergence

Postby sunshine » Mon Feb 06, 2012 11:56 pm

You can choose the the bigger timeframe on the Data Source tab in the Indicator Properties dialog box.
Please read also: Applying other time frame indicator
sunshine
 

PreviousNext

Return to Custom Indicators

Who is online

Users browsing this forum: Baidu [Spider] and 50 guests