Move bars above Volume - page 2

 
FoxGuy:
I'm still hoping someone can show me how to shrink the price scale from inside the indicator.
    // Compute Value as normal - not displayed
    top     = WindowPriceMax(),
    bottom  = WindowPriceMin(),                 range = top-bottom;
    // Adjust if necessary
    top    -= range*0.05; bottom += range*0.05; range = top-bottom;
    
    // Draw Value as a main overlay
    shiftChart      =WindowFirstVisibleBar();
    shiftChartEnd   =shiftChart -WindowBarsPerChart();
    if (shiftChartEnd<0)    shiftChartEnd = 0;  // Tester/shift

    for (;shiftChart >= shiftChartEnd; shiftChart--){
        ValueOnChart[shiftChart] = Value[shiftChart] * range + bottom;
    }   // Assumes Value is 0 .. 1
 
WHRoeder:

I can't find "ValueOnChart" or "Value" in my MT4 dictionary. Are they valid functions in MT4?
 
FoxGuy:
I can't find "ValueOnChart" or "Value" in my MT4 dictionary. Are they valid functions in MT4?

They are arrays, you can tell from the square braces [], functions use round braces ()
Why don't you post your code, it would make it so much easier for anyone who wants to, or has time, to help you.
 
FoxGuy:
I can't find "ValueOnChart" or "Value" in my MT4 dictionary. Are they valid functions in MT4?
They are arrays. How do you possibly expect me to know what YOU called YOUR buffers in YOUR indicator? When in doubt THINK! No Slaves here, learn to code or pay someone. We're not going to code it FOR you. We are willing to HELP you.
 
RaptorUK:
They are arrays, you can tell from the square braces [], functions use round braces ()
Why don't you post your code, it would make it so much easier for anyone who wants to, or has time, to help you.

Thanks;

I read the entire Dictionary and don't remember anywhere that it told me that braces meant an array. I don't know why I didn't realize that. Makes sense now. My only excuse is that this is my first attempt at creating my own indicator. I'm modifying someone else's indicator that didn't quite do what I wanted.

Now I should be able to figure out what WHRoeder's code is doing.

 
WHRoeder:
They are arrays. How do you possibly expect me to know what YOU called YOUR buffers in YOUR indicator? When in doubt THINK! No Slaves here, learn to code or pay someone. We're not going to code it FOR you. We are willing to HELP you.

Sorry I offended you. My only excuse is that this is my first attempt at creating an indicator. I was confused by your code because it seemed that "ValueOnChart" and "Value" sounded like they should be functions. I program in databases and spreadsheets and they both have "Value" functions. I didn't notice the braces, but I'm not sure that I would have known that meant array anyway. Now that I know that braces mean an array, I should never make that mistake again.

If I understand your code; what you're doing is creating a new array (ValueOnChart), but not displaying it on the chart. Would something like this accomplish something similar to your code?

double ValueOnChart[]; // int iVOC = index # of ValueOnChart[]

SetIndexLabel(iVOC,NULL);

SetIndexBuffer(6,ValueOnChart);

SetIndexStyle(iVOC,DRAW_NONE,DRAW_NONE,1,<SameColorAsChartBackgroundColor>);

ValueOnChart[shiftChart] = myIndicator[shiftChart] * .9;

 
WHRoeder:
They are arrays. How do you possibly expect me to know what YOU called YOUR buffers in YOUR indicator? When in doubt THINK! No Slaves here, learn to code or pay someone. We're not going to code it FOR you. We are willing to HELP you.
Well, I guess I didn't understand what you're doing after all. I created a new line in my indicator, but the window ignores the new line in setting the price scale. WindowPriceMin() still has the same value as it did before.