Page 2 of 7

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

PostPosted: Wed Jan 18, 2012 4:29 am
by Alexander.Gettinger
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

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

PostPosted: Fri Jan 20, 2012 6:15 am
by Jigit Jigit
Thank you Alexander.

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

PostPosted: Fri Jan 27, 2012 12:52 pm
by Jigit Jigit
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!

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

PostPosted: Fri Jan 27, 2012 6:17 pm
by Apprentice
Your request is added to the developmental cue.

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

PostPosted: Sat Jan 28, 2012 12:36 pm
by waelsaleem
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.

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

PostPosted: Sun Jan 29, 2012 4:48 am
by Jigit Jigit
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

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

PostPosted: Sun Jan 29, 2012 1:40 pm
by Apprentice
Try this Version of GMMACD.
I have add Coloring Option.
GMMACD.lua
(1.63 KiB) Downloaded 2232 times

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

PostPosted: Mon Jan 30, 2012 5:15 pm
by Jigit Jigit
Thank you Apprentice. It certainly does the trick.

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

PostPosted: Mon Feb 06, 2012 10:10 pm
by zmender
Would it be possible to have a multi frame (BF) version of this indicator?

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

PostPosted: Mon Feb 06, 2012 11:56 pm
by sunshine
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