Heikin-Ashi Partial Candles OC only (Open + Close only)

If you need an Indicator or Signal developed or translated from other language, please post all Indicator development REQUESTS to this section here.

Moderator: admin

Heikin-Ashi Partial Candles OC only (Open + Close only)

Postby 9876543210X » Wed Jan 17, 2018 4:47 pm

viewtopic.php?f=17&t=15078&p=28553&hilit=partial+candles#p28553
LUA-File-Download = download/file.php?id=6148

I have a request to make:
Differing from others I do not exactly value high and low candle wicks or "lines" a whole lot, to be perfectly honest. Therefore I showed you above how exactly the "Partial Candles"-LUA-Indicator looks in Candleworks Trading Station II. I set it to, mark my words, important: "OC", so only open and close prices are shown, therefore: there are no wicks / candle "lines" above or underneath the candles shown, you see. Now I want an indicator with "open close only candles" PLUS Heikin-Ashi standard, nothing fancy like HASM / HA Smoothed.

Request: Is it possible to make "HA Candles Open + Close only as in the LUA of "Partial Candles" with "OC" settings?

Code of "Partial Candles.lua" at your hand for your convenience, gentlemen :idea: :D
Code: Select all
--+------------------------------------------------------------------+
--|                               Copyright © 2017, Gehtsoft USA LLC |
--|                                            http://fxcodebase.com |
--+------------------------------------------------------------------+
--|                                 Support our efforts by donating  |
--|                                    Paypal: https://goo.gl/9Rj74e |
--|                    BitCoin : 15VCJTLaz12Amr7adHSBtL9v8XomURo9RF  | 
--+------------------------------------------------------------------+

function Init()
    indicator:name("Partial candles indicator");
    indicator:description("Partial candles indicator");
    indicator:requiredSource(core.Bar);
    indicator:type(core.Indicator);
    indicator:setTag("replaceSource", "t");
   
    indicator.parameters:addGroup("Calculation");
    indicator.parameters:addString("Type", "Type of candles", "", "OHLC");
    indicator.parameters:addStringAlternative("Type", "OHLC", "", "OHLC");
    indicator.parameters:addStringAlternative("Type", "OLC", "", "OLC");
    indicator.parameters:addStringAlternative("Type", "OHC", "", "OHC");
    indicator.parameters:addStringAlternative("Type", "OHL", "", "OHL");
    indicator.parameters:addStringAlternative("Type", "HLC", "", "HLC");
    indicator.parameters:addStringAlternative("Type", "HC", "", "HC");
    indicator.parameters:addStringAlternative("Type", "LC", "", "LC");
    indicator.parameters:addStringAlternative("Type", "OL", "", "OL");
    indicator.parameters:addStringAlternative("Type", "OH", "", "OH");
    indicator.parameters:addStringAlternative("Type", "OC", "", "OC");
    indicator.parameters:addStringAlternative("Type", "C", "", "C");
    indicator.parameters:addStringAlternative("Type", "O", "", "O");
end

local first;
local source = nil;
local Type;

function Prepare()
    source = instance.source;
    Type = instance.parameters.Type;
    first = source:first();
    local name = profile:id() .. "(" .. source:name() .. " " .. Type ..")";
    instance:name(name);
    open = instance:addInternalStream(first, 0);
    close = instance:addInternalStream(first, 0);
    high = instance:addInternalStream(first, 0);
    low = instance:addInternalStream(first, 0);
    instance:createCandleGroup("Partial candles", "", open, high, low, close);
end

function Update(period, mode)
   if (period>first) then
    if Type=="OHLC" then
     open[period]=source.open[period];
     close[period]=source.close[period];
     high[period]=source.high[period];
     low[period]=source.low[period];
    elseif Type=="OLC" then
     open[period]=source.open[period];
     close[period]=source.close[period];
     high[period]=math.max(open[period],close[period]);
     low[period]=source.low[period];
    elseif Type=="OHC" then
     open[period]=source.open[period];
     close[period]=source.close[period];
     high[period]=source.high[period];
     low[period]=math.min(open[period],close[period]);
    elseif Type=="OHL" then
     open[period]=source.open[period];
     close[period]=open[period];
     high[period]=source.high[period];
     low[period]=source.low[period];
    elseif Type=="HLC" then
     close[period]=source.close[period];
     open[period]=close[period];
     high[period]=source.high[period];
     low[period]=source.low[period];
    elseif Type=="HC" then
     close[period]=source.close[period];
     open[period]=close[period];
     high[period]=source.high[period];
     low[period]=close[period];
    elseif Type=="LC" then
     close[period]=source.close[period];
     open[period]=close[period];
     high[period]=close[period];
     low[period]=source.low[period];
    elseif Type=="OL" then
     open[period]=source.open[period];
     close[period]=open[period];
     high[period]=open[period];
     low[period]=source.low[period];
    elseif Type=="OH" then
     open[period]=source.open[period];
     close[period]=open[period];
     high[period]=source.high[period];
     low[period]=open[period];
    elseif Type=="OC" then
     open[period]=source.open[period];
     close[period]=source.close[period];
     high[period]=math.max(open[period],close[period]);
     low[period]=math.min(open[period],close[period]);
    elseif Type=="C" then
     close[period]=source.close[period];
     open[period]=close[period];
     high[period]=close[period];
     low[period]=close[period];
    elseif Type=="O" then
     open[period]=source.open[period];
     close[period]=open[period];
     high[period]=open[period];
     low[period]=open[period];
    end
   end
end



/ In my book this is actually exactly the same as a renko chart. But, without further knowledge in coding lua indicators, maybe this way it is possible to implement a renko chart without another window necessary as function to serve exotic charts like renko but rather this way it could be possible to implement renko on *every* chart in Candleworks Trading Station II? Leaning myself out the window here, really not sure what to make of it, strikes me kind of odd how a coder would respond to this request. Your best guess? Possible / impossible? :shock:
Last edited by 9876543210X on Wed Jan 17, 2018 5:48 pm, edited 1 time in total.
9876543210X
 
Posts: 2
Joined: Wed Jan 17, 2018 4:36 pm

Re: Heikin-Ashi Partial Candles OC only (Open + Close only)

Postby 9876543210X » Wed Jan 17, 2018 5:45 pm

Added: Thanks for approval to moderator responsible. However, this is in my book the definition of a Renko chart actually. But this way maybe it is possible to implement a Renko chart *without* an extra chart feature but instead right on the chart. Your best guess? :oops:
9876543210X
 
Posts: 2
Joined: Wed Jan 17, 2018 4:36 pm


Re: Heikin-Ashi Partial Candles OC only (Open + Close only)

Postby scafcid » Fri Mar 09, 2018 9:37 am

hello apprentice, I ask if it is possible to indicate the max is minimum of closing the body heikin-ashi candle on this indicator or others, to make me understand the closing HA at the end time frame does not indicate me the max or min closing during the formation of the bar ( what I would like to see in the HA bar) but only its effective closing at the end of the time frame.
Thanks to the availability
scafcid
 
Posts: 15
Joined: Fri Mar 09, 2018 9:07 am

Re: Heikin-Ashi Partial Candles OC only (Open + Close only)

Postby Apprentice » Sat Mar 10, 2018 8:06 pm

As a filter?
If HA body is smaller than the value ignore the signal.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Heikin-Ashi Partial Candles OC only (Open + Close only)

Postby scafcid » Mon Mar 12, 2018 4:20 pm

thanks for your attention, I think it may be fine as a filter, the thing that I would like to see fixed is definitely the max or minimum of the body has in its formation during the time frame
scafcid
 
Posts: 15
Joined: Fri Mar 09, 2018 9:07 am

Re: Heikin-Ashi Partial Candles OC only (Open + Close only)

Postby Apprentice » Tue Mar 13, 2018 7:20 am

Your request is added to the development list under Id Number 4074
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia


Re: Heikin-Ashi Partial Candles OC only (Open + Close only)

Postby scafcid » Thu Mar 15, 2018 4:23 am

Thank you, tried version heikin-ashi partial candles oc lua. but the max closing of the spark plug body does not remain indicated as a reference value until the end of the time frame, but varies or decreases in normal mode until the end of the time frame
scafcid
 
Posts: 15
Joined: Fri Mar 09, 2018 9:07 am

Re: Heikin-Ashi Partial Candles OC only (Open + Close only)

Postby scafcid » Thu Mar 22, 2018 4:20 pm

hi Apprentice, I ask if you were successful to develop my request to fix HA close in the maxi and min of the actual body in the sparkling candle.
Thanks for your attention.
scafcid
 
Posts: 15
Joined: Fri Mar 09, 2018 9:07 am

Next

Return to Indicator and Signal Requests

Who is online

Users browsing this forum: No registered users and 18 guests