Page 1 of 1

Time Remaining Indicator for MC

Posted: 28 Oct 2006
by damageboy
Hi,
This is the first release of my Time Remaining indicator for MC, which displays the approximate time left for the current bar, just to the right of that bar.

Ultimately this looks something like:
Image

The indicator will plot how many seconds are left until the current bar ends. This should be taken as an approximate value, since there is no possibility to ensure the indicator runs every second...
Basically the way the indicator works is by displaying how many seconds are left every time it is called (every tick), so on highly active markets (such as the ES, DAX etc.) this will usually mean the indicator is pretty accurate... ;)

NOTE: This indicator has only been tested with the latest beta of MC (1.90.644.1126).

The indicator has the following Inputs:
  • FontName - Font to use to draw the text, I use, "ProggyTiny", which can be downloaded here: http://www.lowing.org/fonts/
  • FontSize - ... Guess...
  • TZOffset - The amount of offset in hours from the computers clock to the chart's time, you will have to check by how much is the computer's clock is offseted from the charts time (depends on you settings...)... can be positive/negative
  • DisplayTickOffset - By how much should the indicator be offset to the right, in a 5 minute chart, setting DisplayTickOffset to 1, will plot the indicator 5 minutes to the right (i.e. 1 bar right)

Posted: 09 Jun 2008
by TJ
looks nice.
Thanks.

Re: Time Remaining Indicator for MC

Posted: 09 Jun 2008
by LRP
[quote]
NOTE: This indicator has only been tested with the latest beta of MC (1.90.644.1126).

Feedback for MC Version 3.1.1304.202:
------ Compiled with error(s): ------
syntax error, unexpected 'End', expecting ';'
errLine 54, errColumn 0, errLineEnd 54, errColumnEnd 0

==> any ideas?
THX and kind regards
LRP

Posted: 09 Jun 2008
by TJ
begin
DisplayTime = (IntPortion(DisplayTime / 100) + 1) * 100 + Mod(Mod(DisplayTime, 100), 60);
end;



add a semi-colon to the end of the statement.

Posted: 09 Jun 2008
by danilo
The new MC version has a more improved syntax checking, in the previous version of MC would allowed to don't put a semicolon at the end of a statement that precede the keyword "end" now the compiler will issue a error message, I think that a lot of custom strategies would need to be fixed. :wink:

Posted: 09 Jun 2008
by LRP
THX a lot to the good guys...
LRP

Posted: 11 Jun 2008
by Marina Pashkova
Just ironing out the glitches, guys.

Posted: 16 Jun 2008
by miltonc4
Hi Damageboy
How can I find the indicator code for this timer ?
Regards
Milton

Posted: 16 Jun 2008
by TJ
go to the 1st post, download the 2nd attachment.

then open the powerlanguage editor, do a file> import.

Posted: 16 Jun 2008
by TJ
I found the script works great with Local time (ES on ET).

However I had problem with HSI with exchange time.

Exchange time = Hong Kong = -12
computer time = ET

The time would jump at the last 30 second.

Does anybody experienced the same problem?
Do you know how to fix it?

Posted: 16 Jun 2008
by miltonc4
Thanks TJ
The difficulty I am having is that when I open the file I get the following :-

Code: Select all


<?xml version="1.0" encoding="UTF-16" standalone="yes" ?>
- <Graph>
- <GraphNode>
<data first="ib_Timeb20Remaining" second="1" />
<signature ObligatoryParamCount="0" RetType="0" StorageType="32" />
<StudyProperties BarRefMode="1" BarRefValue="50" SaveAsSymbol="0" SemilogAxis="1" />
<PasswordState IsProtectedByPassword="0" Password="1B2M2Y8AsgTpgAmY7PhCfg==" />
<NodeText Encoded="1">SW5wdXRzOgoJRm9udE5hbWUoIlByb2dneVRpbnkiKSwKCUZvbnRTaXplKDgpLAoJVFpPZmZzZXQo MCksCglEaXNwbGF5VGlja09mZnNldCgxKTsKClZhcmlhYmxlczoKCURpc3BsYXlQcmljZSgwKSwK CURpc3BsYXlUaW1lKDApLAoJSHJzKDApLAoJTWluKDApLAoJU2VjKDApLAoJQmFyTWluKDApLAoJ QmFySHJzKDApLAoJQmFyU2VjKDApLAoJSW5SZWFsdGltZSggZmFsc2UgKSwKCUNUKDApLAoJVElu U2VjKDApLAoJQlRJblNlYygwKSwKCVRleHRJRCgtMSksCglTdHIoIiIpLAoJT25lVGljayhNaW5N b3ZlL1ByaWNlU2NhbGUpOwoJCgkKQ1QgPSBjb21wdXRlcmRhdGV0aW1lOwoKSW5SZWFsdGltZSA9 IEdldEFwcEluZm8oIGFpUmVhbHRpbWVDYWxjICkgPSAxIDsKCgpCYXJIcnMgPSBJbnRQb3J0aW9u KHRpbWUgLyAxMDApOwpCYXJNaW4gPSBNb2QodGltZSwxMDApOwpCYXJTZWMgPSAwOwo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dF9zZXRsb2NhdGlvbihUZXh0SUQsIERhdGUsIERpc3BsYXlUaW1lLCBEaXNwbGF5UHJp Y2UpOwp0ZXh0X3NldGJvcmRlcihUZXh0SUQsIFRydWUpOwp0ZXh0X3NldHN0cmluZyhUZXh0SUQs IFN0cik7CnRleHRfc2V0Zm9udG5hbWUoVGV4dElELCBGb250TmFtZSk7CnRleHRfc2V0c2l6ZShU ZXh0SUQsIEZvbnRTaXplKTsKVGV4dF9TZXRTdHlsZShUZXh0SUQsIDAsIDIpOyAKCgoKCgoK</NodeText>
</GraphNode>
</Graph>

Posted: 16 Jun 2008
by TJ
Thanks TJ
The difficulty I am having is that when I open the file I get the following :-
read my lips...

then open the powerlanguage editor, do a file> import.