Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Intraday Intensity Index

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Intraday Intensity Index

    Hi I've compiled the code OK but when I run it, system non-stop processing. Take a look please, thanks!

    original fórmula=

    IIstd = Sum21 ((2C-H-L)/(H-L))xV

    IInorm = (IIstd / S21 V) x 100


    protectedoverridevoid OnBarUpdate()
    {

    int i = CurrentBar;
    while (i >= 0);

    {
    double high = High[i];
    double low = Low[i];
    double open = Open[i];
    double close = Close[i];

    double std=0;
    double sumavol=0;

    for (int k = i ; k <= (i+21) ; k++)
    {
    high = High[k];
    low = Low[k];
    open = Open[k];
    close = Close[k];
    double calculo = 0;
    if((high-low) != 0)
    calculo=(((
    2*close-high-low)/(high-low))*VOL()[k]);
    sumavol=sumavol + VOL()[k];
    std= std+calculo;
    }

    Plot0.Set((std/sumavol)*
    100);

    }

    #2
    Originally posted by fercho View Post
    Hi I've compiled the code OK but when I run it, system non-stop processing. Take a look please, thanks!

    original fórmula=

    IIstd = Sum21 ((2C-H-L)/(H-L))xV

    IInorm = (IIstd / S21 V) x 100


    protectedoverridevoid OnBarUpdate()
    {

    int i = CurrentBar;
    while (i >= 0);

    {
    double high = High[i];
    double low = Low[i];
    double open = Open[i];
    double close = Close[i];

    double std=0;
    double sumavol=0;

    for (int k = i ; k <= (i+21) ; k++)
    {
    high = High[k];
    low = Low[k];
    open = Open[k];
    close = Close[k];
    double calculo = 0;
    if((high-low) != 0)
    calculo=(((
    2*close-high-low)/(high-low))*VOL()[k]);
    sumavol=sumavol + VOL()[k];
    std= std+calculo;
    }

    Plot0.Set((std/sumavol)*
    100);

    }
    Looks like an endless while loop to me.

    Comment


      #3
      What Does Intraday Intensity Index Mean?
      A volume based indicator that depicts the flow of funds for a security according to where it closes in its high and low range. Calculated as:

      IIstd = Sum21 ((2C-H-L)/(H-L))xV


      Read as:


      The 21 bars summation of (2 *Close- High - Low) divided by (High-Low) all multiplied by the Volume of each day.


      more info at:


      http://www.tradingprofessionale.it/indexarticolo.php?idarea=4&idsez=26&idart=754&ids= no
      Attached Files
      Last edited by fercho; 09-20-2011, 04:50 PM. Reason: without looping sorry

      Comment


        #4
        Originally posted by fercho View Post
        What Does Intraday Intensity Index Mean?
        A volume based indicator that depicts the flow of funds for a security according to where it closes in its high and low range. Calculated as:

        IIstd = Sum21 ((2C-H-L)/(H-L))xV


        Read as:


        The 21 bars summation of (2 *Close- High - Low) divided by (High-Low) all multiplied by the Volume of each day.


        more info at:


        http://www.tradingprofessionale.it/indexarticolo.php?idarea=4&idsez=26&idart=754&ids= no
        NinjaScript makes that ridiculously easy to code without having to do all those resource intensive loops.
        1. Create a DataSeries, and populate it with (2C-H-L)/(H-L). Let us call it IntensityAccumulator.
        2. Get the sum of that using the SUM() indicator thus: SUM(IntensityAccumulator, 21)[0].
        Last edited by koganam; 09-25-2011, 11:02 AM. Reason: Corrected bracketing

        Comment


          #5
          Yeap! think I´ve understood.... some F1 help and your advice, and voilá...

          I've included 2 versions Standard and Normalized, put some colors too...

          Thanks a lot koganam
          Attached Files

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by futtrader, 04-21-2024, 01:50 AM
          4 responses
          41 views
          0 likes
          Last Post futtrader  
          Started by Option Whisperer, Today, 09:55 AM
          1 response
          12 views
          0 likes
          Last Post bltdavid  
          Started by port119, Today, 02:43 PM
          0 responses
          8 views
          0 likes
          Last Post port119
          by port119
           
          Started by Philippe56140, Today, 02:35 PM
          0 responses
          7 views
          0 likes
          Last Post Philippe56140  
          Started by 00nevest, Today, 02:27 PM
          0 responses
          7 views
          0 likes
          Last Post 00nevest  
          Working...
          X