[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 90

 
T-G:

Can you advise me, there is a csv file with data in the format 1.33027; 1.33023 and so on.

Then read this file but for some reason the data are read with a 4-digit accuracy and I need to with 5.

Read in different ways and

does not help

Readable to an accuracy of 15 digits. The latest builds are even larger when declaring constants. To display characters after the 4th, you must use a function.
 
Can I change an order that has a magic number while trading?
 
Hello, help advice, wrote an owl, it periodically has to open 2 orders at once the problem is that not always opens both orders, slippage I put and 3 and 5 and 10, but still no no yes and open a single. I can not figure out how to organize a keeper that would keep track of openings and, if necessary, open a missing "forgotten" order?
 
Myth63:
Can I change an order that has a magic number while trading?

No
 

Help who knows! I can't get this code to work:

for(i=1;i<=total;i++) // Order loop
{
if(OrderSelect(i-1,SELECT_BY_POS)==true)
{
if(OrderType()==OP_BUY && Ticket1==OrderTicket())
{
if(OrderCloseTime()==0 && SL1<Price1 && Bid-Price1>(NoLoss1*Point))
{
OrderModify(OrderTicket(),OrderOpenPrice(),Bid-(Point*(NoLoss1-3)),OrderTakeProfit(),0,Blue);
}
if ( OrderCloseTime()==0 && SL1>=Price1 && Bid - SL1 > ((NoLoss1+StepLoss1)*Point))
{
OrderModify(OrderTicket(),OrderOpenPrice(),Bid-(Point*(NoLoss1-3)),OrderTakeProfit(),0,Blue);
}
}
}
}

the point is that it should modify 1 order out of several : Ticket1, but it doesn't modify at all

 
azik1306:

Help who knows! I can't get the code to work:


for(i=1;i<=total;i++) // Цикл перебора ордер
{
   if(OrderSelect(i-1,SELECT_BY_POS)==true)
   {
      if(OrderType()==OP_BUY && Ticket1==OrderTicket())
      {
         // Что выводится??? Посмотрите и проверьте, выполняются ли условия модификации
         // А заодно проверьте, нет ли в логах сообщений об ошибке
         Print("SL1=",DoubleToStr(SL1,8));
         Print("Price1 =",DoubleToStr(Price1 ,8));
         Print("Bid=",DoubleToStr(Price1 ,8));
         Print("NoLoss1=",DoubleToStr(NoLoss1,8));
         Print("StepLoss1=",DoubleToStr(StepLoss1,8));

         if(OrderCloseTime()==0 && SL1<Price1 && Bid-Price1>(NoLoss1*Point))
         {
            OrderModify(OrderTicket(),OrderOpenPrice(),Bid-(Point*(NoLoss1-3)),OrderTakeProfit(),0,Blue);
         }

         if ( OrderCloseTime()==0 && SL1>=Price1 && Bid - SL1 > ((NoLoss1+StepLoss1)*Point))
         {
            OrderModify(OrderTicket(),OrderOpenPrice(),Bid-(Point*(NoLoss1-3)),OrderTakeProfit(),0,Blue);
         }
      }
   }
}
 
alsu:

+ if only 1 order with the ticket1 number needs to be changed, the cycle is not needed at all.

the ticket order is immediately selected and changed

 
ilunga:

+ if only 1 order with the ticket1 number needs to be changed, the cycle is not needed at all.

the ticket order is immediately selected and changed

Yep, +
 
Good people, please advise (or link to where my question has been discussed) which design is better in terms of speed 1 or 2:
// --- 1
if (Stochastic1<=20 && signal<value && flag>Big_flag && Ask<=price)
{ RefreshRates(); OrderSend(...); }

// --- 2
if (Stochastic1<=20)
{  if (signal<value)
   {  if (flag>Big_flag)
      {  if(Ask<=price)
         {  RefreshRates(); OrderSend(...);
}  }  }  }
 
paladin80:
Good people advise (or link to where my question was discussed) which design is better in terms of speed 1 or 2:

2.

as we are not exactly sure that in MT4 && operations are checked in order, with abort at false