Programing LUA question

Moderator: admin

Programing LUA question

Postby Kilgharrah » Thu Mar 02, 2017 6:27 am

Hi,
What is the purpose of +1 in this line of programming, because sometimes they put it and other times not.

The purpose of first is to ensure the existence of data in a certain period?

Code: Select all
first= math.max(FastMA1.DATA:first(), SlowMA1.DATA:first())+1;


Thanks
User avatar
Kilgharrah
 
Posts: 46
Joined: Wed Sep 28, 2016 3:56 pm

Re: Programing LUA question

Postby Apprentice » Fri Mar 17, 2017 5:04 am

The purpose of first is to ensure the existence of data in a certain period?

Yes

first= math.max(FastMA1.DATA:first(), SlowMA1.DATA:first()

Will be enough if you're accessingMA FastMA1 and SlowMA1 only.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia


Return to Indicator Development

Who is online

Users browsing this forum: No registered users and 6 guests