I have a simple dashboard indi i'm using to learn mql - it basically shows each pair and a comment whether price has crossed over a moving average.
Nothing rocket surgery about it, but i was using the following code and getting incorrect results with some pairs and i figured its probably because i'm using "Bid" and that expression takes the Bid on the current chart - not the pair that its using.
So, if "aPair" is GBPUSD for example, and GBPUSD is the pair that is open on this chart, then the code is fine.
However if "aPair" is EURUSD" but the chart is open to GBPUSD, i'm thinking the "Bid" function is getting the Bid of GBPUSD, and not EURUSD - is this correct ?
So what can go in place of Bid, so that it takes the price of the "aPair" that is passed in and not the current chart.
I hope that makes sense - dont worry about the poor code, i'm just having my first play with this.
Thx !
Nothing rocket surgery about it, but i was using the following code and getting incorrect results with some pairs and i figured its probably because i'm using "Bid" and that expression takes the Bid on the current chart - not the pair that its using.
Inserted Code
double aMA = iMA(aPair, 0, 10, 0, 1, PRICE_CLOSE, shift); if (Bid>aMA) text = "Over" else if (Bid<aMA) text = "Under"
So, if "aPair" is GBPUSD for example, and GBPUSD is the pair that is open on this chart, then the code is fine.
However if "aPair" is EURUSD" but the chart is open to GBPUSD, i'm thinking the "Bid" function is getting the Bid of GBPUSD, and not EURUSD - is this correct ?
So what can go in place of Bid, so that it takes the price of the "aPair" that is passed in and not the current chart.
I hope that makes sense - dont worry about the poor code, i'm just having my first play with this.
Thx !