how to add indicator code into expertadvisor code ?? - page 2 12345678910 New comment [Deleted] 2012.05.13 19:03 #11 int start { if (Close<i) int Ticket = OrderSend(Symbol(),OP_BUY,LotSize(),StopLoss(),TakeProfit(),0,0,); else OP_SELL; return(0); } what's wrong with this ??? still the same error, { - comma or semicolon expected Simon Gniadkowski 2012.05.13 19:14 #12 What is OP_SELL; doing there ? OP_SELL = 1 see here: https://docs.mql4.com/constants/trading dabbler 2012.05.13 20:00 #13 albert_lim83: what's wrong with this ??? still the same error, { - comma or semicolon expected start is a function and needs brackets after it Close is an array and needs an index. int start(){ if( Close[1]<i ) int Ticket = OrderSend(Symbol(),OP_BUY,LotSize(),Ask,10,StopLoss(),TakeProfit()); else OP_SELL; // WTF? return(0); } Missed two parameters from OrderSend Grade 1 out of 10. Must try harder. Must RTFM. [Deleted] 2012.05.14 14:16 #14 '%' - remainder operator is to be applied to integer values only why can't i put % on the ea ?? i wish to use for counting % free margin of total balance ... then how should i do to calculate the percentage of free margin of balance ?? [Deleted] 2012.05.14 14:48 #15 extern double Percent = 20; for insert percentage of margin to use if(AccountFreeMargin()<(Percent())(AccountBalance())){ Print("We have no money. Free Margin = ", AccountFreeMargin()); return(0); } if the percent of free margin is lesser than then percent i chosen(20), then the operation is stop and return 0, but the error appear 'percent' - function is not defined '(' - unexpected token anyone can help me to fix this error ??? Unexpected token" error when Machine learning in trading: error 'char' - unexpected Simon Gniadkowski 2012.05.14 15:39 #16 albert_lim83: why can't i put % on the ea ?? i wish to use for counting % free margin of total balance ... then how should i do to calculate the percentage of free margin of balance ?? How would you calculate a percentage using a pencil and paper ? do it the same way . . . . % in mql4 is for calculating a remainder not for percentages . . . Simon Gniadkowski 2012.05.14 15:40 #17 albert_lim83: for insert percentage of margin to use if the percent of free margin is lesser than then percent i chosen(20), then the operation is stop and return 0, but the error appear 'percent' - function is not defined '(' - unexpected token What is Percent() ? did you mean Percent ? Simon Gniadkowski 2012.05.14 15:45 #18 Here, for free . . extern double Percent = 20; if( AccountFreeMargin() < ( Percent/100 ) * AccountBalance() ) { Print("We have no money. Free Margin = ", AccountFreeMargin()); return(0); } [Deleted] 2012.05.14 15:55 #19 RaptorUK: Here, for free . . thanks... the problem is fixed. you are the best. ^^ [Deleted] 2012.05.16 01:01 #20 can i add MA in the ea chart ?? 12345678910 New comment
what's wrong with this ???
still the same error, { - comma or semicolon expected
what's wrong with this ???
still the same error, { - comma or semicolon expected
start is a function and needs brackets after it
Close is an array and needs an index.
Missed two parameters from OrderSend
Grade 1 out of 10. Must try harder.
Must RTFM.
'%' - remainder operator is to be applied to integer values onlywhy can't i put % on the ea ??
i wish to use for counting % free margin of total balance ...
then how should i do to calculate the percentage of free margin of balance ??
for insert percentage of margin to use
if the percent of free margin is lesser than then percent i chosen(20),
then the operation is stop and return 0,
but the error appear 'percent' - function is not defined
'(' - unexpected token
anyone can help me to fix this error ???
why can't i put % on the ea ??
i wish to use for counting % free margin of total balance ...
then how should i do to calculate the percentage of free margin of balance ??
How would you calculate a percentage using a pencil and paper ? do it the same way . . . .
% in mql4 is for calculating a remainder not for percentages . . .
for insert percentage of margin to use
if the percent of free margin is lesser than then percent i chosen(20),
then the operation is stop and return 0,
but the error appear 'percent' - function is not defined
'(' - unexpected token
Here, for free . .
Here, for free . .
thanks...
the problem is fixed.
you are the best. ^^