"If the trade is still open, it's the current price of the asset or contract".
So, this is why I was using it
I think you're right!
Can I use optimize() and how inside TMF function ?
I would like to see where is the most optimal to move my SL ?
Or you maybe suggest to plot MAE and price profile ?
Thanks,
Neb
Call optimize() in run(). If you need the optimized values in your TMF, share the return value from optimize() with your TMF, such as with a global value, AssetVar, or TMF parameter., i.e. enterLong(myTMF, parameter1, parameter2, ...).