Moneymanagement Tool as an indicator. How to get the information about the secondary currency? - page 3

 
 
mar:

Sorry, I don't get the point.. My questions are:

Why do I get a navy-colored buffer between SMA20 and SMA100 and not between SMA20 and SMA50? Why does the indicator use the SMA100 value as the lower line?

Why is there no maroon-colored buffer when SMA20 < SMA 50 and SMA 50 < SMA 100? It is exactly the same code but nothing happens...?!?


look to the code of Ichimoku indicator for example how to fill area between two lines with a color

 
The problem is, that I don't understand why it is coded this way. For me it is important that I understand how it works. As I said, I don't need this kind of indicator right now. I only want to know how to code it.
 
#property indicator_chart_window
#property indicator_buffers 5
#property indicator_color1 Navy
#property indicator_color2 Maroon
#property indicator_color3 Green
#property indicator_color4 Yellow
#property indicator_color5 Red
               
double Color1Zone[];
double Color2Zone[];
double SMA20[], SMA50[], SMA100[];

void init(){
    SetIndexBuffer(0,Color1Zone);   
        SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,1);
    SetIndexBuffer(1,Color2Zone);   
        SetIndexStyle(1,DRAW_HISTOGRAM,STYLE_SOLID,1);
    SetIndexBuffer(2, SMA20);       
        SetIndexStyle(2,DRAW_LINE,STYLE_SOLID,1);
    SetIndexBuffer(3, SMA50);       
        SetIndexStyle(3,DRAW_LINE,STYLE_SOLID,1);
    SetIndexBuffer(4, SMA100);      
        SetIndexStyle(4,DRAW_LINE,STYLE_SOLID,1);
}

void start(){
    for(int i=Bars-IndicatorCounted()-1; i>=0; i--){
        SMA20[i]=iMA(NULL,0,20,0,MODE_SMA,PRICE_CLOSE,i);
        SMA50[i]=iMA(NULL,0,50,0,MODE_SMA,PRICE_CLOSE,i);
        SMA100[i]=iMA(NULL,0,100,0,MODE_SMA,PRICE_CLOSE,i);
        if(SMA20[i]>SMA50[i] && SMA50[i]>SMA100[i]){
            Color1Zone[i]=SMA20[i]; Color2Zone[i]=SMA50[i];}
        if(SMA20[i]<SMA50[i] && SMA50[i]<SMA100[i]){
            Color2Zone[i]=SMA50[i]; Color1Zone[i]=SMA20[i];}
    }
}

To understand why, you'll need this piece of information here:

https://www.mql5.com/en/forum/131068.

 
I think you should start a new thread for future questions. This topic has grown beyond its original scope. You'll receive more help from other people and it'll be easier for someone else to find answers to the same problems you're having.
 
ubzen, thank you so much! You are the one who makes a coder out of me... :)