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
Empty Bars
- JoshM
- Posts: 2195
- Joined: 20 May 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
Re: Empty Bars
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?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.
Regards,
Josh
-
- Posts: 15
- Joined: 16 Oct 2010
- Has thanked: 1 time
Re: Empty Bars
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
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
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: Empty Bars
Hello Sir.
Please let me know what do you understand as a bar with trade/without trade.
Please provide screenshots of such bars.
Please let me know what do you understand as a bar with trade/without trade.
Please provide screenshots of such bars.
-
- Posts: 15
- Joined: 16 Oct 2010
- Has thanked: 1 time
Re: Empty Bars
Hi Henry,
Please see attached screenshot. The bar periods below the black arrows are empty (no trade).
Best regards,
See KL
Please see attached screenshot. The bar periods below the black arrows are empty (no trade).
Best regards,
See KL
- Attachments
-
- 09-281-crop.bmp
- (1.43 MiB) Downloaded 511 times
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: Empty Bars
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.
The calculation will be performed on the previous traded bar.
-
- Posts: 15
- Joined: 16 Oct 2010
- Has thanked: 1 time
Re: Empty Bars
Greetings,
Is it possible to display the last traded price for empty bars, instead of showing them as empty?
Best regards,
See KL
Is it possible to display the last traded price for empty bars, instead of showing them as empty?
Best regards,
See KL
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
-
- Posts: 742
- Joined: 09 Apr 2010
- Location: Texas
- Has thanked: 483 times
- Been thanked: 274 times
- Contact:
Re: Empty Bars
***********************************************************************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".