hi guys, i have the following problem, Im using a High and Low Period check for opening trades in my expert. For example, (Highest+Lowest)/2 is MIddle point
it must buy below the middle point and sell above the middle point
This is the source about checking the levels, and this::
Is the code for swith pairs,
But still it is not working correct becous it buys when it's above the Midleline and Sell below the middelline, maby you guys know something more about it?
greetz willem
This is probably your issue . . .
double HM1HIGH = High[iHighest(M1,PERIOD_M1,MODE_HIGH,SafePeriod,0)]; //SafePeriod is extern variable double HM1LOW = Low[iLowest(M1,PERIOD_M1,MODE_LOW,SafePeriod,0)]; //SafePeriod is extern variable
iHighest and iLowest get the bar values for symbol M1 . . . High[] and Low[] get the High and Low for the bar number from the chart symbol, not from symbol M1, use iHigh() and iLow()
or use
double HM1HIGH = High[iHighest(M1,0,MODE_HIGH,SafePeriod,0)]; //SafePeriod is extern variable double HM1LOW = Low[iLowest(M1,0,MODE_LOW,SafePeriod,0)]; //SafePeriod is extern variable
This is probably your issue . . .
iHighest and iLowest get the bar values for symbol M1 . . . High[] and Low[] get the High and Low for the bar number from the chart symbol, not from symbol M1, use iHigh() and iLow()
But how can get to the shift then?? i mean, must i do ihighest for the Bar shift and use that in ihigh?
But how can get to the shift then?? i mean, must i do ihighest for the Bar shift and use that in ihigh?
the High and low what you recommended, but it gives stil an error, This:
The Print function gives me error: symbol name for MarketInfo function must be a string
double HM5ask =MarketInfo(M5,MODE_ASK); double HM5bid = MarketInfo(M5,MODE_BID); double HM5HIGH = iHigh(M5,PERIOD_M5,iHighest(M5,PERIOD_M5,MODE_HIGH,SafePeriod,0)); double HM5LOW = iLow(M5,PERIOD_M5,iLowest(M5,PERIOD_M5,MODE_LOW,SafePeriod,0)); double HM5MIDLE = (HM5HIGH+HM5LOW)/2; double HM5MIDLEHIGH = (HM5HIGH+HM5MIDLE)/2; double HM5MIDLELOW = (HM5LOW+HM5MIDLE)/2; Print("Pair = "+M5+" High = "+HM5HIGH+" Low = "+HM5LOW+" MIDLE = "+HM5MIDLE+" 75% = "+HM5MIDLEHIGH+" 25% = "+HM5MIDLELOW+" Ask = "+ HM5ask);
the High and low what you recommended, but it gives stil an error, This:
The Print function gives me error: symbol name for MarketInfo function must be a string
I'm not sure, but i have string M5, and it's changing every time the symbol? is this correct?
Huh, after a wile it starts getting the pairs?

- 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 guys, i have the following problem, Im using a High and Low Period check for opening trades in my expert. For example, (Highest+Lowest)/2 is MIddle point
it must buy below the middle point and sell above the middle point
This is the source about checking the levels, and this::
Is the code for swith pairs,
But still it is not working correct becous it buys when it's above the Midleline and Sell below the middelline, maby you guys know something more about it?
greetz willem