you can do more simple for all of your paires:
extern string SymbolslList = "EURUSD;GBPUSD;EURJPY;USDJPY;EURGBP;"; string Sbl[]; //------------------------- init() UpdateSymbolsList(); return(0) //------------------------- void UpdateSymbolsList() { string sbl = ""; int count = 0; for(int i=0; i<StringLen(SymbolslList); i++) { if(StringSubstr(SymbolslList, i, 1) != ";") { sbl= sbl+ StringSubstr(SymbolslList, i, 1); } else { { ArrayResize(Sbl, ArraySize(Sbl)+1); Sbl[count] = sbl; sbl =""; count +=1; } } }use Sbl[i] to replace "counter5"
I've cracked it, after the first loop of counter3 counter4 is not being reset and so the ma is not being calculated properly. Thanks for looking anyway.
you can do more simple for all of your paires:
use Sbl[i] to replace "counter5"
OK, thanks, I will try that next time.
Hi, I coded this quick dashboard to tell me which pairs are above or below the 3 sma on 3 different timeframes, daily, weekly and monthly. After a few problems I managed to get the pairs displaying as I want them but they are all colored lime which can't be right. I wonder if anyone can see what I am doing wrong? I think it may be something to do with the values being returned by either the iMA function, the iClose function or both?
This is wrong . . .
if(counter4 == 0) tf = "PERIOD_D1"; if(counter4 == 1) tf = "PERIOD_W1"; if(counter4 == 2) tf = "PERIOD_MN1"; // tf is a string . . . ppma[counter3,counter4] = iMA(pairss[counter3],tf,3,0,0,PRICE_TYPICAL,0); // you are using a string for the timeframe, it should be an int
do this instead . . .
int tf; // tf is an int . . . if(counter4 == 0) tf = PERIOD_D1; if(counter4 == 1) tf = PERIOD_W1; if(counter4 == 2) tf = PERIOD_MN1; // tf is an int . . . ppma[counter3,counter4] = iMA(pairss[counter3], tf, 3,0,0,PRICE_TYPICAL,0);
This is wrong . . .
do this instead . . .
Ok, thank you, I didn't think it would make a difference?
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi, I coded this quick dashboard to tell me which pairs are above or below the 3 sma on 3 different timeframes, daily, weekly and monthly. After a few problems I managed to get the pairs displaying as I want them but they are all colored lime which can't be right. I wonder if anyone can see what I am doing wrong? I think it may be something to do with the values being returned by either the iMA function, the iClose function or both?