Current in-progress incomplete CandleStick

Moderator: admin

Current in-progress incomplete CandleStick

Postby 7000306337 » Sun Dec 23, 2018 10:46 pm

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,
7000306337
 
Posts: 64
Joined: Sat Jul 15, 2017 9:48 am

Re: Current in-progress incomplete CandleStick

Postby Apprentice » Mon Dec 24, 2018 6:00 am

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.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Current in-progress incomplete CandleStick

Postby 7000306337 » Fri May 10, 2019 10:36 am

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.
7000306337
 
Posts: 64
Joined: Sat Jul 15, 2017 9:48 am

Re: Current in-progress incomplete CandleStick

Postby 7000306337 » Fri May 10, 2019 11:00 am

Forgot to mention that the chart has this info.
The chart shows the current in-progress incomplete candle showing the high and the low.
7000306337
 
Posts: 64
Joined: Sat Jul 15, 2017 9:48 am

Re: Current in-progress incomplete CandleStick

Postby 7000306337 » Thu Oct 10, 2019 5:22 pm

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,
7000306337
 
Posts: 64
Joined: Sat Jul 15, 2017 9:48 am

Re: Current in-progress incomplete CandleStick

Postby Apprentice » Sun Oct 20, 2019 3:57 am

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.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Current in-progress incomplete CandleStick

Postby 7000306337 » Tue Jan 14, 2020 3:09 pm

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?
7000306337
 
Posts: 64
Joined: Sat Jul 15, 2017 9:48 am

Re: Current in-progress incomplete CandleStick

Postby 7000306337 » Tue Jan 14, 2020 3:15 pm

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?
7000306337
 
Posts: 64
Joined: Sat Jul 15, 2017 9:48 am

Re: Current in-progress incomplete CandleStick

Postby Apprentice » Sun Feb 02, 2020 7:26 am

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)
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia


Return to Indicator Development

Who is online

Users browsing this forum: No registered users and 9 guests