Multi Timeframe Indicators - page 1206

 
greenpar :

Thank you once again for your help, I've rolled the changes in as suggest (see attached file and code below). I'm still getting numerous errors when compiling (see attached image of compile errors), I suspect it is to do with highlighted lines in the code below.

Please keep in mind that I am looking to incorporate other timeframes, currency pairs, and also other indicators eventually (such as ADX), within this indicator file.

Any further assistance would be greatly appreciated.


1. At the end of the line ;was missing.

String currencyPairs [] = {"AUDCAD", "AUDNZD", "AUDJPY", "AUDUSD"};

2. The following lines were missing.

Return (rates_total);
}

3. I misplaced the array dimension. It has been modified as follows and moved to the global area.

datetime alert_bar [3] [3];
datetime candleTime [3] [3];

Files:
 
Naguisa Unada:

1. At the end of the line ;was missing.

String currencyPairs [] = {"AUDCAD", "AUDNZD", "AUDJPY", "AUDUSD"};

2. The following lines were missing.

Return (rates_total);
}

3. I misplaced the array dimension. It has been modified as follows and moved to the global area.

datetime alert_bar [3] [3];
datetime candleTime [3] [3];


Thank you so much once again. It's now alerting across all the timeframes and currency pairs listed.

However, it is not alerting once per bar anymore, it's alerting for every candle point increase above the minimum candle points size. Lines 78, 84, and 90 in 'Sample.mq4' that you'd attached to your previous message are not ensuring it only alerts once per candle. I attempted to change the values within the '[]' but this obviously did not fix the problem. How does one fix this?

As always any further assistance would be greatly appreciated. Thank you.

 
greenpar :

However, it is not alerting once per bar anymore, it's alerting for every candle point increase above the minimum candle points size. Lines 78, 84, and 90 in 'Sample.mq4' that you'd attached to your previous message are not ensuring it only alerts once per candle. I attempted to change the values within the '[]' but this obviously did not fix the problem. How does one fix this?

Sure it is. I should write the following lines in "OnInit".

 //ArrayResize(candleTime, CPNO); 
 //ArrayResize(alert_bar,  CPNO); 
 //ArrayInitialize(alert_bar, 0); 
int OnInit ()
{
         //--- indicator buffers mapping 
        TFNO = ArraySize (timeFrame);
        CPNO = ArraySize (currencyPairs);
        
         ArrayResize (candleTime, CPNO);
         ArrayResize (alert_bar,  CPNO);
         ArrayInitialize (alert_bar, 0 );
        
         if ( StringLen ( Symbol ()) > 6 )
        {
                sufix = StringSubstr ( Symbol (), 6 , 0 );
                 for ( int i = 0 ; i < CPNO; i++)
                        currencyPairs[i] += sufix;
        }
         //--- 
         return ( INIT_SUCCEEDED );
}

Numbers in [ ] are adjusted with "ArrayResize" above. Even if the number of currency pair increases, it will be adjusted automatically here, but if you want to add another time frame you have to modify the program directly. This is because it is the specification of MQL4.

 
Naguisa Unada:

Sure it is. I should write the following lines in "OnInit".

Numbers in [ ] are adjusted with "ArrayResize" above. Even if the number of currency pair increases, it will be adjusted automatically here, but if you want to add another time frame you have to modify the program directly. This is because it is the specification of MQL4.


Thank you once again. I've added the code in.

The alert is still alerting for every candle point increase above the minimum candle points size - even after deleting the indicator from the chart, recompiling, quitting MT etc. How can I fix this?

As always any further assistance would be greatly appreciated. Thank you.

 
greenpar :

The alert is still alerting for every candle point increase above the minimum candle points size - even after deleting the indicator from the chart, recompiling, quitting MT etc. How can I fix this?

On my PC it works normally without any problems. I think that something is wrong, but I do not know what is.

 
Naguisa Unada:

On my PC it works normally without any problems. I think that something is wrong, but I do not know what is.


I'm running MT4 build 1090. Not sure what the problem is. Maybe someone else can help?

Thank you

 

can someone modify this indicator, when stoch cross each other the arrows shows on second candle but i need that the arrow shows on current candle, immediately every time when stoch cross each other


thanx

 
fxprogramer:

can someone modify this indicator, when stoch cross each other the arrows shows on second candle but i need that the arrow shows on current candle, immediately every time when stoch cross each other

//for(i=1; i<=limit; i++) 
  for(i=0; i<=limit; i++) 

It's very easy. Correct i = 1 to i = 0 on line 77.


 
Naguisa Unada:

it's working, great, thank you very much for help

 

could someone please make that every time when red or green block shows over or under zero line it shows arrow on chart, as you can see in picture now it shows arrow only on first block when it comes from red or green zone, but i need that it shows and all other times when it dissappear and the appear again, while it has stayed in red or green zone, as you can see in picture

https://www.mql5.com/en/charts/7337652/eurusd-m1-tickmill-ltd

thanx

Chart EURUSD, M1, 2017.07.13 10:09 UTC, Tickmill Ltd, MetaTrader 4, Real
Chart EURUSD, M1, 2017.07.13 10:09 UTC, Tickmill Ltd, MetaTrader 4, Real
  • www.mql5.com
Symbol: EURUSD. Periodicity: M1. Broker: Tickmill Ltd. Trading Platform: MetaTrader 4. Trading Mode: Real. Date: 2017.07.13 10:09 UTC.