Doesnt autotrade all pairs - page 2

 
sirpaul:


sorry i hope its in here

try to use MaxRisk = 5
 

Thanks for all the effort. But it still not working.. only when set fixed lots..

Argghh getting crazy :P

 
sirpaul:

Thanks for all the effort. But it still not working.. only when set fixed lots..

Argghh getting crazy :P

sorry, if you do not want to show all the code, no one wants to help you..
where in getpip() function.
 
Sorry this is all. and attached is the ea file.. I am new here
 
  1. _OrderSend(symbol,OP_BUY,lotsToTrade,Ask,SLIPPAGE,BuySL, BuyTP1,TradeComment,magic1,0,Blue);

    OrderSelect(cc, SELECT_BY_POS, MODE_HISTORY);
    Check your return codes and find out why. What are Function return values ? How do I use them ? - MQL4 forum and Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles
  2.   for (cc = OrdersTotal() - 1; cc >=0; cc--){
        :
        if (OrderSymbol() == symbol && OrderCloseTime() == 0)
    You are looking at open/pending orders. When could you possibly find closed order?
  3.   for (int cc = OrdersHistoryTotal()-1; cc >= 0; cc--){      
        :
        if (last_ticket==0) {
          last_ticket = OrderTicket();
    You assume history is ordered by date, it's not. Could EA Really Live By Order_History Alone? (ubzen) - MQL4 forum
  4.   lotsize   = MarketInfo(Symbol(),MODE_LOTSIZE);
      tickvalue = MarketInfo(Symbol(),MODE_TICKVALUE);
      pipvaluefor1lot = lotsize*tickvalue*pip;
      maxLot    = NormalizeDouble(AccountFreeMargin()*Risk/100/pipvaluefor1lot/SL,2);
    • You place the stop where it needs to be - where the reason for the trade is no longer valid. E.g. trading a support bounce the stop goes below the support.
    • Account Balance * percent/100 = RISK = OrderLots * (|OrderOpenPrice - OrderStopLoss| * DeltaPerLot + CommissionPerLot) (Note OOP-OSL includes the SPREAD, and DeltaPerLot is usually around $10/pip)
    • Do NOT use TickValue by itself - DeltaPerLot
    • You must normalize lots properly and check against min and max.
    • You must also check FreeMargin to avoid stop out
 

Thanks for all the input.

Going to work with it. Can take a while for me :P

Will let u know

 

This topic is was unreadable with all these source code.

  • Please attach a file not copy and paste all a source code.
  • When you reply please remove the code from the quote.

I made some cleaning.

 
Alain Verleyen: Please attach a file not copy and paste all a source code.
He did, #14
 
whroeder1:
He did, #14
I know he (finally) did it, my post was a general avice.
 
can anyone help me to fix this EA?
Reason: