evgenykei:
please use the SRC-button when you post your code!
It is a code of event my expert:
CTrade trade;
CPositionInfo myposition;
void OnTick() {
if(IsNewBar())
{
if(myposition.Select(_Symbol)==true) //Case 1
{
trade.PositionClose(_Symbol);
}
if (myposition.Select(_Symbol)==false) //Case 2
{
// Position open place
}
}
}
This code correct works in tester and does not work in real: never open position (case 2) if before that position was closed (case 1). Why ?. Once more time - expert works fine in tester (open and close positions).

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
It is a code of event my expert:
This code works fine in tester but does not work in real: never open position (case 2) if before that position was closed (case 1). Why ?. Once more time - expert works fine in tester (open and close positions).