Incorporating a freeware indicator - page 2

 
DrBeardface:

Hi guys,

So here is a screen shot of what I'm looking at.


If I use the ObjectGet function I would assume that the object name would be either FML_SupRes or Value1. Problem is that all of resistance levels are called Value1 and all of the support levels are called Value2. So how does the ObjectGet function know the difference between the different levels shown in the chart?

Look for fractal adjustable period - since that indicator is derived from it
 
Mladen Rakic:
Look for fractal adjustable period - since that indicator is derived from it
I do have another one based on fractals, but it's just not as good. It paints far too many levels and isn't really of any use. I've been trying at it for weeks, but have finally decided that I just need to find a way of getting the data out of this one, as it's the best.
 
So I did try using ObjectGet, but can't get it to return a value. I've tried both things that could logically be the label and all of the property tags to do with price and time. Am I missing something here?
 
DrBeardface:
I do have another one based on fractals, but it's just not as good. It paints far too many levels and isn't really of any use. I've been trying at it for weeks, but have finally decided that I just need to find a way of getting the data out of this one, as it's the best.

That is exactly the same indicator (except for the name) so I am really glad that you think that it is "so good"


And there are no objects used by that indicator - those are two buffers

 
Yes that looks a lot better, thanks. And I did think that the one that I was using had buffers, but I tried to find out what they were and I couldn't find anything. And as I don't have access to the code I wasn't sure how I could find out. Where can I find the one that you have posted a picture from?
 
DrBeardface:
Yes that looks a lot better, thanks. And I did think that the one that I was using had buffers, but I tried to find out what they were and I couldn't find anything. And as I don't have access to the code I wasn't sure how I could find out. Where can I find the one that you have posted a picture from?
It seems your indicator doesn't plot any objects but just uses two buffers. If you want to incorporate into an EA you just use iCustom(). You can check the buffers in the Data Window (Ctrl+D). The first buffer has the number zero and the second buffer has the number one.
 
Petr Nosek:
It seems your indicator doesn't plot any objects but just uses two buffers. If you want to incorporate into an EA you just use iCustom(). You can check the buffers in the Data Window (Ctrl+D). The first buffer has the number zero and the second buffer has the number one.

I tried that using this piece of code

   Value1 = iCustom(NULL,0,"FML_SupRes",0,0);
   Value2 = iCustom(NULL,0,"FML_SupRes",1,0);
   Print(Value1," ",Value2);

It returned "2147483647.0  2147483647.0" which I'm given to understand is the code for an empty variable or something?


As it happens the screenshot that Mladen posted looks like it gives even more reliable S&R lines (at least from my perspective). I was able to find one that painted just a single dot, but not a line of dots like is shown in the screenshot. The one I found (posted by him on a different thread) has empty buffers unless a new level is established, which isn't really all that helpful to me.
 
Never mind, a fresh look at the source code I found let me modify it to paint a dot every bar even if the level doesn't change. Looks ok now. Thanks for your help everyone!!
 
DrBeardface:

I tried that using this piece of code

   Value1 = iCustom(NULL,0,"FML_SupRes",0,0);
   Value2 = iCustom(NULL,0,"FML_SupRes",1,0);
   Print(Value1," ",Value2);

It returned "2147483647.0  2147483647.0" which I'm given to understand is the code for an empty variable or something?


As it happens the screenshot that Mladen posted looks like it gives even more reliable S&R lines (at least from my perspective). I was able to find one that painted just a single dot, but not a line of dots like is shown in the screenshot. The one I found (posted by him on a different thread) has empty buffers unless a new level is established, which isn't really all that helpful to me.
Of course you got these values (EMPTY_VALUE) on the current bar. Your indicator doesn't calculate the current bar (you can see that on the chart, there isn't an arrow (point) over/bellow the current bar ). If you'll try to increase shift e.g. iCustom(NULL,0,"FML_SupRes",0,1); you'll get the right values.
 
Oh silly me. Thanks Petr I should have seen that!!
Reason: