Coding help - page 734

 
mladen:

Guys

Funyoos EAs usually showed good results when using martingale on back test. I would be very careful when using them

Dearest MLADEN

Thanks for your point of view,i am only interested to have some pieces of code snippet from,like time control,TS/SL,BE and so on because there is no other way to make my ea work firmly (i my self do not know any bit coding and masters are busy/not interested) :) .... martingale and basket kind setup are out of my way.it is same like you have so many wives same as many pairs,hardly a gentle man can handle one :):)

regards

mean while can you remove errors/warning from this code plz.

Files:
 
@mladen,

I couldn't understand the logic of risk management in the attached ea.

am not sure whether the risk management works or not. (?)

The default in risk setting is "0.3" Even if i change it with "0.1", but i did not see any change in the visual test and open orders.


Would you please check whether risk management works and also how it works?

Thank you. 

Files:
 
oguz:
@mladen,

I couldn't understand the logic of risk management in the attached ea.

am not sure whether the risk management works or not. (?)

The default in risk setting is "0.3" Even if i change it with "0.1", but i did not see any change in the visual test and open orders.


Would you please check whether risk management works and also how it works?

Thank you. 

I think,risk manag belongs to your equity,how much percent you afford losses in total at one current situation/trade,when losses exceeds/cross this allowed risk percent, the trade will be closed.

take a big volume (10 or 20) trade,set risk at lowest level,suppose 0.0001 and test demo.

 
oguz:
@mladen,

I couldn't understand the logic of risk management in the attached ea.

am not sure whether the risk management works or not. (?)

The default in risk setting is "0.3" Even if i change it with "0.1", but i did not see any change in the visual test and open orders.


Would you please check whether risk management works and also how it works?

Thank you. 

It depends on the minimal lot size and the account equity (or balance, depending on the Choice_method parameter). If the lot size for some risk setting is less then minimal lot size, the minimal lot size must be used
 

Hi Pro-Coders,

I wonder if someone may review my code I try to debug.

I get error messages:

2016.12.19 09:47:50.882 2016.05.13 17:08:57  Robot EURUSD,H1: Error Buy Trailing #0 Error code 4051
2016.12.19 09:47:50.881 2016.05.13 17:08:57  Robot EURUSD,H1: OrderModify error 4051
2016.12.19 09:47:50.881 2016.05.13 17:08:57  Robot EURUSD,H1: invalid ticket for OrderModify function
2016.12.19 09:47:50.881 2016.05.13 17:08:57  Robot EURUSD,H1: Error Buy Trailing #0 Error code 4051
2016.12.19 09:47:50.881 2016.05.13 17:08:57  Robot EURUSD,H1: OrderModify error 4051

It seems so the EA is not able to finds the ticket to modify.

My code looks like this (here for the buy part), what should I improve in this case?

// Open BUY Ticket

if(!ECNbroker)
        {
           buy_ticket=OrderSend(Symbol(),OP_BUY,LotsOptimized(),NormalizeDouble(Ask,digit),Slippage*PipMultiplier,NormalizeDouble(StopLossLevel,digit),
           NormalizeDouble(TakeProfitLevel,digit),"Buy(#"+MagicNumber+")",MagicNumber,0,Green); // BUY Ticket
           }
         if(buy_ticket>0)
           {
            if(OrderSelect(buy_ticket,SELECT_BY_TICKET,MODE_TRADES))
              {
               dummyResult=OrderModify(buy_ticket,OrderOpenPrice(),NormalizeDouble(StopLossLevel,digit),NormalizeDouble(TakeProfitLevel,digit),0,CLR_NONE);
               Print("BUY order modified : ",OrderOpenPrice());
              }
            else Print("Error opening BUY order : ",GetLastError());
           }
        }
      if(EachTickMode) TickCheck = True;
      if(!EachTickMode) BarCount = Bars;
      return(0);
     }

        
// Trailing Stop

double BuyStop;
        
