2) As I found out, I can't use distance in TMF to set it up ?
This won't work ->
TradeStopLimit = 50*PIP;
It set my stop basically to the price value of 50, as my test shows.
3)
TradeStopLimit = priceClose()-4*ATR(40));
I found this to work, but problem is that it is going up and down and in long trade I want it to go only up or not to change once it has been setup.
4)
How I can setup trail, as it said I can't setup with distance in PIP. How actually I am setting it up, if I want to use different TradeTrailLock, according to the level of profit ?
if (TradeProfit >0) { TradeTrailLock = 0.2 } if (TradeProfit >0.05*Balance) { TradeTrailLock = 0.8 }
I am not great in programming, just learning, sorry
You meant about for {} loop ? Ok ! Actually it is redundant I suppose, cause I've been calling for all open trades and then again checking if trade is long or short.
I did call enterLong(myTMF) and enterShort(myTMF) inside run{}, as it was in one of the examples. Is that ok or ... ?
The TMF answers the question: "I have this trade open. What do I do with it?"
A trade loop such as for(open_trades) explicitly iterates through all open trades, which is a different way to handle trades or get information about them. Normally, you'd execute this from run() or tick().
More importantly, why are you using the value TradePriceClose when it is impossible to know what TradePriceClose is because your trade is still open? Use priceClose() instead.
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 ?
"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!
Originally Posted by Neb
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, ...).