Hello,
Having trouble compiling easy language indicators that I programmed and exported from TS and imported in MC64.
Always getting errors at the plot lines for True False variables. Everything else in the indicator is fine and compiles OK if those lines are commented out.
Any idea/help on why this is the case in the MC editor?
Thanks in advance, Mac
Plotting True & False variables in imported indicators
- TJ
- Posts: 7740
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2221 times
Re: Plotting True & False variables in imported indicators
If this is a coding question, you have to post your codes.
Re: Plotting True & False variables in imported indicators
Thank you TJ for the reply.
No, it is not a coding question because this indicator code worked fine in TS.
It is an error in compiling in MC. like I said, if the "Plot" line is commented out , the code compiles fine.
Mac
No, it is not a coding question because this indicator code worked fine in TS.
It is an error in compiling in MC. like I said, if the "Plot" line is commented out , the code compiles fine.
Mac
Re: Plotting True & False variables in imported indicators
After some trial and error and looking into the help content I solved my problem.
Apparently, The Plot function in MC works only with Numeric or String variables. Boolean variables are not supported, therefore copying the easy language code directly from TS will not work if you try to plot it as an indicator. But boolean variables work fine in strategies. Not sure why this is the case in MC.
Mac
Example:
The following code will not compile and cause error at the first plot line on the PLot Argument.
"Invalid function argument.
line 17, column 6"
Variable : TimeAm(False), TimePm(False);
If time > 1200
Then
Begin
TimeAm = False;
TimePm = True;
End;
If time > 2400
Then
Begin
TimeAm = True;
TimePm = False;
End;
PLot1(TimeAm , "TimeAm");
PLot2(TimePm , "TimePm");
*************************************************************
But the following code will compile fine with no problems
Variable : TimeAm(0), TimePm(0);
If time > 1200
Then
Begin
TimeAm = 0;
TimePm = 1;
End;
If time > 2400
Then
Begin
TimeAm = 1;
TimePm = 0;
End;
PLot1(TimeAm , "TimeAm");
PLot2(TimePm , "TimePm");
Apparently, The Plot function in MC works only with Numeric or String variables. Boolean variables are not supported, therefore copying the easy language code directly from TS will not work if you try to plot it as an indicator. But boolean variables work fine in strategies. Not sure why this is the case in MC.
Mac
Example:
The following code will not compile and cause error at the first plot line on the PLot Argument.
"Invalid function argument.
line 17, column 6"
Variable : TimeAm(False), TimePm(False);
If time > 1200
Then
Begin
TimeAm = False;
TimePm = True;
End;
If time > 2400
Then
Begin
TimeAm = True;
TimePm = False;
End;
PLot1(TimeAm , "TimeAm");
PLot2(TimePm , "TimePm");
*************************************************************
But the following code will compile fine with no problems
Variable : TimeAm(0), TimePm(0);
If time > 1200
Then
Begin
TimeAm = 0;
TimePm = 1;
End;
If time > 2400
Then
Begin
TimeAm = 1;
TimePm = 0;
End;
PLot1(TimeAm , "TimeAm");
PLot2(TimePm , "TimePm");
- TJ
- Posts: 7740
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2221 times