Lastbaronchart doesn't work with Open Next Bar

Questions about MultiCharts and user contributed studies.
wilkinsw
Posts: 662
Joined: 21 Apr 2013
Has thanked: 154 times
Been thanked: 104 times

Lastbaronchart doesn't work with Open Next Bar

Postby wilkinsw » 09 May 2019

Hi,

Lastbaronchart will never = TRUE in a signal that also possesses "open next bar" anywhere in the code.

I have to use "open next bar". How might I detect the last bar on chart??

Test:

Code: Select all

if LastBarOnChart then begin

raiseruntimeerror("LBOC");

if open next bar > 0 then value99=1;
No error message will be generated until you block out the last line.

MC12 17490

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Lastbaronchart doesn't work with Open Next Bar

Postby Henry MultiСharts » 10 May 2019

Hello wilkinsw,

LastBarOnChart can be used on minute and daily-based resolutions. If your chart's resolution is tick-based - you will need to use LastBarOnChart_s or LastBarOnChart_dt.

wilkinsw
Posts: 662
Joined: 21 Apr 2013
Has thanked: 154 times
Been thanked: 104 times

Re: Lastbaronchart doesn't work with Open Next Bar

Postby wilkinsw » 10 May 2019

I did the test on a 5min interval chart.

Feel free to test it yourself.

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Lastbaronchart doesn't work with Open Next Bar

Postby Henry MultiСharts » 10 May 2019

wilkinsw, this has been tested on various builds, including the one you are running, and the latest release. Please send me the workspace and export of the study that do not work for you.

wilkinsw
Posts: 662
Joined: 21 Apr 2013
Has thanked: 154 times
Been thanked: 104 times

Re: Lastbaronchart doesn't work with Open Next Bar

Postby wilkinsw » 16 May 2019

Very odd that you can't reproduce this.

Please find attached:
demo of ONB LBOC bug.zip
(235.35 KiB) Downloaded 158 times

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Lastbaronchart doesn't work with Open Next Bar

Postby Henry MultiСharts » 17 May 2019

wilkinsw,

The behavior you have described can happen only when there are no realtime updates, or the market is closed, or in offline mode.
That is expected, since there is no last code calculation, which is the script execution trigger when Open Next Bar is used.
Therefore, there is no way to get Lastbaronchart = True with Open Next Bar if there is no realtime coming in.


Return to “MultiCharts”