if positionperf(1)<0 and positionperf(2)<0 then
///not sure if they is a countdowntimer available
///not sure how to count candels
endif
Hi,
Just wondering if they is a way to pause a trading bot for one hour if the trading system has encountered two losses in a row ?
Topic moved to the correct forum. ProBuilder is for indicator topics and PrOrder is for strategy topics. Please try to post in the correct forum with future topics.
Between line 1 and 4 add
TradeON = 0
Add AND TradeON to your conditions to enter a trade.
If you use a hourly TF then you can set back TradeON = 1 when OpenHour <> OpenHour[1].
Add ONCE TradeON = 1 at the beginning of your code.
I coded this: (not tested)
Add TRADEOK to your entry conditions.
AllowedLosingTrades = 2
once tradeok = 1
if strategyprofit < strategyprofit[1] then
losercount = losercount + 1
endif
if losercount = AllowedLosingTrades then
tradeok = 0
restarttime = time + 010000
if restarttime >= 240000 then
restarttime = time - 230000
endif
endif
if not tradeok and time = restarttime then
tradeok = 1
losercount = 0
endif
Above added as Log 195 here …
Snippet Link Library