Empty Bars

Questions about MultiCharts and user contributed studies.
skyluck2001
Posts: 15
Joined: 16 Oct 2010
Has thanked: 1 time

Empty Bars

Postby skyluck2001 » 27 Oct 2011

Hi All,

How do I get MC to display the last traded price for a bar period that has no trade? My formulas that reference the last couple of bars fail to calculate if one or more of the referenced bar period is empty.

Thanks and best regards,
See KL

User avatar
JoshM
Posts: 2075
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1523 times
Been thanked: 1480 times
Contact:

Re: Empty Bars

Postby JoshM » 29 Oct 2011

skyluck2001 wrote:How do I get MC to display the last traded price for a bar period that has no trade? My formulas that reference the last couple of bars fail to calculate if one or more of the referenced bar period is empty.

Can you elaborate somewhat on what you want to achieve? Do you want to display the last price (i.e. Close, possible saved in a variable), or do you want to force the script to calculate (have you tried RecalcLastBarAfter()?), or do you mean something entirely else? :)

Regards,
Josh

skyluck2001
Posts: 15
Joined: 16 Oct 2010
Has thanked: 1 time

Re: Empty Bars

Postby skyluck2001 » 29 Oct 2011

Hi Josh,

I run a 5 second bar chart. In order to calculate the midpoint of a particular 1 minute period, I have a script that references the last 12 bars (5sec x 12 bars = 1min eg. (Highest(H,12)+Lowest(L,12))/2).

However, this script will fail to calculate if any of the 12 bars is empty (ie. no trade). If there are trades for all twelve bars, then there is no problem.

I wonder if it is possible to make MC display the last traded price instead of an empty bar for those bar periods that are empty.

Thanks for replying.

Best regards,
See KL

User avatar
Henry MultiСharts
Posts: 8386
Joined: 25 Aug 2011
Has thanked: 1201 times
Been thanked: 2679 times

Re: Empty Bars

Postby Henry MultiСharts » 31 Oct 2011

Hello Sir.
Please let me know what do you understand as a bar with trade/without trade.
Please provide screenshots of such bars.

skyluck2001
Posts: 15
Joined: 16 Oct 2010
Has thanked: 1 time

Re: Empty Bars

Postby skyluck2001 » 31 Oct 2011

Hi Henry,

Please see attached screenshot. The bar periods below the black arrows are empty (no trade).

Best regards,
See KL
Attachments
09-281-crop.bmp
09-281-crop.bmp (1.43 MiB) Viewed 139 times

User avatar
Henry MultiСharts
Posts: 8386
Joined: 25 Aug 2011
Has thanked: 1201 times
Been thanked: 2679 times

Re: Empty Bars

Postby Henry MultiСharts » 01 Nov 2011

The empty period has no price. The script is not calculated on such empty periods.
The calculation will be performed on the previous traded bar.

skyluck2001
Posts: 15
Joined: 16 Oct 2010
Has thanked: 1 time

Re: Empty Bars

Postby skyluck2001 » 01 Nov 2011

Greetings,

Is it possible to display the last traded price for empty bars, instead of showing them as empty?

Best regards,
See KL

User avatar
Henry MultiСharts
Posts: 8386
Joined: 25 Aug 2011
Has thanked: 1201 times
Been thanked: 2679 times

Re: Empty Bars

Postby Henry MultiСharts » 02 Nov 2011

Do you mean you want to dublicate the last traded bar replacing the empty period?

sptrader
Posts: 622
Joined: 09 Apr 2010
Location: Colorado
Has thanked: 388 times
Been thanked: 229 times
Contact:

Re: Empty Bars

Postby sptrader » 02 Nov 2011

skyluck2001 wrote:Greetings,

Is it possible to display the last traded price for empty bars, instead of showing them as empty?

Best regards,
See KL

***********************************************************************
** I think this is what you want-

"right mouse click" on the chart, then select ->Format window->X-time scale->Uncheck "Show empty periods".
These users thanked the author sptrader for the post:
JoshM

skyluck2001
Posts: 15
Joined: 16 Oct 2010
Has thanked: 1 time

Re: Empty Bars

Postby skyluck2001 » 06 Nov 2011

Thanks.


Return to “MultiCharts”