when a position closed

 

Hello guys

i am new in metatrader and want to learn some codes

the same as OnTick{ } or OnBar { }

is there a method that is called each time a position closes in metatrader

for example OnPositionClosed { }

 
No. You need to code it.
 
Alain Verleyen:
No. You need to code it.

Thanks Alin

 

The best logic came to my mind was


1- positions count.


2- if new position count < previous position count (closed positions = previous position count <  new position count).


is it good enough or there is a bitter suggestion .

Reason: