TheRumpledOne's (TRO's) Dynamic Support/Resistance

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

TheRumpledOne's (TRO's) Dynamic Support/Resistance

Postby Nikolay.Gekht » Thu Apr 29, 2010 7:34 pm

The indicator is a port of the TheRumpledOne's tro_dynamic_sr indicator.

The original indicator Copyright © 2009, Avery T. Horton, Jr. aka TheRumpledOne
PO BOX 43575, TUCSON, AZ 85733

The original indicator is the donationware and I think that this port must also be. So, if you like this indicator - please donate the TheRumpledOne, the author of the idea.

TheRumpledOne wrote:GIFTS AND DONATIONS ACCEPTED
All my indicators should be considered donationware. That is you are free to use them for your personal use, and are under no obligation to pay for them. However, if you do find this or any of my other indicators help you with your trading then any Gift or Donation as a show of appreciation is gratefully accepted.

The indicator was revised and updated
Gifts or Donations also keep me motivated in producing more great free indicators. :-)
PayPal - THERUMPLEDONE@GMAIL.COM


The indicator generates buy and sell signals. For me it looks a bit noisy, but, from other side, I tested it on various frames and data history and it looks like producing zero-profit-positions in the worst case and some times gives 30-40 pips of profit in both (long and short) directions.

tro_dynamic_sr.png


Download:
tro_dynamic_sr.lua
(6.71 KiB) Downloaded 2976 times


Code: Select all
-- +------------------------------------------------------------------+
-- |   TRO_DYNAMIC_FIBS_SR_Trail                                      |
-- |                                                                  |
-- |   Copyright © 2009, Avery T. Horton, Jr. aka TheRumpledOne       |
-- |                                                                  |
-- |   PO BOX 43575, TUCSON, AZ 85733                                 |
-- |                                                                  |
-- |   GIFTS AND DONATIONS ACCEPTED                                   |
-- |   All my indicators should be considered donationware. That is   |
-- |   you are free to use them for your personal use, and are        |
-- |   under no obligation to pay for them. However, if you do find   |
-- |   this or any of my other indicators help you with your trading  |
-- |   then any Gift or Donation as a show of appreciation is         |
-- |   gratefully accepted.                                           |
-- |                                                                  |
-- |   Gifts or Donations also keep me motivated in producing more    |
-- |   great free indicators. :-)                                     |
-- |                                                                  |
-- |   PayPal - THERUMPLEDONE@GMAIL.COM                               |
-- +------------------------------------------------------------------+
-- Author's site: http://www.therumpledone.com/

function Init()
    indicator:name("TRO's Dymamic SR");
    indicator:description("");
    indicator:requiredSource(core.Bar);
    indicator:type(core.Indicator);

    indicator.parameters:addInteger("N", "Number of periods", "", 5, 2, 10000);
    indicator.parameters:addInteger("Threshold", "Threshold (in pips)", "", 0, 2, 10000);
    indicator.parameters:addInteger("Trigger", "Trigger value (in pips)", "", 5, 2, 10000);
    indicator.parameters:addBoolean("ShowTriggers", "Show Triggers", "", true);
    indicator.parameters:addBoolean("ResetOnNewDay", "Reset support/resistance on new day", "", false);

    indicator.parameters:addColor("colorR", "Color of resistance", "", core.rgb(255, 0, 0));
    indicator.parameters:addColor("colorS", "Color of support", "", core.rgb(0, 255, 0));
    indicator.parameters:addColor("colorSh", "Color of high trigger", "", core.rgb(127, 0, 0));
    indicator.parameters:addColor("colorLg", "Color of low trigger", "", core.rgb(0, 127, 0));
end

local source;
local N;
local bid;
local ask;
local first;
local Threshold;
local Trigger;
local ResetOnNewDay;
local ShowTriggers;

local DynR;
local DynS;
local LgTrig;
local ShTrig;
local BuySignal;
local SellSignal;
local DayCandle;
local host;
local offset;
local CandleLength;

function Prepare()
    host = core.host;
    offset = host:execute("getTradingDayOffset");
    source = instance.source;
    bid = host:execute("getAskPrice");
    ask = host:execute("getBidPrice");

    local s, e;
    s, e = core.getcandle(source:barSize(), core.now(), 0);
    CandleLength = e - s;


    N = instance.parameters.N;
    Threshold = instance.parameters.Threshold * source:pipSize();
    Trigger = instance.parameters.Trigger * source:pipSize();
    ResetOnNewDay = instance.parameters.ResetOnNewDay;
    ShowTriggers = instance.parameters.ShowTriggers;
    first = source:first() + N;

    local name = profile:id() .. "(" .. source:name() .. ", " .. N .. ")";
    instance:name(name);

    DynR = instance:addStream("R", core.Line, name .. ".R", "R", instance.parameters.colorR, first);
    DynS = instance:addStream("S", core.Line, name .. ".S", "S", instance.parameters.colorS, first);

    if ShowTriggers then
        LgTrig = instance:addStream("Lg", core.Line, name .. ".Lg", "Lg", instance.parameters.colorLg, first);
        ShTrig = instance:addStream("Sh", core.Line, name .. ".Sh", "Sh", instance.parameters.colorSh, first);
        Sell = instance:createTextOutput ("Sell", "Sell", "Wingdings", 10, core.H_Center, core.V_Top, instance.parameters.colorS, 0);
        Buy = instance:createTextOutput ("Buy", "Buy", "Wingdings", 10, core.H_Center, core.V_Bottom, instance.parameters.colorR, 0);
    else
        LgTrig = instance:addInternalStream(first, 0);
        ShTrig = instance:addInternalStream(first, 0);
    end

    DayCandle = instance:addInternalStream(0, 0);
end

function Update(period, mode)
    local candle;
    candle = core.getcandle("D1", source:date(period), offset);
    DayCandle[period] = candle;
    if period >= first then
        if CandleLength < 1 and DayCandle[period - 1] ~= DayCandle[period] and ResetOnNewDay then
            DynR[period] = source.high[period];
            DynS[period] = source.low[period];
        else
            local hh, ll;
            ll, hh = core.minmax(source, core.rangeTo(period, N));
            DynR[period] = hh;
            DynS[period] = ll;
            LgTrig[period] = ll + Trigger;
            ShTrig[period] = hh - Trigger;
            if DynR[period] ~= source.high[period] and DynR[period] < DynR[period - 1] then
                DynR[period] = DynR[period - 1];
                ShTrig[period] = ShTrig[period - 1];
            end
            if DynS[period] ~= source.low[period] and DynS[period] > DynS[period - 1] then
                DynS[period] = DynS[period - 1];
                LgTrig[period] = LgTrig[period - 1];
            end
            local alertBuy, alertSell;
            local green, red;
            alertBuy = LgTrig[period] + Threshold;
            alertSell = ShTrig[period] - Threshold;
            green = (source.open[period] < source.close[period]);
            red = (source.open[period] > source.close[period]);

            local bid1, ask1;
            if period == source:size() - 1 then
                bid1 = bid.close[period];
                ask1 = ask.close[period];
            else
                bid1 = bid.low[period];
                ask1 = ask.high[period];
            end

            if ask1 > alertBuy and source.low[period] <= alertBuy and green then
                if ShowTriggers then
                    Buy:set(period, alertBuy, "\225");
                end
            end
            if bid1 < alertSell and source.high[period] >= alertSell and red then
                if ShowTriggers then
                    Sell:set(period, alertSell, "\226");
                end
            end
        end
    else
        if source:hasData(period) then
            DynR[period] = source.close[period];
            DynS[period] = source.close[period];
            LgTrig[period] = source.close[period] - Trigger;
            ShTrig[period] = source.close[period] + Trigger;
        end
    end
end
Nikolay.Gekht
FXCodeBase: Site Admin
 
Posts: 1235
Joined: Wed Dec 16, 2009 6:39 pm
Location: Cary, NC

