[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 95

 
dixi:

MetaEditor stopped working after reinstalling the terminal. It only works if you don't change anything in the indicator code. If you change something, even the colour of the line, it generates an error:

The operating system is Windows 7. Who knows, maybe somebody faced such glitch. Can you tell me what to do?


Firstly, go to terminal properties and on tab "Compatibility" tick "Run as administrator". Second, do the same with the file that launches the code editor. The file is MetaEditor.exe. Thirdly, customize your operating system. The last point is quite quick if you know exactly what you need.
 
demlin:

Greetings all!

Please help with this problem: I can't get the indicator to redraw with the appearance of a new bar (D interval). П

I have to restart it manually.


The line 44 is absolutely unnecessary. The call of the function of recalculation of uncalculated candlesticks will return all of them. Further, in the start function code, calling the same function (line 64) should, in theory, return zero. Pay attention to this. A new day has come (a new candlestick). it is not clear what is going on - the indicator was cut off yesterday and restarted today, or it is testing in the tester? The restart will trigger the initialisation function, then the start will start. The start will not redraw anything, as we have already called the uncalculated bars at startup. If in the tester, it may be redrawn.

 
FxPro2:
Hi all! I have come across an old expert working with asctrend indicator. I would like to check how this indicator behaves in real time, but I cannot always follow the dots and my trading is not full. I checked the tester, there is a signal at every point, but put it on a demo and noticed the thing that the demo skips signals, while the log did not write anything to the expert, digging in the code and did not understand what the problem :( maybe someone poke a nose in what may be the problem?

The trouble is, you don't understand the code you're using. The problem is that you're holding a machine gun and for some reason it doesn't always fire. Wouldn't it be better to get your hands on a device that you understand everything about? А?
 
drknn:

Firstly, go to the properties of the terminal and on the Compatibility tab check the "Run as administrator" box. Second, do the same with the file that launches the code editor. The file is MetaEditor.exe. Thirdly, customize your operating system. The last point is quite easy to solve, if you know what you want.
Thank you! Got it!!! :)))
 
Dimka-novitsek:

if (NormalizeDouble(OrderClosePrice()-OrderTakeProfit(), Digits)<0.5*Point)

It's just that the variant without NormalizeDouble is not so reliable when compared to zero. It works here.


It's not about ND. Point is the size of a point; let's multiply it by zero five, it will be 0.00005 for example; I don't see any sense in comparing this number with OrderClosePrice()-OrderTakeProfit(). TP does not guarantee exactly the same closing price. Plus the check conditions will be different for Bais and Selves.

if(OrderType() == OP_SELL)
       {
        if( NormalizeDouble(OrderTakeProfit()-OrderClosePrice(),Digits) >= 0
          && OrderTakeProfit() != 0)    

This design is more reliable.

 
drknn:

The problem is that you don't understand the code you are using. The problem is that you have picked up a machine gun and for some reason it doesn't always fire. Wouldn't it be better to get your hands on a device that you understand everything about? А?
Maybe. But your two latest posts are nothing but moralizing, and you would do better to point them at the right idea. If you do not have such a desire, why write unnecessary things? I did not force anyone to help me, if there is no desire, I will not take offense, the work is difficult, I understand it perfectly.
 
drknn:
You guys with the long codes! I'd like to reiterate that someone else's code is first of all a cryptogram, which has yet to be deciphered! And that's a lot of work! Do you think any programmer wants to dig through kilometres of listing? Let me give my code to one of you just for three thousand lines and ask to eliminate a small misunderstanding of this code. Do you think you just want to get into my brainchild? I doubt it again. So I have a request to you - when you ask a key question, describe the problem as briefly as possible and at the same time make the description sufficient to understand its essence. Otherwise your cry is a cry in the void. The code can be attached to the post. This is all necessary and sufficient.

I completely agree with you.


FxPro2:

drknn:

The catch is that you don't understand the code you're using. The catch is that you picked up a machine gun and for some reason it doesn't always fire. Wouldn't it be better to get your hands on a device that you understand everything about? А?
Maybe. It's only your last two posts that have gone nowhere, just moralizing, or better yet, pointing to the right idea. If you have no such desire, why write unnecessary things? I did not force anyone to help me, if there is no desire, I will not be offended, the work is difficult, I understand it perfectly.

But you really don't understand the code you gave earlier, do you?

 

Hello all!!! Help plz, just learning to write, peredomnoy got this problem, I can not write code to increase the lot size by a certain step given in the prametrov, reviewed a bunch of advisers and was able to sort out, I got to increase the lot, only depending on the margin. Please advise where to look, and my head is already broken. I have already got my head screwed up. Thank you!

 
SeALALex:

Hello all!!! Help plz, just learning to write, peredomnoy got this problem, I can not write code to increase the lot size by a certain step given in the prametrov, reviewed a bunch of advisers and was able to sort out, I got to increase the lot, only depending on the margin. Please advise where to look, and my head is already broken. I have already got my head screwed up. Thank you!

Show your code with condition, after which you need to increase the lot by a certain step, set in parameters, and how you tried to implement this.
 
Болк открытия на бай
if(Buy==true) 
  {Buy=false;

   ticket=OrderSend(Symbol(),OP_BUY,Lots,NormalizeDouble(Ask, Digits),5,SL,TP,Order,070177,0,Orange);
   if(ticket>0)
    { 
     if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) 
      {Print("BUY order opened : ",OrderOpenPrice());
       Alert("Buy Order for ",Symbol());
       SendMail("Buy Order "+Symbol()+" "+Ask,SL);     
       }
     }
     else Print("Error opening BUY order : ",GetLastError()); 
     return(0); 
   }

Умножение лота в зависимости от маржи нашел в советнике, 
код вставил работает вот только в советнике он увеличивает на определенный шаг, у меня просто в %-ом соотношении

double LotSize() 
  
   {
   double lots_0;
   if (MicroLots == FALSE) {
      lots_0 = NormalizeDouble(AccountFreeMargin() * RiskPercent / 1000.0, 1);
      if (lots_0 < 0.1) lots_0 = Lots;
      if (lots_0 >= 1.0) lots_0 = NormalizeDouble(lots_0, 1);
      if (lots_0 >= 100.0) lots_0 = 100;
   } else {
      lots_0 = NormalizeDouble(AccountFreeMargin() * RiskPercent / 1000.0, 2);
      if (lots_0 < 0.01) lots_0 = Lots;
      if (lots_0 >= 1.0) lots_0 = NormalizeDouble(lots_0, 2);
      if (lots_0 >= 100.0) lots_0 = 100;
   }
   return (lots_0);
}
It's like this
Reason: