Time Remaining Indicator for MC

Studies that have been contributed to the community by other users. If you’ve got something useful to share, that’s great!
damageboy
Posts: 70
Joined: Sep 15 2006
Been thanked: 15 times

Oct 28 2006

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)
Attachments
TR.xml
(4.79 KiB) Downloaded 753 times
tr.png
(22.14 KiB) Downloaded 1727 times

User avatar
TJ
Posts: 7774
Joined: Aug 29 2006
Location: Global Citizen
Has thanked: 1036 times
Been thanked: 2233 times

Jun 09 2008

looks nice.
Thanks.

User avatar
LRP
Posts: 155
Joined: Apr 07 2008
Location: Switzerland
Has thanked: 98 times
Been thanked: 15 times

Jun 09 2008

[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

User avatar
TJ
Posts: 7774
Joined: Aug 29 2006
Location: Global Citizen
Has thanked: 1036 times
Been thanked: 2233 times

Jun 09 2008

begin
DisplayTime = (IntPortion(DisplayTime / 100) + 1) * 100 + Mod(Mod(DisplayTime, 100), 60);
end;



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

User avatar
danilo
Posts: 170
Joined: Jan 02 2007
Location: Italy
Has thanked: 4 times
Been thanked: 9 times

Jun 09 2008

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:

User avatar
LRP
Posts: 155
Joined: Apr 07 2008
Location: Switzerland
Has thanked: 98 times
Been thanked: 15 times

Jun 09 2008

THX a lot to the good guys...
LRP

User avatar
Marina Pashkova
Posts: 2758
Joined: Jul 27 2007

Jun 11 2008

Just ironing out the glitches, guys.

miltonc4
Posts: 150
Joined: Apr 14 2006
Has thanked: 1 time
Been thanked: 4 times

Jun 16 2008

Hi Damageboy
How can I find the indicator code for this timer ?
Regards
Milton

User avatar
TJ
Posts: 7774
Joined: Aug 29 2006
Location: Global Citizen
Has thanked: 1036 times
Been thanked: 2233 times

Jun 16 2008

go to the 1st post, download the 2nd attachment.

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

User avatar
TJ
Posts: 7774
Joined: Aug 29 2006
Location: Global Citizen
Has thanked: 1036 times
Been thanked: 2233 times

Jun 16 2008

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?

miltonc4
Posts: 150
Joined: Apr 14 2006
Has thanked: 1 time
Been thanked: 4 times

Jun 16 2008

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">SW5wdXRzOgoJR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oiICsgTnVtVG9TdHIoQmFyTWlu LCAwKSAgKyAiOiIgKyBOdW1Ub1N0cihCYXJTZWMsIDApIDsKCkRpc3BsYXlQcmljZSA9ICAoSCAr IEwpIC8gMjsKRGlzcGxheVRpbWUgPSBUaW1lICsgRGlzcGxheVRpY2tPZmZzZXQgKiBCYXJpbnRl cnZhbDsKaWYgKE1vZChEaXNwbGF5VGltZSAsIDEwMCkgPiA1OSkgdGhlbgpiZWdpbgoJRGlzcGxh eVRpbWUgPSAoSW50UG9ydGlvbihEaXNwbGF5VGltZSAvIDEwMCkgKyAxKSAqIDEwMCArIE1vZChN b2QoRGlzcGxheVRpbWUsIDEwMCksIDYwKQplbmQ7CgppZiAoVGV4dElEID0gLTEpIHRoZW4gVGV4 dElEID0gVGV4dF9OZXcoRGF0ZSwgRGlzcGxheVRpbWUgLCBEaXNwbGF5UHJpY2UgLCAiIik7Cgp0 ZXh0X3NldGJnY29sb3IoVGV4dElELCBCbHVlKTsKdGV4dF9zZXRjb2xvcihUZXh0SUQsIFdoaXRl KTsKdGV4dF9zZXRsb2NhdGlvbihUZXh0SUQsIERhdGUsIERpc3BsYXlUaW1lLCBEaXNwbGF5UHJp Y2UpOwp0ZXh0X3NldGJvcmRlcihUZXh0SUQsIFRydWUpOwp0ZXh0X3NldHN0cmluZyhUZXh0SUQs IFN0cik7CnRleHRfc2V0Zm9udG5hbWUoVGV4dElELCBGb250TmFtZSk7CnRleHRfc2V0c2l6ZShU ZXh0SUQsIEZvbnRTaXplKTsKVGV4dF9TZXRTdHlsZShUZXh0SUQsIDAsIDIpOyAKCgoKCgoK</NodeText>
</GraphNode>
</Graph>

User avatar
TJ
Posts: 7774
Joined: Aug 29 2006
Location: Global Citizen
Has thanked: 1036 times
Been thanked: 2233 times

Jun 16 2008

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.