Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 630

 
Andrey Sokolov:

Greetings. Can you tell me what the problem is and how to solve it?

Changed a few candles in the history for testing, for the 1st, 2nd, 3rd and 6th.

When testing, the second is processed, the third is drawn (without processing), and stopped, giving an error stopped because of Stop Out

Stop Out - money ran out, positions were closed by force).

*************************************************************************************

How can I change the chart symbol?

Open charts EURUSD M5, EURUSD M15, EURUSD M30, USDCHF H1.

At 7:00 it must be changed to GBPUSD M5, GBPUSD M15, GBPUSD M30, EURJPY H1 at 19:00 to return EURUSD and USDCHF charts as before

 
danil77783:
Hello. My question is this. When I run the EA in the strategy tester, I get error 130 (wrong stops), can you please tell me where the error is? My Expert Advisor is based on custom indicators. Here is the code

I can't see your code in MT4 right now, but you can see that here:

ticket = OrderSend(Symbol(),OP_SELL,Lot,Bid,10,Bid+SL,0,NULL,Magic,0,clrRed);

what is SL?

and why are you sending non-normalized prices to the server?

ticket = OrderSend(Symbol(),OP_SELL,Lot,Bid,10, NormalizeDouble(Bid+SL,Digits),NormalizeDouble(0.0,Digits),NULL,Magic,0,clrRed);
 
Igor Makanu:

I can't see your code in MT4 right now, but you can see that here:

what is SL?

and why are you sending non-normalized prices to the server? it should be at least like this:

Thanks for the reply, but it's the same.

 
danil77783:

Thanks for the answer, but it's the same.

Answer Igor's question correctly"what is SL? Perhaps things will change.

 
Galim_V:

Answer Igor's question correctly:"what is SL? Perhaps things will change.

Thank you for your reply. Then it must be prescribed the same block as for TP

TP = NormalizeDouble (Bid - TakeProfit*Point, Digits);
           if (OrderSelect(ticket,SELECT_BY_TICKET))
             if(OrderModify(ticket, OrderOpenPrice(),SL , TP, 0));

Do I understand it correctly? This code works in forex forex platform, it opens sell order, sets stop loss, take profit. I copy it in order to save my working code and to continue working with a copy, but a copy in the same terminal, only under a different name, already shows error 130. I understand that there are plenty of errors, but why then does it work in the first case?

 
  • how to add a specific filter based on the ATR indicator to the code where the trawl is activated?
  • then transfer "stop" to CU+ accordingly
  • with a dynamic step based on the same ATR indicator
 
danil77783:

Thank you for your reply. Then you have to prescribe the same block for it as for TP

Do I understand it correctly? You see, this code works in forex forex terminal, opens sell deals, places stop loss and take profit. I copy it in order to save my working code and to continue working with a copy, but a copy in the same terminal, only under a different name, already shows error 130. I understand, that there are a lot of errors, but why then it works in the first case?

On the first point, the answer is yes.

For the second, maybe you're copying wrong; maybe the program is working with files; etc.

 
Galim_V:

On the first point, the answer is yes.

For the second, perhaps you are copying incorrectly; perhaps the software is working with files; etc.

OK, thanks anyway! I'll add to it.

 
Can anyone advise me on a forex platform on my phone that I can make money on? I have a OnePlus phone
 
Giovano Santos:
Can anyone advise me on a forex platform on my phone that I can make money on? I have a OnePlus phone

.