We now come to the condition of entering into the deal, whether selling or buying, as in the following picture.
We sell if parabolic is greater than the current candle, and we buy if parabolic is less than the current candle.
So it will be a condition of buying.
And the condition of selling
Then we will need to add the order to open the deal when these conditions are met and add the stop loss and the target.
As for the purchase, it will be as follows.
PHP Code :
If we observe the two variables SL, TP
We set target TP equal to current price + TakeProfit * pip value
For example, the current price is 1.4000, and the target is 30 points, then the result will be
1.4000 + 30 * 0.0001 = 1.4000 + 0.0030 = 1.4030, which is the goal we want
And vice versa in the case of sale
We define the TakeProfit and StopLoss variables in the EXP external variants
Define the variables SL and TP in the START function