I've just started using MultiCharts, after having access to TS for a little bit and there is a function in TS EasyLanguage that is associated with a strategy that TS have built in one of their paid learning classes.
I've tried to copy the function into PowerLanguage but I get an error that reads "assignment is allowed only for variables or array elements". This error refers to the very last line of the below code and I'm not sure what I need to do to fix this......... As an FYI coding is very new to me and I do not know what an array element is.
If anyone is able to please assist in getting this function working it would be much appreciated.
Code: Select all
Vars: int CurrentMonth(0), int TestDate(0), int StartingDate(0),
int DaysLeftInMonth(0), int LoopCounter(0);
If Month(Date) <> Month(Date[1]) then begin
CurrentMonth = Month(Date);
DaysLeftInMonth = 0;
LoopCounter = 0;
StartingDate = Date;
TestDate = StartingDate;
While Month(TestDate) = CurrentMonth begin
TestDate = CalcDate(StartingDate,LoopCounter);
If DayofWeek(TestDate) >= 1 and DayofWeek(TestDate) <= 5 then
DaysLeftInMonth += 1;
LoopCounter += 1;
end;
DaysLeftInMonth -= 1;
end
else begin
DaysLeftInMonth -= 1;
end;
LWDaysLeftInTheMonth = DaysLeftInMonth;