hello,
In EFS how do I add the number 1 or 2 to a global variable?
Here is the code I'm using:
// Declaring Global Variables
var EntryBarNo=0;
var BarsSinceEntry=0;
function main() {
BarsSinceEntry = getCurrentBarCount() - EntryBarNo + 1 ;
return null;
}
EntryBarNo is the bar number recorded at the exact time of order entry.
Also, a second question is: Is it ok when declaring global variables to set them to 0 so that when the program first starts it assigns a value of zero to the variable. Is this ok?
If you could please let me know what I am doing wrong that would be very much appreciated.
Thanks in advance.
Regards
Rod
In EFS how do I add the number 1 or 2 to a global variable?
Here is the code I'm using:
// Declaring Global Variables
var EntryBarNo=0;
var BarsSinceEntry=0;
function main() {
BarsSinceEntry = getCurrentBarCount() - EntryBarNo + 1 ;
return null;
}
EntryBarNo is the bar number recorded at the exact time of order entry.
Also, a second question is: Is it ok when declaring global variables to set them to 0 so that when the program first starts it assigns a value of zero to the variable. Is this ok?
If you could please let me know what I am doing wrong that would be very much appreciated.
Thanks in advance.
Regards
Rod
Comment