if(TrailingStopMode)
     {
      if(TrailingStop>0)
      BuyStop=Bid-Point*PipMultiplier*TrailingStop;
          else BuyStop=iSAR(NULL,0,iSAR_Step,iSAR_Maximum,Current+0);

      if(BuyStop>OrderOpenPrice() || TrailingStop==0)
        {
         if(OrderStopLoss()<BuyStop)
           {
            dummyResult=OrderModify(OrderTicket(),OrderOpenPrice(),BuyStop,OrderTakeProfit(),0,MediumSeaGreen);
            Print("Error Buy Trailing #",(string)OrderTicket()," Error code ",(string)GetLastError());
            if(!EachTickMode) BarCount=Bars;
            return(0);
           }
        }
     }
   else
     {
      if(OrderType()==OP_SELL && OrderMagicNumber()==MagicNumber)
        {
         // SELL Stop              
         if(TrailingStopMode)
           {
            if(TrailingStop>0) SellStop=Ask+Point*PipMultiplier*TrailingStop;
            else SellStop=iSAR(NULL,0,iSAR_Step,iSAR_Maximum,Current+0);
            if(OrderOpenPrice()>SellStop || TrailingStop==0)
              {
               if((OrderStopLoss()>SellStop) || (OrderStopLoss()==0))
                 {
                  dummyResult=OrderModify(OrderTicket(),OrderOpenPrice(),SellStop,OrderTakeProfit(),0,DarkOrange);
                  Print("Error Sell Trailing #",(string)OrderTicket()," Error code ",(string)GetLastError());
                  if(!EachTickMode) BarCount=Bars;
                  return(0);
                 }
              }
           }
        }
     }

   if(!EachTickMode) BarCount=Bars;
   Comment(ShowInfo());
   return(0);
  }
 

Friends

Help needed.

Any one please add an alert system for the Ultimate arrows ? It repaints. It is useless in low time frames.

However in high time frames H1, H4 it will help us to know possible reversals.  An alert system for the Ultimate arrows in the form of Sound and Email will help us to have a look at the particular chart. We can take position based on MACD and Arrows.

Thanks in advance.


Kumar

Files:
 
kumarkallur:

Friends

Help needed.

Any one please add an alert system for the Ultimate arrows ? It repaints. It is useless in low time frames.

However in high time frames H1, H4 it will help us to know possible reversals.  An alert system for the Ultimate arrows in the form of Sound and Email will help us to have a look at the particular chart. We can take position based on MACD and Arrows.

Thanks in advance.


Kumar

There is no difference when it comes to time frames how an indicator repaints (when it repaints) It will repaint in higher time frame exactly the same as in lower time frames. So, the usefulness of higher time frames is exactly the same as lower time frames. The fact that for higher time frames the bars "covering" the repainting period are taking longer are just making the repainting absolute error even larger

I any case : why don't you simply use some of the zigzag indicators instead of that indicator (since that is simply a zigzag)?


 
mladen:
It depends on the minimal lot size and the account equity (or balance, depending on the Choice_method parameter). If the lot size for some risk setting is less then minimal lot size, the minimal lot size must be used

@mladen,

Thank you very much your detailed answer.

I want to ask you something else with your permission.

 

In order to use the attached ea with a real account, a code in it has to be opened! 

This was told by the forum that I found the ea. 

Can you make the code change to use the ea with a 5-Digits real account?

Thank you. 

Files:
 
oguz:

@mladen,

Thank you very much your detailed answer.

I want to ask you something else with your permission.

 

In order to use the attached ea with a real account, a code in it has to be opened! 

This was told by the forum that I found the ea. 

Can you make the code change to use the ea with a 5-Digits real account?

Thank you. 

I don't see anything that needs to "be opened"

That EA should work on any account and any type of account

 
mladen:

I don't see anything that needs to "be opened"

That EA should work on any account and any type of account

Hiiim...

Well what could the name user @ "jksmirnoff" mean below link?  (he's post; 84) 

http://forexsystemsru.com/sovetniki-eksperty-foreks-roboty/83939-dornasho-ea-5.html