xanderhinds: , does any one know what it expects of me?
| It expects that you have read the documentation. Return Operator - Operators - Language Basics - MQL4 Reference |

Return Operator - Operators - Language Basics - MQL4 Reference
- docs.mql4.com
Return Operator - Operators - Language Basics - MQL4 Reference

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
Hi im somewhat new to coding and reached a problem using void ontick() .
Before it was simply int Start() , but i want the EA to recalculate after each tick, therefor ontick seems perfect,
however, the return(0) operation is now returning an error of " 'return' - 'void' function returns a value ",
whilst return() returns error message ')' expression expected...
this has somewhat confounded me, does any one know what it expects of me?
{
if(M1_1 < S1_1 && M1_0 >= S1_0) // ---- Green line crosses red upwards on 4H PERIOD
{
bool res4s;
res4s = OrderClose( OrderTicket(), OrderLots(), Ask, 10, Red );
if (res4s = false)
{
_GetLastError = GetLastError();
Alert( "Error OrderClose № ", _GetLastError );
return(-1);
}
else
{
Alert ("Sell Order Closed Successfully");
//---- if the alert has not changed, quit: it is too early to open a new position
}
}
//else OrderGetInteger(ORDER_TIME_SETUP);
// if (TimeCurrent => (ORDER_TIME_SETUP + 4 Hour)) STOPLOSSXS;
// else Alert ("Problem whilst moving SL to BE");
}
else return ();