Page 1 of 2

Belkhayate's Timing Indicator

PostPosted: Tue Apr 20, 2010 2:47 pm
by Nikolay.Gekht
BELTIME.png


Download the indicator:
BELTIME.lua
(2.24 KiB) Downloaded 4057 times


Code: Select all
-- Indicator profile initialization routine
-- Defines indicator profile properties and indicator parameters
function Init()
    indicator:name("Belkayate timing indicator");
    indicator:description("");
    indicator:requiredSource(core.Bar);
    indicator:type(core.Oscillator);

    indicator.parameters:addInteger("N", "Number of bars", "No description", 5);
end

-- Indicator instance initialization routine
-- Processes indicator parameters and creates output streams
-- Parameters block
local N;

local first;
local source = nil;

-- Streams block
local O = nil;
local H = nil;
local L = nil;
local C = nil;

-- Routine
function Prepare()
    N = instance.parameters.N;
    source = instance.source;
    first = source:first() + N;

    local name = profile:id() .. "(" .. source:name() .. ", " .. N .. ")";
    instance:name(name);
    O = instance:addStream("O", core.Line, name .. ".O", "O", 0, first);
    H = instance:addStream("H", core.Line, name .. ".H", "H", 0, first);
    L = instance:addStream("L", core.Line, name .. ".L", "L", 0, first);
    C = instance:addStream("C", core.Line, name .. ".C", "C", 0, first);
    O:addLevel(8);
    O:addLevel(6);
    O:addLevel(0);
    O:addLevel(-6);
    O:addLevel(-8);
    instance:createCandleGroup("BT", "BT", O, H, L, C);
end

-- Indicator calculation routine
function Update(period)
    if period >= first then
        local range, sumhigh, sumlow, avg1, avg2;
        range = core.rangeTo(period, N);
        sumhigh = core.sum(source.high, range);
        sumlow = core.sum(source.low, range);
        avg1 = (sumhigh + sumlow) / (2 * N);
        avg2 = (sumhigh - sumlow) / (5 * N);

        O[period] = (source.open[period] - avg1) / avg2;
        H[period] = (source.high[period] - avg1) / avg2;
        L[period] = (source.low[period] - avg1) / avg2;
        C[period] = (source.close[period] - avg1) / avg2;
    end
end

Re: Belkhayate's Timing Indicator

PostPosted: Tue Jun 19, 2012 4:23 pm
by TMos1124
Can an alert be made for this indicator? (x > |8|....)

Re: Belkhayate's Timing Indicator

PostPosted: Wed Jun 20, 2012 1:40 am
by Apprentice
Your request is added to the Development List.

Re: Belkhayate's Timing Indicator

PostPosted: Thu Jun 21, 2012 1:52 pm
by Apprentice
BELTIME with Alert.png


I have made ​​the update of original indicator.
OB / OS levels can now be changed.
Audio, Email Alerts are now supported.

You can choose from 5 signals, OB1, OB2, OS1, OS2 and Zero Line Cross.
BELTIME with Alert.lua
(13.11 KiB) Downloaded 2259 times


Compatibility issue Fix. _Alert helper is not longer needed.
If you want to use the updated version,
please make sure to use latest version of TS.

Re: Belkhayate's Timing Indicator

PostPosted: Thu Jun 21, 2012 5:39 pm
by TMos1124
Is it possible to have this alert at the tick rather than the close of the candle?

Re: Belkhayate's Timing Indicator

PostPosted: Wed Jun 27, 2012 5:48 am
by cccornesss
Thanks, amazing job and indicator!

Could it be possible to add another configurable line/level? I mean: another OB3 & OS3, with alert.

Thank you very much in advance ;)

Re: Belkhayate's Timing Indicator

PostPosted: Thu Jun 28, 2012 1:16 am
by Apprentice
Your request is added to the development list.

Re: Belkhayate's Timing Indicator

PostPosted: Fri Jun 29, 2012 6:27 am
by Apprentice
3. OB/OS Level Added.

Re: Belkhayate's Timing Indicator

PostPosted: Mon Jul 02, 2012 2:13 am
by cccornesss
That was quick!!! Thank you very much :D

Re: Belkhayate's Timing Indicator

PostPosted: Mon Jul 02, 2012 3:30 pm
by londonfx
Please add Mt4 version. Thank you,