[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] Mod function



PureBytes Links

Trading Reference Links

Hello,

Modulus operator in AFL is %
(percent sign, as in JScript and C/C++)

15 % 10 
equals 5.

for( i = 0; i < BarCount; i++ )
{
   array[ i ] = i % 6;
}

or simpler:

array = BarIndex() % 6;


Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message ----- 
From: "nkis22" <nkishor@xxxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Friday, May 02, 2003 8:36 AM
Subject: [amibroker] Mod function


> Is there a Mod function in AB?
> 
> I want to creat an array filled with
> 0 1 2 3 4 5 0 1 2 3 4 5 0 1 2 3 4 5 and so on.
> 
> I need this to  fit varying period cycle models
> 
> tia
> nand
> 
> 
> 
> 
> 
> 
> 
> Send BUG REPORTS to bugs@xxxxxxxxxxxxx
> Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
> -----------------------------------------
> Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
> (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> --------------------------------------------
> Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
> 
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 
> 
> 
> 

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Rent DVDs Online - Over 14,500 titles.
No Late Fees & Free Shipping.
Try Netflix for FREE!
http://us.click.yahoo.com/YoVfrB/XP.FAA/uetFAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/