randomize().afl

来自「一个更精度的平滑涵数, 可用于股票交易系统.用于Amibroker 平台」· AFL 代码 · 共 52 行

AFL
52
字号
//------------------------------------------------------------------------------
//
//  Formula Name:    Randomize()
//  Author/Uploader: Antonio Marra 
//  E-mail:          ant.marra@virgilio.it
//  Date/Time Added: 2004-07-20 06:40:47
//  Origin:          
//  Keywords:        Random interval
//  Level:           basic
//  Flags:           showemail,function
//  Formula URL:     http://www.amibroker.com/library/formula.php?id=365
//  Details URL:     http://www.amibroker.com/library/detail.php?id=365
//
//------------------------------------------------------------------------------
//
//  This function will generate random numbers included in a given numeric
//  interval.
//
//------------------------------------------------------------------------------

/*_________________________________________________________________________________________ 

  SYNTAX:
         Randomize(a,b)
  
  PURPOSE:
          This function will generate random numbers included in a given numeric interval.
  
  HOW TO USE:
          Copy this file in your include directory or append it to another file that You 
          use as "functions database".
          "a" is the lowest value, "b" is the highest value.

  EXAMPLE:
          1. if you want to generate random between 1 e 100 (with decimal values):
          
             RandomNumber = Randomize(1,100);
          
          2. if you want to generate random between 1 e 100 (with only integer values):
          
             RandomNumber = int( Randomize(1,100) ) ;

  ________________________________________________________________________________________  
                                                                                          */


function Randomize(a,b)
{
   result = Random()*(b-a)+a;
   return result;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?