Need expertise to fix 2 problems - Please!

 

I picked this program up from a forum. It came in MQL and .exp. I wanted to adjust the MQL file to new parameters and after I did I found I had an error. The error reads: 22;16;1;50;some operator expected - token "1".

If the first numbers are line numbers, how can I get the editor to add line numbers to the displayed programming? What do these numbers mean? And what is the fix for this if you could look at the program below?

The second and last problem with this little program is that it puts the Buy Green Dot and the Sell Red Dot over the bar to the left of the current bar instead of the current bar. With your experience could you figure out a fix that would keep this from happening so it will work right and place the dot over the current "latest" bar?

Any and all help is sincerely appreciated by me.

Thank you in advance!

Dave77

/*[[ Name :=

Author :=

Link :=

Separate Window := No

Separate Window := No

First Color := Red

First Draw Type := Symbol

First Symbol := 108

Use Second Data := Yes

Second Color := Green

Second Draw Type := Symbol

Second Symbol := 108

]]*/

Input : FastPeriod(4), SlowPeriod(15);

Variable : shift(0);

Variable : iMASlowPrevious(0), iMaSlowCurrent(0), iMaFastPrevious(0), iMaFastCurrent(0);

Variable : val1(0), val2(0);

SetLoopCount(0);

For shift=Bars 1 Downto 0 Begin

val1=0;

val2=0;

iMaSlowPrevious = iMAEx(SlowPeriod, MODE_LWMA, 0, PRICE_WEIGHTED, shift-1);

iMaSlowCurrent = iMAEx(SlowPeriod, MODE_LWMA, 0, PRICE_WEIGHTED, shift);

iMaFastPrevious = iMAEx(FastPeriod, MODE_LWMA, 0, PRICE_CLOSE, shift-1);

iMaFastCurrent = iMAEx(FastPeriod, MODE_LWMA, 0, PRICE_CLOSE, shift);

If iMaFastPreviousiMASlowCurrent Then val1=High[shift];

If iMaFastPrevious>iMaSlowPrevious and iMaFastCurrent<iMASlowCurrent Then val2=Low[shift];

SetIndexValue(shift,val1+0*point);

SetIndexValue2(shift,val2-0*point);

End;

 

Just bumping this thread to see if theres anyone that can fix it now

 

>> For shift = Bars 1 Downto 0 Begin

Should change to:

For shift = Bars Downto 0 Begin

Reason: