Page 1 of 2

Supply and Demand Indicator value

Posted: Thu Feb 16, 2017 7:06 am
by borgesr
Dear Mladen,
How can I read the value of the Verified res and Verified Sup object or create a buffer for these values?

Thank you,
Rogério

Re: Supply and Demand Indicator value

Posted: Thu Feb 16, 2017 8:32 am
by mladen
borgesr wrote: Dear Mladen,
How can I read the value of the Verified res and Verified Sup object or create a buffer for these values?
Thank you,
Rogério
 
If you know the object name, you can simply do the following :

Code: Select all

   double value = ObjectGetDouble(0,"object name here",OBJPROP_PRICE1);

Re: Supply and Demand Indicator value

Posted: Thu Feb 16, 2017 8:40 am
by borgesr
Hi Mladen
From what I understand in the code the name of the object starts with SSSR#S and is changed by a count.
It does not have a fixed name.

Code

Code: Select all

     //name sup
      if(zone_type[i]==ZONE_SUPPORT)
         string s="SSSR#S"+i+" Strength=";
      else
      //name res
         s="SSSR#R"+i+" Strength=";

      if(zone_strength[i]==ZONE_PROVEN)
         s=s+"Proven, Test Count="+zone_hits[i];
      else if(zone_strength[i]==ZONE_VERIFIED)
         s=s+"Verified, Test Count="+zone_hits[i];
      else if(zone_strength[i]==ZONE_UNTESTED)
         s=s+"Untested";
      else if(zone_strength[i]==ZONE_TURNCOAT)
         s=s+"Turncoat";
      else
         s=s+"Weak";

      ObjectCreate(s,OBJ_RECTANGLE,0,0,0,0,0);
      ObjectSet(s,OBJPROP_TIME1,Time[zone_start[i]]);
      ObjectSet(s,OBJPROP_TIME2,Time[0]);
      ObjectSet(s,OBJPROP_PRICE1,zone_hi[i]);
      ObjectSet(s,OBJPROP_PRICE2,zone_lo[i]);
      ObjectSet(s,OBJPROP_BACK,zone_solid);
      ObjectSet(s,OBJPROP_WIDTH,zone_linewidth);
      ObjectSet(s,OBJPROP_STYLE,zone_style);

      if(zone_type[i]==ZONE_SUPPORT)
        {
         // support zone
         if(zone_strength[i]==ZONE_TURNCOAT)
            ObjectSet(s,OBJPROP_COLOR,color_support_turncoat);
         else if(zone_strength[i]==ZONE_PROVEN)
            ObjectSet(s,OBJPROP_COLOR,color_support_proven);
         else if(zone_strength[i]==ZONE_VERIFIED)
            ObjectSet(s,OBJPROP_COLOR,color_support_verified);
         else if(zone_strength[i]==ZONE_UNTESTED)
            ObjectSet(s,OBJPROP_COLOR,color_support_untested);
         else
            ObjectSet(s,OBJPROP_COLOR,color_support_weak);
        }
      else
        {
         // resistance zone
         if(zone_strength[i]==ZONE_TURNCOAT)
            ObjectSet(s,OBJPROP_COLOR,color_resist_turncoat);
         else if(zone_strength[i]==ZONE_PROVEN)
            ObjectSet(s,OBJPROP_COLOR,color_resist_proven);
         else if(zone_strength[i]==ZONE_VERIFIED)
            ObjectSet(s,OBJPROP_COLOR,color_resist_verified);
         else if(zone_strength[i]==ZONE_UNTESTED)
            ObjectSet(s,OBJPROP_COLOR,color_resist_untested);
         else
            ObjectSet(s,OBJPROP_COLOR,color_resist_weak);
        }
Thank you,
Rogério  

Re: Supply and Demand Indicator value

Posted: Thu Feb 16, 2017 8:46 am
by mladen
You have to have some unique way of identifying it
Even if you store it to buffer, without knowing what value you want to store into the buffer (ie. value of what object should be stored to the buffer) it is pointless.

In both cases you have to know exactly the name of the object that you wish to read

Re: Supply and Demand Indicator value

Posted: Thu Feb 16, 2017 8:59 am
by borgesr
I tried to create the buffer below but the value is totally different from the text object.

     

Code: Select all

ObjectCreate(s,OBJ_RECTANGLE,0,0,0,0,0);
      ObjectSet(s,OBJPROP_TIME1,Time[zone_start[i]]);
      ObjectSet(s,OBJPROP_TIME2,Time[0]);
      ObjectSet(s,OBJPROP_PRICE1,zone_hi[i]);
      ObjectSet(s,OBJPROP_PRICE2,zone_lo[i]);
      ObjectSet(s,OBJPROP_BACK,zone_solid);
      ObjectSet(s,OBJPROP_WIDTH,zone_linewidth);
      ObjectSet(s,OBJPROP_STYLE,zone_style);
      srHI[i]=zone_hi[i];  // Resistence
      srLO[i]=zone_lo[i]; // Support

Re: Supply and Demand Indicator value

Posted: Thu Feb 16, 2017 9:01 am
by mladen
borgesr wrote:I tried to create the buffer below but the value is totally different from the text object.

     

Code: Select all

ObjectCreate(s,OBJ_RECTANGLE,0,0,0,0,0);
      ObjectSet(s,OBJPROP_TIME1,Time[zone_start[i]]);
      ObjectSet(s,OBJPROP_TIME2,Time[0]);
      ObjectSet(s,OBJPROP_PRICE1,zone_hi[i]);
      ObjectSet(s,OBJPROP_PRICE2,zone_lo[i]);
      ObjectSet(s,OBJPROP_BACK,zone_solid);
      ObjectSet(s,OBJPROP_WIDTH,zone_linewidth);
      ObjectSet(s,OBJPROP_STYLE,zone_style);
      srHI[i]=zone_hi[i];  // Resistence
      srLO[i]=zone_lo[i]; // Support
Of course that it is different - you are not limiting it to the exact name
Please try to limit it to exact name - otherwise nobody and no code can help you retrieve that value

Re: Supply and Demand Indicator value

Posted: Thu Feb 16, 2017 9:04 am
by borgesr
Ok thank you.

Re: Supply and Demand Indicator value

Posted: Fri Feb 17, 2017 4:06 am
by Dimitri
borgesr wrote: Dear Mladen,
How can I read the value of the Verified res and Verified Sup object or create a buffer for these values?

Thank you,
Rogério
 
Dear Borgesr,
I would like to ask you if the indicator is repainting ????
Thank you for your info.

Best Regards
Dimitri

Re: Supply and Demand Indicator value

Posted: Fri Feb 17, 2017 8:55 am
by mladen
Dimitri wrote:Dear Borgesr,
I would like to ask you if the indicator is repainting ????
Thank you for your info.

Best Regards
Dimitri
It is based on highest high and lowest low (ie: it does)

Re: Supply and Demand Indicator value

Posted: Fri Feb 17, 2017 9:40 am
by borgesr
Dear Mladen,
Do you know any other alternative to this indicator that does not repaint?

Thank you,
Rogério