Hi, I have been over this over and over and cannot see what the problem is. It keeps compiling removed. Help.
and saying res is an undeclared identifier and it is not working even when that is - 'i' - undeclared identifier
- Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes
- Questions from a "dummy"
Richard Roberts:
Hi, I have been over this over and over and cannot see what the problem is. It keeps compiling and saying res is an undeclared identifier and it is not working even when that is removed. Help.
Hi, I have been over this over and over and cannot see what the problem is. It keeps compiling and saying res is an undeclared identifier and it is not working even when that is removed. Help.
//--Adjust stops ----------------------------------------------------------------------// void AdjustStops() { bool res=false; for(int Orders =OrdersTotal() -1; Orders>=0; Orders--) { if (!OrderSelect(Orders,SELECT_BY_POS,MODE_TRADES) ||(OrderMagicNumber() != MagicNumber) ||(OrderType()!= OP_BUY) ||(OrderSymbol()==Symbol()) ||(!IsThisANewCandle())) continue; if(OrderStopLoss() <Low[a]) res =OrderModify(OrderTicket(),OrderOpenPrice(),Low[a],OrderTakeProfit(),0,clrPink); if(!res) Print("Error in OrderModify. Error code=",GetLastError()); else Print("Order modified successfullyxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); } }
try this
Kenneth Parling:
try this
Thanks, that has fixed it. I can now get an error code. it is '0'. Great. Can you see what I am missing here with the modify order? i'm stuck
Richard Roberts:
Thanks, that has fixed it. I can now get an error code. it is '0'. Great. Can you see what I am missing here with the modify order? i'm stuck
skip the whole res thing.....
//--Adjust stops ----------------------------------------------------------------------//
void AdjustStops()
{
for(int Orders =OrdersTotal() -1; Orders>=0; Orders--)
{
if (!OrderSelect(Orders,SELECT_BY_POS,MODE_TRADES)
||(OrderMagicNumber() != MagicNumber)
||(OrderType()!= OP_BUY)
||(OrderSymbol()==Symbol())
||(!IsThisANewCandle()))
continue;
if(OrderStopLoss() <Low[a])
if(!OrderModify(OrderTicket(),OrderOpenPrice(),Low[a],OrderTakeProfit(),0,clrPink)){
Print("Error in OrderModify. Error code=",GetLastError());}
else{
Print("Order modified successfullyxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");}
}
}
Kenneth Parling:
skip the whole res thing.....
That worked. Thank you for the help
Richard Roberts:
That worked. Thank you for the help
you are welcome ;)
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