[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 320

 

Never compare, non-normalised takes, useless. And by the way the close price of a take order may be different from the take price (real/demo (online))

Therefore it would be more correct to measure the price difference module, comparing it with the test value.

if(MathAbs(OrderTakeProfit()-OrderClosePrice())<2*Point){Stop=false;}
 
Vinin:

Show me the code, how you tested it

   double in = 3.24857,res;
   int i, pretime = GetTickCount();
   for(i=0;i<1000000;i++){res=MathRound(in*10)/10;}
   Print("Stage 1 : ",GetTickCount()-pretime);
   pretime = GetTickCount(); 
   for(i=0;i<1000000;i++){res=NormalizeDouble(in,1);}
   Print("Stage 2 : ",GetTickCount()-pretime);  
Shocked myself :)))
 
FAQ:

Never compare, non-normalised takes, useless. And by the way the close price of a take order may be different from the take price (real/demo (online))

Therefore it would be more correct to measure the price difference module, comparing it with the test value.

is this already done or only after OrderSelect?
 
within a selection
 
FAQ:
inside the selector.
OK. I'm already trying...
 
okvseok:
Okay. I'm trying...
Clear. Thank you. It's working.
 
Hi, I'm new here, but for a long time=). I would like to add to the condition of opening a trade the reading of the MA 30 and 10 step indicators. I.e., if the value of MA30 >MA10 then sell and vice versa. I thank you in advance.
 
Evylol:
Hi, I'm new here, but for a long time=). I would like to add to the condition of opening a trade the reading of the MA 30 and 10 step indicators. I.e., if the value of MA30 >MA10 then sell and vice versa. I thank you in advance.


https://docs.mql4.com/ru/indicators/iMA

if(iMA(Symbol(),Period(),30,0,MODE_SMA,PRICE_CLOSE,1)>iMA(Symbol(),Period(),10,0,MODE_SMA,PRICE_CLOSE,1)){bla.bla.bla}
 

Thank you.

 
FAQ:

Shocked myself :)))

I should put it in the Annals, ugh, in the FAC
Reason: