Page 1 of 2

Volty Channel Stop + bigger time frame version

PostPosted: Fri Apr 30, 2010 11:10 am
by Nikolay.Gekht
Upd Sep 22 2010: The bigger time frame version is added. See below in the download section.

The indicator is a port of TrendLaboratory's MT4 VoltyStop.2.1 indicator published at
http://finance.groups.yahoo.com/group/TrendLaboratory
The classic recommendation is to
Buy when VoltyChannel_Stop long signal appears over SMA.
Sell when VoltyChannel_Stop short signal appears under SMA.
(http://www.tradingsystemforex.com/exper ... op-ea.html)

voltystop.png




Download:
VoltyChannel_Stop.lua
(7.65 KiB) Downloaded 4918 times

Volty Channel Stop Indicator.lua
Single stream version.
(9.19 KiB) Downloaded 1314 times

Volty Channel Stop Indicator Overlay.lua
(8.85 KiB) Downloaded 1193 times


Bigger time frame version:
Bf_VoltyChannel_Stop.lua
(8.57 KiB) Downloaded 3112 times


Code: Select all
-- The original indicator VoltyChannel_Stop_v2.1.mq4
--  Copyright © 2007, TrendLaboratory
--  http://finance.groups.yahoo.com/group/TrendLaboratory
--  E-mail: igorad2003@yahoo.co.uk
-- v2.1. Modified by
--  MODIFIED BY AVERY T. HORTON, JR. AKA THERUMPLEDONE@GMAIL.COM
-- ---------------------------------------------------------------------
-- This port to lua is made by http://fxcodebase.com team.
-- ---------------------------------------------------------------------
-- Indicator profile initialization routine
-- Defines indicator profile properties and indicator parameters
function Init()
    indicator:name("Volty Channel Stop");
    indicator:description("");
    indicator:requiredSource(core.Bar);
    indicator:type(core.Indicator);

    indicator.parameters:addInteger("MA_N", "Moving Average Period", "", 1);
    indicator.parameters:addString("MA_M", "Moving Average Method", "The methods marked by an asterisk (*) require the appropriate indicators to be loaded.", "MVA");
    indicator.parameters:addStringAlternative("MA_M", "MVA", "", "MVA");
    indicator.parameters:addStringAlternative("MA_M", "EMA", "", "EMA");
    indicator.parameters:addStringAlternative("MA_M", "LWMA", "", "LWMA");
    indicator.parameters:addStringAlternative("MA_M", "SMMA*", "", "SMMA");
    indicator.parameters:addStringAlternative("MA_M", "Vidya (1995)*", "", "VIDYA");
    indicator.parameters:addStringAlternative("MA_M", "Vidya (1992)*", "", "VIDYA92");
    indicator.parameters:addStringAlternative("MA_M", "Wilders*", "", "WMA");
    indicator.parameters:addInteger("ATR_N", "ATR period", "", 10);
    indicator.parameters:addDouble("VF", "Volatility's Factor or Multiplier", "", 4);
    indicator.parameters:addInteger("OF", "Offset factor", "", 0);
    indicator.parameters:addString("P", "Price", "The price to the indicator apply to", "C");
    indicator.parameters:addStringAlternative("P", "Open", "", "O");
    indicator.parameters:addStringAlternative("P", "High", "", "H");
    indicator.parameters:addStringAlternative("P", "Low", "", "L");
    indicator.parameters:addStringAlternative("P", "Close", "", "C");
    indicator.parameters:addStringAlternative("P", "Median", "", "M");
    indicator.parameters:addStringAlternative("P", "Typical", "", "T");
    indicator.parameters:addStringAlternative("P", "Weighted", "", "W");
    indicator.parameters:addBoolean("HiLoE", "Use High/Low envelope", "", false);
    indicator.parameters:addBoolean("HiLoB", "Hi/Lo Break", "", true);
    indicator.parameters:addColor("UpBuffer_color", "Color of UpBuffer", "", core.rgb(0, 255, 0));
    indicator.parameters:addColor("DnBuffer_color", "Color of DnBuffer", "", core.rgb(255, 0, 0));
    indicator.parameters:addColor("UpSignal_color", "Color of UpSignal", "", core.rgb(0, 255, 0));
    indicator.parameters:addColor("DnSignal_color", "Color of DnSignal", "", core.rgb(255, 0, 0));
end

-- Indicator instance initialization routine
-- Processes indicator parameters and creates output streams
-- Parameters block
local MA_N;
local MA_M;
local ATR_N;
local VF;
local OF;
local P;
local HiLoE;
local HiLoB;

local first;
local source = nil;

-- Streams block
local UpBuffer = nil;
local DnBuffer = nil;
local UpSignal = nil;
local DnSignal = nil;
local SMin = nil;
local SMax = nil;
local Trend = nil;
local BPRICE;
local SPRICE;
local ATR;

-- Routine
function Prepare()
    MA_N = instance.parameters.MA_N;
    MA_M = instance.parameters.MA_M;
    ATR_N = instance.parameters.ATR_N;
    VF = instance.parameters.VF;
    OF = instance.parameters.OF;
    P = instance.parameters.P;
    HiLoE = instance.parameters.HiLoE;
    HiLoB = instance.parameters.HiLoB;
    source = instance.source;

    local bsrc, ssrc;

    if HiLoE then
        bsrc = source.high;
        ssrc = source.low;
    else
        if P == "O" then
            bsrc = source.open;
            ssrc = source.open;
        elseif P == "H" then
            bsrc = source.high;
            ssrc = source.high;
        elseif P == "L" then
            bsrc = source.low;
            ssrc = source.low;
        elseif P == "C" then
            bsrc = source.close;
            ssrc = source.close;
        elseif P == "M" then
            bsrc = source.median;
            ssrc = source.median;
        elseif P == "T" then
            bsrc = source.typical;
            ssrc = source.typical;
        elseif P == "W" then
            bsrc = source.weighted;
            ssrc = source.weighted;
        end
    end

    BPRICE = core.indicators:create(MA_M, bsrc, MA_N);
    SPRICE = core.indicators:create(MA_M, ssrc, MA_N);
    ATR = core.indicators:create("ATR", source, ATR_N);

    first = source:first() + MA_N + ATR_N;

    local name = profile:id() .. "(" .. source:name() .. ", " .. MA_N .. ", " .. MA_M .. ", " .. ATR_N .. ", " .. VF .. ", " .. OF .. ", " .. P .. ")";
    instance:name(name);
    UpBuffer = instance:addStream("UpBuffer", core.Line, name .. ".UpBuffer", "UpBuffer", instance.parameters.UpBuffer_color, first);
    DnBuffer = instance:addStream("DnBuffer", core.Line, name .. ".DnBuffer", "DnBuffer", instance.parameters.DnBuffer_color, first);
    UpSignal = instance:createTextOutput ("UpSignal", "UpSignal", "Wingdings", 10, core.H_Center, core.V_Bottom, instance.parameters.UpSignal_color, 0);
    DnSignal = instance:createTextOutput ("DnSignal", "DnSignal", "Wingdings", 10, core.H_Center, core.V_Top, instance.parameters.DnSignal_color, 0);
    SMin = instance:addInternalStream(0, 0);
    SMax = instance:addInternalStream(0, 0);
    Trend = instance:addInternalStream(0, 0);
end

-- Indicator calculation routine
function Update(period, mode)
    BPRICE:update(mode);
    SPRICE:update(mode);
    ATR:update(mode);
    if period >= first then
        local bprice, sprice, atr;
        bprice = BPRICE.DATA[period];
        sprice = SPRICE.DATA[period];
        atr = ATR.DATA[period];

        SMax[period] = bprice + VF * atr;
        SMin[period] = sprice - VF * atr;
        Trend[period] = Trend[period - 1];
        if (HiLoB) then
            if source.high[period] > SMax[period - 1] then
                Trend[period] = 1;
            end
            if source.low[period] < SMin[period - 1] then
                Trend[period] = -1;
            end
        else
            if bprice > SMax[period - 1] then
                Trend[period] = 1;
            end
            if sprice < SMin[period - 1] then
                Trend[period] = -1;
            end
        end

        if Trend[period] > 0 then
            if SMin[period] < SMin[period - 1] then
                SMin[period] = SMin[period - 1];
            end
            UpBuffer[period] = SMin[period] - (OF - 1) * atr;
            if UpBuffer[period] < UpBuffer[period - 1] and UpBuffer:hasData(period - 1)  then
                UpBuffer[period] = UpBuffer[period - 1];
            end
            if Trend[period] ~= Trend[period - 1] and Trend[period - 1] ~= 0 then
                UpSignal:set(period, UpBuffer[period], "\225");
            end
        elseif Trend[period] < 0 then
            if SMax[period] > SMax[period - 1] then
                SMax[period] = SMax[period - 1];
            end
            DnBuffer[period] = SMax[period] + (OF - 1) * atr;
            if DnBuffer[period] > DnBuffer[period - 1] and DnBuffer:hasData(period - 1) then
                DnBuffer[period] = DnBuffer[period - 1];
            end
            if Trend[period] ~= Trend[period - 1] and Trend[period - 1] ~= 0 then
                DnSignal:set(period, DnBuffer[period], "\226");
            end
        end
    else
        Trend[period] = 0;
    end
end


MT4/MQ4 version.
viewtopic.php?f=38&t=68347

Re: Volty Channel Stop

PostPosted: Mon May 10, 2010 6:19 am
by Rainbowlighthousecp
Hi,

What should the SMA value be?

Anyone has any experience to share using this system?

Thanks!

Re: Volty Channel Stop

PostPosted: Fri Sep 17, 2010 3:23 pm
by boursicoton
it's a good indicator..marvellus work !
mtf indicator is possible ?
thanks nikolay....
I think that the indicators of this style are the right tools ...
when we have candles in range, or Renko ... we will have a certain advantage Stats!

Re: Volty Channel Stop + bigger time frame version

PostPosted: Wed Sep 22, 2010 4:24 pm
by Nikolay.Gekht
bigger time frame version is added. See the first post.

Re: Volty Channel Stop + bigger time frame version

PostPosted: Sat Dec 25, 2010 3:27 am
by craige
Hi Dear

thanks for the great work, this indicator is very important to me.

as you know, this indicator is very helpful, so could you give me the original code about this indicator.

I will appreciate it for your great help

best regards

PS:my English is not good, hoping you are able to understand what I am writing down.

Re: Volty Channel Stop + bigger time frame version

PostPosted: Mon Jan 30, 2012 10:05 pm
by christhesquid
Is it possible to make a version of this that shows different time frames and what direction the trend is in? It'd be nice to have the arrows in the top right hand corner similar to the multi time frame stochastic indicator.

Re: Volty Channel Stop + bigger time frame version

PostPosted: Tue Jan 31, 2012 3:57 am
by Apprentice
I'll arrange something similar soon.

Re: Volty Channel Stop + bigger time frame version

PostPosted: Tue Jan 31, 2012 4:54 am
by Apprentice
Requested can be found here.
viewtopic.php?f=17&t=12521

Re: Volty Channel Stop + bigger time frame version

PostPosted: Mon Jul 23, 2012 7:11 am
by RJH501
When you get time could you please add the options of changing line width and style.

Thank you,

RJH

Re: Volty Channel Stop + bigger time frame version

PostPosted: Wed Apr 22, 2015 12:44 am
by easytrading
hello Apprentice,

is it possible to add line style option for volty channel stop indicator, please?
my appreciation in advance.