Static Variables in EL?

Questions about MultiCharts and user contributed studies.
KhaosTrader
Posts: 186
Joined: 10 May 2012
Has thanked: 14 times
Been thanked: 11 times

Static Variables in EL?

Postby KhaosTrader » 27 Aug 2012

Hi,

I would like to have my indicator on my Radarscreen where it will show that the price got above a threshold, but as it updates, if the time it got above that threshold is older than 5 minutes, it will change color. So I need to store the timestamp when it crossed (I am using 60 minute chart, and the indicator updates every minute). Therefore I need to store a timestamp value that wont be displayed in the radarscreen that I can reference.

Any Ideas?

arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Re: Static Variables in EL?

Postby arjfca » 28 Aug 2012

Two solution that I think of

1- Use 2 charts. ! hour & 5 minute
Read your data, then wait for the completion of the 5 minutes bar to do you test

2- Read your PC time using the function "MachineTime".
Then add 5 minutes to your result
Read back the PC time and compare it with your hour + 5 minutes value. When >= then do your process


Good luck

Martin

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

Re: Static Variables in EL?

Postby Henry MultiСharts » 28 Aug 2012

2- Read your PC time using the function "MachineTime".
Then add 5 minutes to your result
Read back the PC time and compare it with your hour + 5 minutes value. When >= then do your process
Good luck
Martin
The reserved word is computerdatetime


Return to “MultiCharts”