Renko chart (Obsolete)

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: Renko chart.

Postby patick » Thu Feb 17, 2011 9:48 am

Much appreciated... that fixed the problem.
patick
 
Posts: 36
Joined: Tue Mar 30, 2010 2:11 pm

Re: Renko chart.

Postby patick » Thu Feb 17, 2011 1:16 pm

whninja,

Nice work! This is the only way to do it properly to avoid brick lag/missing bricks in Market Scope.
patick
 
Posts: 36
Joined: Tue Mar 30, 2010 2:11 pm

Re: Renko chart.

Postby whninja » Fri Feb 18, 2011 2:40 am

I know, but at this time i have not the time and the skills in lua to do similar. i transfer my data to matlab for analysis.
the good is: lua and matlab are equal in scripting ...

best regards
whninja
 
Posts: 15
Joined: Wed Aug 18, 2010 2:19 am

Re: Renko chart.

Postby Alexander.Gettinger » Mon Feb 21, 2011 2:33 am

There is a feature is present in all version Renko from this topic. View of Renko chart depends on first point. For two different first points charts can look different.

Indicator Renlo2M without this feature.
Download:
Renko2M.lua
(4.57 KiB) Downloaded 3282 times
Alexander.Gettinger
FXCodeBase: Confirmed User
 
Posts: 3785
Joined: Wed Mar 31, 2010 9:40 pm
Location: Russia, Omsk

Re: Renko chart.

Postby whninja » Wed Feb 23, 2011 2:21 pm

can someone help

i had some trouble with the streams and array calc

Code: Select all
function Init()
    indicator:name("BetterRenko");
    indicator:description("BetterRenko");
    indicator:requiredSource(core.Bar);
    indicator:type(core.Indicator);
    indicator:setTag("replaceSource", "t");

    indicator.parameters:addGroup("Calculation");
    indicator.parameters:addInteger("Step", "Step in pips", "", 10);

end

local first;
local source = nil;
local Step;
local up = nil;
local down = nil;

local n;
local i;
local open = nil;
local high = nil;
local low = nil;
local close = nil;

function Prepare()
    source = instance.source.close;
    Step=instance.parameters.Step;
    first = source:first();
    up = instance:addInternalStream(first, 0);
    down = instance:addInternalStream(first, 0);
    local name = profile:id() .. "(" .. source:name() .. ", " .. instance.parameters.Step .. ")";
    instance:name(name);
    open = instance:addStream("open", core.Line, name, "open", core.rgb(0, 0, 0), first)
    high = instance:addStream("high", core.Line, name, "high", core.rgb(0, 0, 0), first)
    low = instance:addStream("low", core.Line, name, "low", core.rgb(0, 0, 0), first)
    close = instance:addStream("close", core.Line, name, "close", core.rgb(0, 0, 0), first)
    instance:createCandleGroup("Renko", "Renko", open, high, low, close);
end

function Update(period, mode)
   if (period==source:size()-1) then

    n=1;
    up[n] = source[first];
    down[n] = source[first];

    for i=first+1,period,1 do
        local not_done;

        if n == first then
            up[n] = source[i];
            down[n] = source[i];
            n = n + 1;
        else
           
            if source[i] > up[n-1] + Step*source:pipSize() then
                up[n] = up[n-1] + Step*source:pipSize();
                down[n] = up[n-1] - Step*source:pipSize();

                n = n + 1;

                if source[i] > up[n-1] + Step*source:pipSize() then
                    not_done = 1;
                else
                    not_done = 0;
                end

                while(not_done == 1) do
                    up[n] = up[n-1] + Step*source:pipSize();
                    down[n] = up[n-1] - Step*source:pipSize();

                    n = n + 1;

                    if source[i] > up[n-1] + Step*source:pipSize() then
                        not_done = 1;
                    else
                        not_done = 0;
                    end
                end

            elseif source[i] < down[n-1] - Step*source:pipSize() then
                down[n] = down[n-1] - Step*source:pipSize();
                up[n] = down[n-1] + Step*source:pipSize();

                n = n + 1;

                if source[i] < down[n-1] - Step*source:pipSize() then
                    not_done = 1;
                else
                    not_done = 0;
                end

                while(not_done == 1) do   
                    down[n] = down[n-1] - Step*source:pipSize();
                    up[n] = down[n-1] + Step*source:pipSize();

                    n = n + 1;

                    if source[i] < down[n-1] - Step*source:pipSize() then
                        not_done = 1;
                    else
                        not_done = 0;
                    end
                end
            else
                down[n] = down[n-1];
                up[n] = up[n-1]

                n = n + 1;

            end
        end
    end

    for i=1,open:size()-1,1 do

        local m=1;
        if i < 2 then
            open[m]=nil;
            close[m]=nil;
            low[m]=nil;
            high[m]=nil;
        else
            if up[i] > up[i-1] then
                open[m]=down[i];
                close[m]=up[i];
                low[m]=down[i];
                high[m]=up[i];
                m = m + 1;

            end
            if up[i] > up[i-1] then
                open[m]=up[i];
                close[m]=down[i];
                low[m]=down[i];
                high[m]=up[i];
                m = m + 1;
            end
        end
    end
