(Partial) Take profit trailing
-
FXdreema has a block in place for stop-loss and take profit trailing. This block will move the hard stop-loss and take-profit, to then fully close the trade when hit.
I am trying to make an adjusted version of this within my strategy. Below number 1 and 2 is already implemented in FXdreema. Number 3 is not.
1 -> start the trailing of a take profit once the trade is 50% in loss of current stop-loss
2 -> define steps and stops, similar to the options within the trailing stop block already in place3 -> define what volume needs to be closed once the trailing take profit has been hit. I dont want the trade to be fully closed.
I am trying to tackle above with this project: https://fxdreema.com/shared/ctSDXrned
Within the project horizontal line "LIM" will be moving with a fixed distance from moving average 1 (current price). LIM should however work as a virtual trailing take profit and therefore only move in one direction; north in case of a sell and south in case of a buy.
The next step would be a condition whenever price crosses below or above LIM the partial take profit closing will take place. This is no big deal and i can handle this myself.
My question is if anyone has ideas how i can produce a horizontal line that is only trailing upwards or downwards, and not both directions as seen in the project example i've given. In other words, a trailing line that would only move north once the price goes north and ignore movements to the south.
Hope someone can help me on this, thanks.
-
@robertk But do you really need a horizontal line plotted on the chart? Why not using a math calculation for a price level behaving as that line? Not sure I fully catch the logic behind that.
-
@l-andorrà i dont really know how to create or implement a math code in fxdreema
but thanks for your suggestion.I did manage in the end to create a virtual trailing take profit which closes the trade partially. I used a condition where each new candle high above a specific price creates a small object on top of a candle high. The next condition is that the ma1, as well as each new created candle high should be above those created objects. If all conditions are true the trailing line will move a fixed distance from new candle highs.
-
@mrrhypon But why using objects and not the high/low level price of candles instead? Those values can be easy stored into variables.