Script Calculation On Candle Open

Questions about MultiCharts and user contributed studies.
tony
Posts: 420
Joined: 14 Jun 2013
Has thanked: 30 times
Been thanked: 81 times
Contact:

Script Calculation On Candle Open

Postby tony » 19 Dec 2013

When a candle closes, say a 5 minute candle for example, I'm noticing something that seems odd when the very next candle is formed. I'm trading 30 year Treasury futures, so say the candle closes at 11 ticks and the next print is 12 ticks. So the next candle shows an open price of 12 ticks. My variables are then calculated after this 12 prints obviously. But what I notice is sometimes the 12 will be used as the close price (IOG=True) and is compared to variables BEFORE the script is run with the last price of 12.

For example I use a bollinger band in one study. The candle closes at 11 and the upper band may be 11.8 for a value (call it var8). The very next price is 12 (the open of the next candle) and sometimes the price of 12 is compared to the value of 11.8 for the upper bollinger which is based on the prior close of 11 and the conditional of close > var8 is therefore true. But in reality, var8 if calculated on the print of 12 would perhaps be 12.1 and the conditional statement would not have been true.

I do hope this makes sense and more so, curious if anyone else has ever seen this happen. And if so, what did you do to resolve it?

Thank You -

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

Re: Script Calculation On Candle Open

Postby Henry MultiСharts » 20 Dec 2013

Hello Tony,

Please send me (support@multicharts.com) the following information for analysis of this behavior:
- What exact version and build number of MultiCharts are you running? (in MultiCharts go to Help tab-> About)
- workspace you are using;
- in QuoteManager select the symbol you are using, make a right click on it->Export data->Export instrument (with data). Send me the Qmd export file for analysis;
- in PowerLanguage editor->File->Export->export with dependent functions the study you are using for tracing this behavior. Send me the study export file.
- Please attach a detailed description and highlight the issue on the screenshots.

If the file size is >10 mb please upload it to any file sharing hosting and send me the download link.

tony
Posts: 420
Joined: 14 Jun 2013
Has thanked: 30 times
Been thanked: 81 times
Contact:

Re: Script Calculation On Candle Open

Postby tony » 20 Dec 2013

HI Henry - I can't share all of that for proprietary reasons. Was hoping someone may have experienced this themselves and can help troubleshoot. I will say in simulated testing I am using a MAC with a virtual PC running 64 bit windows OS. System RAM is 4GB split between the MAC and virtual machine. So it's possible I am finding some problems due to hardware which I will be addressing prior to running real money.

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

Re: Script Calculation On Candle Open

Postby Henry MultiСharts » 23 Dec 2013

Hello Tony,

You can create a sample code and sample workspace that will just replicate this behavior. In this case you do not need to reveal your proprietary algorithms and we will be able to help you with this inquiry.


Return to “MultiCharts”