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

 
nemo811:

I will continue with my above question.

I have also used the above code in another EA. The situation with that EA was similar to that described above with the difference that the code conditions were fulfilled exactly the other way around (in the demo, again, everything was working without errors). But one day the tester worked correctly and the code was working properly according to the conditions given to it.

It's a real mysticism.

Also, I sometimes cannot optimize my code for some reason. Sometimes it recalculates something but resets all results to zero for some reason. It happens so on terminals of different brokers. However, when all the stars and constellations in the sky probably converge, everything starts working as it should.


All that remains is to remember the time and day of the week.
 
Vinin:

All that remains is to remember the time and day of the week.
I don't feel like laughing...
 
could you tell me if there is any way to request a profit value for a certain order?
 
nadya:
could you tell me if there is any way to request a profit value for a certain order?
search for it on the ticket, if there are no other search conditions and ask for what you want
 
vilard:

there are 2 user modifications Mod_1 and Mod_2

in both cases the modification condition:

double TS;
int Min_Dist=MarketInfo(Symb,MODE_STOPLEVEL);

if (TS < Min_Dist)
TS=Min_Dist;

How do I change it so the modification doesn't go through with a stop loss condition, for buy stop loss is less than trailing stop,

and for sell, stop loss is larger than trailing stop


https://book.mql4.com/ru/trading/ordermodify
 
nadya:
could you tell me if there is any way to request a profit value for a certain order?
double OrderProfit( )
Returns the net profit value (excluding swaps and commissions) for the selected order. For open positions, this is the current unrealized profit. For closed orders, it is the fixed profit.
The order must be pre-selected using the OrderSelect() function.
Example:
if(OrderSelect(10, SELECT_BY_POS)==true)
Print("Profit for the order 10 ",OrderProfit());
 
Roll:
double OrderProfit( )
Returns the net profit value (excluding swaps and commissions) for the selected order. For open positions, it is the current unrealized profit. For closed orders, it is the fixed profit.
The order must be pre-selected using the OrderSelect() function.
Example:
if(OrderSelect(10, SELECT_BY_POS)==true)
Print("Profit for the order 10 ",OrderProfit());
Thank you, I was looking for it somewhere else, so I couldn't find it)
 
At least tell me please: can the problems I've mentioned only be related to the tester? Or do I need to dig deeper and take a broader look?
 
MaxZ:
Make unique names and remember them. I don't know your task, maybe you don't need to.
Thanks, MaxZ ! I'll give it a try.
 
sergeev:
make a Win32 dll project
Tried different projects - same problem.
Reason: