Page 1 of 1
Current in-progress incomplete CandleStick
Posted:
Sun Dec 23, 2018 10:46 pm
by 7000306337
Hello:
Thank you very much for your valuable time. Very much appreciated.
How do I access the current incomplete Candlestick.
source.high[period], source.low[period], source.close[period], source.open[period], etc etc all pertain to the last COMPLETE Candlestick.
Question is; how do I access the corresponding values of the current in-progress INCOMPLETE Candlestick?
And how do I compare these values to the tick value of (let´s say) a simple moving average?
Indicators display and update ALL these values on the chart every tick. I can see them and read them on the chart, but don´t know how to access them programmatically.
Sincerest Gratitude,
Re: Current in-progress incomplete CandleStick
Posted:
Mon Dec 24, 2018 6:00 am
by Apprentice
source.close[period] will get last current candle price
source.close[period-1] will get previous, complete candle price
Can you give me some example,
will code this for you.
It would be simpler to show you this on the real code.
Re: Current in-progress incomplete CandleStick
Posted:
Fri May 10, 2019 10:36 am
by 7000306337
Sorry but I´m still confused about the current unfinished candle.
For example, on a month time frame chart, source.high[period] is the high of April 2019 (the most recently completed candle).
But I don´t know how to compare the high of May 2019 (the current in-progress incomplete candle) to the high of April 2019?
I know source[period] is the tick value of May 2019 (the current incomplete candle), but what is the high, low of May 2019? (it certainly is not source.high[period] because that is the high of April)
Very much appreciate your valuable mentor.
Re: Current in-progress incomplete CandleStick
Posted:
Fri May 10, 2019 11:00 am
by 7000306337
Forgot to mention that the chart has this info.
The chart shows the current in-progress incomplete candle showing the high and the low.
Re: Current in-progress incomplete CandleStick
Posted:
Thu Oct 10, 2019 5:22 pm
by 7000306337
Hi:
Thank you very much in advance for your valuable time.
Please forgive me if I´m not able to ask my question very clearly.
My question is very very simple.
Every tick during the current incomplete bar, I want to know the HIGH and LOW.
Nothing more.
At the last tick of the current bar:
HIGH will be assigned to the bar stream source.high[period-0]
LOW will be assigned to the bar stream source.low[period-0]
In other words:
Every tick, what is the HIGH and LOW of the tick stream since the last bar was closed complete?
Best regards,
Re: Current in-progress incomplete CandleStick
Posted:
Sun Oct 20, 2019 3:57 am
by Apprentice
source.high[period] and source.low[period] will give you the highest / lowest tick value during the current candle.
If H1 is used, it will be the highest / lowest tick since the start of the last one hour candle.
Re: Current in-progress incomplete CandleStick
Posted:
Tue Jan 14, 2020 3:09 pm
by 7000306337
Hello:
indicator:requiredSource(core.Tick);
....
function Update(period)
source[period]
-- will access only one value of current incomplete bar (depending on the data source selected i.e. high, low, close, typical, median, etc )
end
====================================================
indicator:requiredSource(core.Bar);
....
function Update(period)
source.high[period]
source.low[period]
source.open[period]
source.close[period]
-- can access simultaneously all the fixed values of the first completed bar.
end
====================================================
I´m not clear what to do to simultaneously access both high and low of current incomplete bar. Is there a way?
Re: Current in-progress incomplete CandleStick
Posted:
Tue Jan 14, 2020 3:15 pm
by 7000306337
I´m not clear what to do to simultaneously access the tick values of both high and low of current incomplete bar. Is there a way?
Re: Current in-progress incomplete CandleStick
Posted:
Sun Feb 02, 2020 7:26 am
by Apprentice
Sure.
To calculate the median price.
local Median=(source.high[period]+source.low[period])/2
To Calculate Average of three
local Average=(source.close[period-2]+source.close[period-1]+source.close[period])
or
local Average=mathex.avg(source.close, period-2, period)