how to add indicator code into expertadvisor code ?? - page 7

 
onewithzachy:

Just the lot size, the take profit and stop loss must be calculated based on Ask or Bid price (or buy or sell)

:)

Sure, but a Function isn't needed for that, the calculation can be placed directly into the OrderSend() or used with the intermediate variable . . .

This . . .

double GetTakeProfitBuy() { return(Ask+longTradeTP*Point); } 

and this . . .

ldTake = GetTakeProfitBuy();

and this . . .

OrderSend(Symbol(),OP_BUY,ldLot,Ask,Slippage,ldStop,ldTake,lsComm,0,0); 

can be replaced with this . . .

OrderSend(Symbol(),OP_BUY,ldLot,Ask,Slippage,ldStop,  Ask+longTradeTP*Point   ,lsComm,0,0); 

longTradeTP is an extern

 
RaptorUK:

Sure, but a Function isn't needed for that, the calculation can be placed directly into the OrderSend() or used with the intermediate variable . . .

This . . .

and this . . .

and this . . .

can be replaced with this . . .

longTradeTP is an extern

You're right, there are two OrderSend (), I thought there's only one :(.

albert_lim83 2012.05.17 14:47

well, i trying demo since last week,

my ea could gain around 15-30% daily.

Don't believe in backtesting, forward test them.

:)

 
onewithzachy:

Don't believe in backtesting, forward test them.

:)

Forward testing is just a slow form of back testing, didn't we have this discussion before ;-)
 
RaptorUK:
Forward testing is just a slow form of back testing, didn't we have this discussion before ;-)

Yeah I read, it's just that I have this EA which is horrible in back testing but not bad in forward. So I don't believe in back testing since

:)

 

how to do if i want to enter on highest/lowest of zigzag and exit on lowest/highest of it ??


now my system is just exit depend on tp/sl 。。。

 
bool ExistPositions() 
   {
   for (int i=100; i<OrdersTotal(); i++) 
      {
      if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)&&(ZigZagHigh())/(ZigZagLow())) 
         {
         if (OrderSymbol()==Symbol()) 
            {
            return(True);
            }
         } 
      } 
   return(false);
   }

do this correct ??

but it cant compile ...

error show ZigZagHigh / ZigZagLow - function is not defined

 
Anything with () after it is a Function . . . for example OrderSymbol()
 

reading mql4 reference book,


really tired ~~

 

'\end_of_program' - unbalanced left parenthesis

it's really drive me crazy......

 
albert_lim83:

'\end_of_program' - unbalanced left parenthesis

it's really drive me crazy......

It will if you are not prepared to listen and learn . . . short cuts do not work . . . you need to learn.
Reason: