Zitat:
Zitat von deadlef
das ist ein mql4.
Mein Problem ist die vorgegeben funktionen wie
PHP-Code:
bool CheckMoneyForTrade(string symb, double lots,int type)
{
double free_margin=AccountFreeMarginCheck(symb,type,lots);
//-- wenn es Geldmittel nicht ausreichend sind
if(free_margin<0)
{
string oper=(type==OP_BUY)? "Buy":"Sell";
Print("Not enough money for ", oper," ",lots, " ", symb, " Error code=",GetLastError());
return(false);
}
//-- die Überprüfung ist erfolgreich gelaufen
return(true);
}
wie führe ich die aus.
if(CheckMoneyForTrade==true) ??????
|
So wie Du jede andere Funktion auch aufrufst, Funktion(Arg1,Arg2,...):
Code:
if( CheckMoneyForTrade(Symbol(), // akt. Markt für string symb,
Lots, // Lotgröße für double lots,
OP_BUY) // Buy oder Sell für int type)
) // wenn Check erfolgreich => genug Geld
Das ==true brauchst Du nicht, denn die Funktion liefert ein true bei Erfolg, ist also doppelt gemoppelt. Ich hoffe, so kommst Du weiter. AVT