Hi guys, i would like to know how it’s possible to open positions only in the opposite direction after a profit target.
For example, i am long on market and the position close after hitting an x profit target. I want that the next position opened is only a short one excluding every long signal.
How can i do this? Thanks.
Try this one:
Defparam CumulateOrders = false
Once TradeLong = 1
Once TradeShort = 1
If StrategyProfit > StrategyProfit[1] Then
If LongOnMarket[1] Then
TradeLong = 0
TradeShort = 1
Else
TradeLong = 1
TradeShort = 0
Endif
Endif
If MyLongConditions and Not OnMarket and TradeLong Then
BUY ....
Endif
If MyShortConditions and Not OnMarket and TradeShort Then
SELLSHORT ....
Endif
It works but refers to the strategyprofit, so it doesn’t open more then 1 position per day.
I want it to react to the reaching of the target profit level.
Is that possible?
STRATEGYPROFIT has nothing to do with days, it is updated as soon as any trade closes, if 10 trades a day close, then 10 times a day it is updated.
I managed to fix by editing these lines
If LongOnMarket Then
set target %profit 0.3
TradeLong = 0
TradeShort = 1
Endif
If ShortOnMarket Then
set target %profit 0.3
TradeLong = 1
TradeShort = 0
Endif
in order to have it also for both directions