end
end
whninja
 
Posts: 15
Joined: Wed Aug 18, 2010 2:19 am

Re: Renko chart.

Postby Victor.Tereschenko » Thu Feb 24, 2011 7:39 am

whninja wrote:can someone help

i had some trouble with the streams and array calc

What king of trouble do you have? "70: Index is out of range."? This peace of code could access the "up" stream with incorrect index ("n"). "N" could become greater that the current period. You shoud add a check for correct index (n <= period).
Code: Select all
                while(not_done == 1) do
                    up[n] = up[n-1] + Step*source:pipSize();
                    down[n] = up[n-1] - Step*source:pipSize();

                    n = n + 1;

                    if source[i] > up[n-1] + Step*source:pipSize() then
                        not_done = 1;
                    else
                        not_done = 0;
                    end
                end
“There are only three sports: bullfighting, motor racing, and mountaineering; all the rest are merely games.” (c) Ernest Hemingway
Victor.Tereschenko
FXCodeBase: Confirmed User
 
Posts: 144
Joined: Fri Nov 19, 2010 8:55 am

Re: Renko chart.

Postby whninja » Thu Feb 24, 2011 2:35 pm

thanks my problem is

n can be greater period (with a small bricksize) or n can be smaller period (with a higher bricksize)

n is the count for the bricks - in this case a higher range of a bar can have more bricks (trend)
i is a count for period/bar - in this case more bars can have only a brick (sideways)

tomorow i will swith i with (current ) period
whninja
 
Posts: 15
Joined: Wed Aug 18, 2010 2:19 am

Re: Renko chart.

Postby Victor.Tereschenko » Mon Feb 28, 2011 8:22 am

whninja wrote:thanks my problem is

n can be greater period (with a small bricksize) or n can be smaller period (with a higher bricksize)

n is the count for the bricks - in this case a higher range of a bar can have more bricks (trend)
i is a count for period/bar - in this case more bars can have only a brick (sideways)

tomorow i will swith i with (current ) period

You an array instead of internal stream.
Code: Select all
local up = {};
local down = {};
function Prepare()
...
end

instead of
Code: Select all
local up = nil;
local down = nil;
function Prepare()
...
    up = instance:addInternalStream(first, 0);
    down = instance:addInternalStream(first, 0)
...
end

Internal stream sizes/clears automatically when it is nessesary. With array you're forced to fo it manually.
Code: Select all
function Update(period, mode)
    if mode == core.UpdateAll then
        -- clear arrays
        up = {};
        ...
    end
end
“There are only three sports: bullfighting, motor racing, and mountaineering; all the rest are merely games.” (c) Ernest Hemingway
Victor.Tereschenko
FXCodeBase: Confirmed User
 
Posts: 144
Joined: Fri Nov 19, 2010 8:55 am

Re: Renko chart.

Postby Pippin » Tue May 17, 2011 1:24 pm

Which is the most updated renko indicator? I'm new to trading with tsII as well as this site. Any help in finding the most recent renko tool will be greatly appreciated. Thanks
Pippin
 
Posts: 1
Joined: Tue May 17, 2011 12:47 pm

Re: Renko chart.

Postby TheEdge » Wed Jan 11, 2012 1:29 pm

Hello,

I don't think this is working properly...I have notice that the bars are not printing until there is a change in direction.

I have a 1hr chart with Renko set at 50pips you'll notice that price is around 250pips but there are no new bars.

This needs to be fixed. Also when using these TSII is very slow and often crashes...maybe someone could convince FXCM to have these as a standard feature as they do on Strategy Trader.
Attachments
gold renko.png
TheEdge
 
Posts: 28
Joined: Fri Nov 25, 2011 3:54 am

PreviousNext

Return to Custom Indicators

Who is online

Users browsing this forum: Bing [Bot], Majestic-12 [Bot] and 55 guests