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 jxs_xrj, 01-12-2020, 09:49 AM
          6 responses
          3,290 views
          1 like
          Last Post jgualdronc  
          Started by Touch-Ups, Today, 10:36 AM
          0 responses
          7 views
          0 likes
          Last Post Touch-Ups  
          Started by geddyisodin, 04-25-2024, 05:20 AM
          8 responses
          61 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by Option Whisperer, Today, 09:55 AM
          0 responses
          8 views
          0 likes
          Last Post Option Whisperer  
          Started by halgo_boulder, 04-20-2024, 08:44 AM
          2 responses
          24 views
          0 likes
          Last Post halgo_boulder  
          Working...
          X