Re: TheRumpledOne's (TRO's) Dynamic Support/Resistance

Postby Checkz » Tue Sep 07, 2010 3:46 pm

CAN YOU POST AN UPDATED VERSION OF THIS INDICATOR. THE NAME IS:
THE RUMPLED ONE'S (TRO's) DYNAMIC FIBS S/R.
Checkz
 
Posts: 29
Joined: Tue Sep 07, 2010 3:27 pm

Re: TheRumpledOne's (TRO's) Dynamic Support/Resistance

Postby abcdefg » Thu Nov 04, 2010 8:28 pm

Hi guys,
Can I please request a Bigger TF for this indicator for a tick chart. Highly appreciated and thank you in advance for the great work. I'm not sure, but is it ok to remove the signal arrows and keep the trigger line? If it is too much of a hassle, a bigger frame will do just fine. Thanks again. :D

=======
@Nikolay: It is similar to a Donchian channel, but the trigger line with the option to input different values of pips are very useful.
I agree the signal arrows produces near to zero profits, but the trigger line is very powerful in following the trend.
abcdefg
 
Posts: 4
Joined: Thu Aug 05, 2010 11:16 am


Re: TheRumpledOne's (TRO's) Dynamic Support/Resistance

Postby thetruth » Fri Feb 04, 2011 7:42 am

I am using this indicator, i think that the lines produce confusion,
i change the core.Line for core.Dot, i think that looks better.
Attachments
tro_dynamic_sr.lua
(6.73 KiB) Downloaded 1379 times
thetruth
 
Posts: 43
Joined: Thu Feb 25, 2010 3:39 pm

Re: TheRumpledOne's (TRO's) Dynamic Support/Resistance

Postby Apprentice » Wed Nov 30, 2011 3:49 am

untitled2.PNG

Bigger time frame version is now unnecessary.
It is possible to have this, by changing the time frame of the data source.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36435
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: TheRumpledOne's (TRO's) Dynamic Support/Resistance

Postby ram123 » Tue Mar 13, 2012 8:38 am

Hi,
is it possible to install an alarm/email alert in this indicator or better
to make a strategy with possibility for trading.
thanks
Last edited by ram123 on Sun Mar 18, 2012 6:03 am, edited 1 time in total.
ram123
 
Posts: 25
Joined: Thu Mar 31, 2011 9:28 am

Re: TheRumpledOne's (TRO's) Dynamic Support/Resistance

Postby Apprentice » Wed Mar 14, 2012 2:51 am

Can you define a trading algorithm, for this strategy.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36435
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: TheRumpledOne's (TRO's) Dynamic Support/Resistance

Postby ram123 » Wed Mar 14, 2012 3:28 am

algorithm:
-like indicator(period, TH,TG...)
-execute sell or buy when triggered sell or buy
-ignore the first, 2, 3 ... trigger in the period.
-reset by H,D,M,
+price parameter (m1,m5,...)
+trading parameter (trading y/n, limit, stop, etc.)
+signal parameter (alert, play sound etc)
+email parameter
thanks
ram123
 
Posts: 25
Joined: Thu Mar 31, 2011 9:28 am

Re: TheRumpledOne's (TRO's) Dynamic Support/Resistance

Postby Hailkayy » Wed Apr 25, 2012 3:33 pm

Update about strategy requirements.
please base it on the "assymetrical" Tro D S/R (one can still set symetrical settings)

Enter buy trade when buy arrow appears
Enter sell trade when sell arrow appears
Real time Y/N
Close mode Y/N
Filter Y/N
Filter : Trendstop (if Yes activated, strategy will open only short trade when trendstop is above, playing resistance role, and vice versa)
SL
Limit
Limit in candle
Last edited by Hailkayy on Sun May 27, 2012 6:04 am, edited 1 time in total.
Hailkayy
FXCodeBase: Initiate
 
Posts: 191
Joined: Thu Dec 22, 2011 4:42 am

Next

Return to Custom Indicators

Who is online

Users browsing this forum: No registered users and 25 guests