Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 1075

 
rapid_minus:
I apologise for not using the SRC, for some reason it doesn't work for me.
Could you at least align by rows???
 
No. And the alignment doesn't work. when you press enter, the text is sent to the chat, and when you tab, it disappears altogether.
 
Well then, wait for someone who doesn't feel bad about breaking eyes.
 
You can copy and paste it into an mc4 file, and everything will fit properly, and it's easier to read than from the chat room.
 
Vlad143:

I would experiment with the expiry time. A trade opening is requested, but a non-zero "Pending order expiry time" TimeExp = 5 is passed to OrderSend. According to the help, even in the legal case of pending order setting request

"On some trade servers there may be a prohibition on pending order expiry times. In this case an error 147 (ERR_TRADE_EXPIRATION_DENIED) will be generated when trying to set a non-zero value in the expiration parameter."

And, just in case, the expiry time is passed in seconds (datetime type). The value 5, I suspect, refers to minutes.

In this EA, the parameter TimeExp = 5 refers to the time of expiry of the option, i.e., TimeExp is a variable in the order comment. And the expiry time of the option is given in minutes.
 
Foxonn:
In this EA, TimeExp = 5 refers to the expiry time of the option, i.e., TimeExp is a comment variable for the order. And the expiry time is given in minutes.
So, the answer is not on this forum. Trading binary options through the MT4 platform is realized with the help of add-ons. In particular, the add-ons over MQL4. In spring 2015 I was trading a binary options advisor in GC, and there the duration of the b. option was set in some "twisted" way (through comments, I think, but I couldn't find my code now). I was under the impression that each company writes these plug-ins independently. Later, unified solutions from a third party seem to have appeared. But one has to ask the support team of each company to know the peculiarities of their work. These are not the features of MQL4.
 
Vlad143:
Then the answer is not on this forum. Binary options trading through the MT4 platform is implemented using software add-ons. In particular, add-ons over MQL4. In spring 2015 I was trading a binary options advisor in GC, and there the duration of the b. option was set in some "twisted" way (through comments, I think, but I couldn't find my code now). I was under the impression that each company writes these plug-ins independently. Later on, unified solutions from a third party seem to have appeared. But one has to ask the support team of each company to know the peculiarities of their work. These are not the features of MQL4.
Vlad143, thank you for the tip.
 
Good day to you all! I have this question: there is a text file from which you need to cut out a word programmatically. In any text editor it's very easy, but how do I do it programmatically?
 
melan:   there is a text file from which you need to cut a word programmatically
I read the file line by line into a string variable and cut the word from it. The resulting string is written to the output file. When I run out of the input file, I delete it. And I rename the output file.
 

Good afternoon, please help with this question. I have a code (somewhere downloaded from the good people) - the essence of the code is this: if the order is closed by a stop loss, it is re-set again with the same parameters. But the problem is that if I run it right now, the code reinserts all orders for past periods, and I want only those orders that have closed by stoploss for example only for today! Which filter to put, please advise? Don't know how to get the order date and compare it with the current date? Thank you.

  1. double OOP=0,OTP=0,OSL=0,OL=0;
  2. int OT=0;
  3. for (int i=OrdersHistoryTotal()-1; i>=0; i--)
  4. {
  5. if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY))
  6. {
  7. OT = OrderType();
  8. OSL = NormalizeDouble(OrderStopLoss(),Digits);
  9. if (OT<2)
  10. {
  11. if (NormalizeDouble(OrderClosePrice(),Digits)==OSL)
  12. {
  13. OOP = NormalizeDouble(OrderOpenPrice(),Digits);
  14. //OSL = NormalizeDouble(OrderStopLoss(),Digits);
  15. OTP = NormalizeDouble(OrderTakeProfit(),Digits);
  16. OL = OrderLots();
  17. }
  18. else OOP=0;
  19. break;
  20. }
  21. }
  22. }
  23. if (OOP!=0)
  24. {
  25. for (i=0; i<OrdersTotal(); i++)
  26. {
  27. if (OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
  28. {
  29. if (OrderSymbol()==Symbol())
  30. {
  31. if (NormalizeDouble(OrderOpenPrice(),Digits) == OOP && OL == OrderLots()) return(0)
  32. }
  33. }
  34. }
  35. if (OT==OP_BUY) OT=OP_BUYLIMIT;
  36. if (OT==OP_SELL) OT=OP_SELLLIMIT;
  37. if (OrderSend(Symbol(),OT,OL,OOP,0,OSL,OTP,NULL,0,0,clrNONE)==-1);