Hi,
I was wondering if someone could show me a way to create a variable in a signal or indicator and have it load initially the first time then maintain that value until it is changed within the script and not on every bar close.
Thanks
Global Variable ??
-
- Posts: 43
- Joined: 01 Dec 2008
- Has thanked: 2 times
- Been thanked: 2 times
-
- Posts: 173
- Joined: 25 Aug 2007
-
- Posts: 43
- Joined: 01 Dec 2008
- Has thanked: 2 times
- Been thanked: 2 times
No, initial value is set only once and variable values set by the script are persistent across multiple executions - if code is executed only once per bar (update on every tick is off). If code is 'update on every tick' then the intra-bar values are screwy (IMO) but MC is implementing the EL language, they don't get to make decisions about how the language is designed. See this thread:
http://forum.tssupport.com/viewtopic.php?t=5823
http://forum.tssupport.com/viewtopic.php?t=5823