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

 
GSB:

129 error occurs when the price has time to change before the DC executes your order, use a bigger slippage.


The slippage is 50 old pips, the price after the decimal point has 5 or 4 digits, sometimes it is 12 or 16. I test it on demo.
 
Example2:


No not in the tester, just a demo account.

Already noticed your post and deleted mine - wrote it from last page. Without the code it's hard to tell you anything specific.
 
artmedia70:
Already noticed your post and deleted mine - wrote it from the last page. Without the code it's hard to tell you anything specific.


Shall I send it to you in the forum or privately?
 
Example2:

Do you want me to post it on the forum or in person?
Please drop it on the forum if you don't mind. Someone will correct it. I'm already crawling into bed - it's 5:30 in the morning, the horse is still up...
 
I'm going to bed too.
Files:
 
     USDCADAsk = MarketInfo("USDCAD",MODE_ASK);            
     USDCADBid = MarketInfo("USDCAD",MODE_BID);

     Comment("USDCADAsk = "+DoubleToStr(USDCADAsk,нужный диджитлс),"\n",
             "USDCADBid = "+DoubleToStr(USDCADBid,нужный диджитлс));
 
hoz:

There is one more strange moment here. If there will be an item of the string-type structure, if the number of variable characters of this item is more than 7, will we place it above the rest? After all, strings always have a null-character \n at the end of the string and if there are more than 7 items in the string, for example, 8 items, the string will have 8 + 1 bytes because 8 + \n. Right?

If the structure contains variables of type string and/or dynamic array object , the compiler assigns an implicit constructor to such a structure, where all members of structure typestringare zeroed and a correct initialization isperformed for the object of dynamic array.

 
Example2:

I'm sleeping too.

Attached files:
Kuklovod_USD_1.1.mq4


You can't write codes that inattentively :)

First, Comment("USDCADAsk = ",USDCADAsk); then USDCADAsk = DoubleToString(MarketInfo("USDCAD",MODE_ASK),usdcaddigits); USDCADAsk is declared as a double, but you put a String in it,

and then Digits.... again ^) and Point

You have to look for such errors yourself, no one will fix them for you as well as trade! The compiler generates 28 errors and you put the demo into trading. You may be sorry that you are not trading for real as the market would correct you!

 if (USDCHF){while(IsTradeContextBusy()){Sleep(10);}
                    RefreshRates();
                    Result[1] = OrderSend("USDCHF",OP_BUY,Lot,USDCHFAsk,slip,USDCHFAsk-NormalizeDouble(sl*Point,Digits),USDCHFAsk+NormalizeDouble(tp*Point,Digits),"USDCHF",magic[0],0,Red);
                    if (Result[1] < 0){Alert("Функция OpenOrders ","\n","Валютная пара "+"USDCHF","\n",
                    "Команда: открыть ордер Sell","\n", "Ответ сервера: " ,errors(GetLastError()) );}}
        if (USDJPY){while(IsTradeContextBusy()){Sleep(10);}
                    RefreshRates();
                    Result[2] = OrderSend("USDJPY",OP_BUY,Lot,USDJPYAsk,slip,USDJPYAsk-NormalizeDouble(sl*Point,Digits),USDJPYAsk+NormalizeDouble(tp*Point,Digits),"USDJPY",magic[0],0,Red);
                    if (Result[2] < 0){Alert("Функция OpenOrders ","\n","Валютная пара "+"USDJPY","\n", 
                    "Команда: открыть ордер Sell","\n", "Ответ сервера: " ,errors(GetLastError()) );}}

Whose Bid Ask is it ?

//-----------

void CloseOrders(){
      for (int i = OrdersTotal()-1; i>=0; i--){
         if (OrderSelect(i,SELECT_BY_POS,MODE_TRADES)){
             if (OrderMagicNumber() == magic[0]){
               if (USDBuySl || USDBuyTp){
                 while(IsTradeContextBusy()){Sleep(10);}
                 RefreshRates();
                 OrderClose(OrderTicket(),OrderLots(),Bid,slip,Blue);
               }
             }
   .................
        OrderClose(OrderTicket(),OrderLots(),Ask,slip,Blue);


Correct

RefreshRates();
double bid=MarketInfo(OrderSymbol(),MODE_BID);
double ask=MarketInfo(OrderSymbol(),MODE_ASK);
OrderClose(OrderTicket(),OrderLots(),bid,slip,Blue);
.............
OrderClose(OrderTicket(),OrderLots(),ask,slip,Blue);
 
Help me find the maximal value of indicator N for the previous day, I get the data through iCustom and then a deadlock. I think it's done through ArrayMaximum, but how to find the value

I don't know what iCustom should do, I can't think of any other options.

 
Alexandr24:
I need help in finding the maximal value of indicator N for the previous day; I receive data through iCustom, but it is a deadlock. I think it is done through ArrayMaximum, but how to find the value

I can't figure out how to fit iCustom in there, but I can't think of any other options.



1. Find the bar number at the beginning of the previous day, find the bar number at the end for.

2. I would loop from one number to the other and calculate the maximum.

You can, of course, use ArrayMaximum, but after the first step.

Reason: