1
Technical Support & Development / TSSL - Stop loss / trailing stops do not appear to work in bbtssl
« on: November 10, 2017, 01:23:30 AM »
I setup the new XT version of GB today on my VPS, and set it up to buy OMG using bbtssl with default settings other than trading limit which I changed to .01 BTC. The bot made the buy at the point on the BB that was expected, then I let it run for a few hours. I came back and the price had dropped well outside the stop loss range which it should have sold at, but the coins were not sold sticking me with a bag of coins at a loss which should have specifically been prevented by the TSSL strategy since that is the entire point of it.
I looked at the log files, and I can tell that the bot made the buy at log entry #128, and after that the coins never sold, even though the target sell price listed in the next log entry was hit within 10 minutes and then the stop loss limit was hit within a few candles after that. There were no attempts to sell them that I can find in the logs, but I may need to be searching for a particular phrase that I'm missing to see if an order was sent, but timed out since the default timeout is 600 seconds which would erase the record on bittrex of the transaction attempt, leaving the only evidence that of the bot's very long log file.
If anyone has any tips for how I can resolve this I'd be grateful.
LOG ENTRIES:
GBXT_v6.0.1 BTC-OMG Round # 128
------------------------------------------------------------------------------------------------
ɢ Ս Ñ ß ø Ł XT Edition Scanning bittrex for trading opportunities 2017/11/09 15:10:01
------------------------------------------------------------------------------------------------
2017/11/09 15:10:01 : BTC-OMG Last Bid/Ask 0.00114309/0.00114500
------------------------------------------------------------------------------------------------
EMA1: 0.00115938 === EMA2: 0.00115394
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
HIGH BB: 0.00118541 == SMA: 0.00116598 == LOW BB: 0.00114654
------------------------------------------------------------------------------------------------
2017/11/09 15:10:03 : Got Trading History
2017/11/09 15:10:03 : Checking Open Orders
------------------------------------------------------------------------------------------------
2017/11/09 15:10:03 : TrailingStop limit 0.00144126
------------------------------------------------------------------------------------------------
2017/11/09 15:10:03 : Last price 0.00114309 | Target to sell: 0.00144126
------------------------------------------------------------------------------------------------
2017/11/09 15:10:03 : StopLoss limit 0.00142407
------------------------------------------------------------------------------------------------
Price to sell is not in TSSL range
2017/11/09 15:10:03 : Price to buy: 0.00114701
2017/11/09 15:10:03 : Last Bid/Strategy Exit Point: 0.00114309/0.00144126
2017/11/09 15:10:03 : Last Ask/Strategy Entry Point: 0.00114500/0.00114701
2017/11/09 15:10:03 : There are some trading opportunities for BTC-OMG at bittrex . Scanning Trade History
ɢ Ʊ ŋ ß Ѻ Ŧ XT Edition Tips&Tricks: BTC-OMG can be bought!!!
2017/11/09 15:10:03 : Last Bid price BTC-OMG: 0.00114309 | Last Ask: 0.001145
2017/11/09 15:10:03 : Balance BTC: 1.0866162
2017/11/09 15:10:03 : Balance OMG: 0
2017/11/09 15:10:03 : On Orders OMG: 0
Processing strategy bbtssl for BTC-OMG on bittrex
2017/11/09 15:10:03 : Entering buy cycle
┌─────────────────── ┬───────────── ┬───────────────── ┬───────────────── ┬────────── ┬─────────── ┬───── ┬─────────┐
│ ɢ Ս Ɲ ß Ѻ Ŧ XT Edition │ LowBB │ HighBB │ Buy at │ Last │ BTC │ OMG │ Pair │
├─────────────────── ┼───────────── ┼───────────────── ┼───────────────── ┼────────── ┼─────────── ┼───── ┼─────────┤
│ Buy cycle │ 0.00114654 │ 0.00118541 │ 0.0011470135768 │ 0.001145 │ 1.0866162 │ 0 │ BTC-OMG │
├─────────────────── ┼───────────── ┼───────────────── ┼───────────────── ┼────────── ┼─────────── ┼───── ┼─────────┤
│ Callbacks │ Time to buy │ 0.0011470135768 │ BTC-OMG │ │ │ │ │
├─────────────────── ┼───────────── ┼───────────────── ┼───────────────── ┼────────── ┼───────────┴─────┴─────────┤
│ BOUGHT!!! │ Amount: │ 8.73362445 │ Rate: │ 0.001145 │ │
└─────────────────── ┴───────────── ┴───────────────── ┴───────────────── ┴────────── ┴───────────────────────────┘
the next cycle shows the stop loss range:
GBXT_v6.0.1 BTC-OMG Round # 129
------------------------------------------------------------------------------------------------
ɢ Ս Ҋ Ƀ õ Ŧ XT Edition Scanning bittrex for trading opportunities 2017/11/09 15:10:06
------------------------------------------------------------------------------------------------
2017/11/09 15:10:06 : BTC-OMG Last Bid/Ask 0.00114401/0.00114500
------------------------------------------------------------------------------------------------
EMA1: 0.00115938 === EMA2: 0.00115394
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
HIGH BB: 0.00118541 == SMA: 0.00116598 == LOW BB: 0.00114654
------------------------------------------------------------------------------------------------
2017/11/09 15:10:08 : Got Trading History
2017/11/09 15:10:08 : Checking Open Orders
------------------------------------------------------------------------------------------------
2017/11/09 15:10:08 : TrailingStop limit 0.00144126
------------------------------------------------------------------------------------------------
2017/11/09 15:10:08 : Last price 0.00114401 | Target to sell: 0.00115187
------------------------------------------------------------------------------------------------
2017/11/09 15:10:08 : StopLoss limit 0.00142407
------------------------------------------------------------------------------------------------
Price to sell is not in TSSL range
2017/11/09 15:10:08 : Price to buy: 0.00114701
2017/11/09 15:10:08 : Last Bid/Strategy Exit Point: 0.00114401/0.00144126
2017/11/09 15:10:08 : Last Ask/Strategy Entry Point: 0.00114500/0.00114701
No new opportunities found...
After the buy, the price of OMG went up slightly to 0.000115237, which should have triggered a sell on the 5 minute time frame based on the target sell price of 0.000115187 this strategy lists as its target. But it didn't. Instead, the price dropped from there and now sits at 0.000110110, well below the price range that should have triggered a sell order as configured by the TSSL strategy as its sell price range of 0.6.
I see no further evidence of any attempt to sell the coins at any time, but the log is long. If there is a specific phrase I should look for in the logs for the new version I'd be happy to dig through them for more info that might be helpful.
I'll continue testing TSSL to see if it actually does trigger any stop loss orders, and will disable the sell order timeout for this strategy until its proper functionality can be verified in order to collect more data.
Regards,
T.J.
EDIT:
On further examination, I realize that its actually a worse situation than I first thought, because this code has apparently set the stop loss value ABOVE what the buy price is. That makes no sense at all, so hopefully its just a bug that will be fixed. If you're going to set a stop loss above your buy price, you might as well not even have one. It's like the code is done in a way that expects the price to go up after you buy, which often isn't the case. The stop loss limits should be set based on the actual buy price to start with, and then move up based on the price as it changes, rather than assuming that the market will move in your favor.
I looked at the log files, and I can tell that the bot made the buy at log entry #128, and after that the coins never sold, even though the target sell price listed in the next log entry was hit within 10 minutes and then the stop loss limit was hit within a few candles after that. There were no attempts to sell them that I can find in the logs, but I may need to be searching for a particular phrase that I'm missing to see if an order was sent, but timed out since the default timeout is 600 seconds which would erase the record on bittrex of the transaction attempt, leaving the only evidence that of the bot's very long log file.
If anyone has any tips for how I can resolve this I'd be grateful.
LOG ENTRIES:
GBXT_v6.0.1 BTC-OMG Round # 128
------------------------------------------------------------------------------------------------
ɢ Ս Ñ ß ø Ł XT Edition Scanning bittrex for trading opportunities 2017/11/09 15:10:01
------------------------------------------------------------------------------------------------
2017/11/09 15:10:01 : BTC-OMG Last Bid/Ask 0.00114309/0.00114500
------------------------------------------------------------------------------------------------
EMA1: 0.00115938 === EMA2: 0.00115394
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
HIGH BB: 0.00118541 == SMA: 0.00116598 == LOW BB: 0.00114654
------------------------------------------------------------------------------------------------
2017/11/09 15:10:03 : Got Trading History
2017/11/09 15:10:03 : Checking Open Orders
------------------------------------------------------------------------------------------------
2017/11/09 15:10:03 : TrailingStop limit 0.00144126
------------------------------------------------------------------------------------------------
2017/11/09 15:10:03 : Last price 0.00114309 | Target to sell: 0.00144126
------------------------------------------------------------------------------------------------
2017/11/09 15:10:03 : StopLoss limit 0.00142407
------------------------------------------------------------------------------------------------
Price to sell is not in TSSL range
2017/11/09 15:10:03 : Price to buy: 0.00114701
2017/11/09 15:10:03 : Last Bid/Strategy Exit Point: 0.00114309/0.00144126
2017/11/09 15:10:03 : Last Ask/Strategy Entry Point: 0.00114500/0.00114701
2017/11/09 15:10:03 : There are some trading opportunities for BTC-OMG at bittrex . Scanning Trade History
ɢ Ʊ ŋ ß Ѻ Ŧ XT Edition Tips&Tricks: BTC-OMG can be bought!!!
2017/11/09 15:10:03 : Last Bid price BTC-OMG: 0.00114309 | Last Ask: 0.001145
2017/11/09 15:10:03 : Balance BTC: 1.0866162
2017/11/09 15:10:03 : Balance OMG: 0
2017/11/09 15:10:03 : On Orders OMG: 0
Processing strategy bbtssl for BTC-OMG on bittrex
2017/11/09 15:10:03 : Entering buy cycle
┌─────────────────── ┬───────────── ┬───────────────── ┬───────────────── ┬────────── ┬─────────── ┬───── ┬─────────┐
│ ɢ Ս Ɲ ß Ѻ Ŧ XT Edition │ LowBB │ HighBB │ Buy at │ Last │ BTC │ OMG │ Pair │
├─────────────────── ┼───────────── ┼───────────────── ┼───────────────── ┼────────── ┼─────────── ┼───── ┼─────────┤
│ Buy cycle │ 0.00114654 │ 0.00118541 │ 0.0011470135768 │ 0.001145 │ 1.0866162 │ 0 │ BTC-OMG │
├─────────────────── ┼───────────── ┼───────────────── ┼───────────────── ┼────────── ┼─────────── ┼───── ┼─────────┤
│ Callbacks │ Time to buy │ 0.0011470135768 │ BTC-OMG │ │ │ │ │
├─────────────────── ┼───────────── ┼───────────────── ┼───────────────── ┼────────── ┼───────────┴─────┴─────────┤
│ BOUGHT!!! │ Amount: │ 8.73362445 │ Rate: │ 0.001145 │ │
└─────────────────── ┴───────────── ┴───────────────── ┴───────────────── ┴────────── ┴───────────────────────────┘
the next cycle shows the stop loss range:
GBXT_v6.0.1 BTC-OMG Round # 129
------------------------------------------------------------------------------------------------
ɢ Ս Ҋ Ƀ õ Ŧ XT Edition Scanning bittrex for trading opportunities 2017/11/09 15:10:06
------------------------------------------------------------------------------------------------
2017/11/09 15:10:06 : BTC-OMG Last Bid/Ask 0.00114401/0.00114500
------------------------------------------------------------------------------------------------
EMA1: 0.00115938 === EMA2: 0.00115394
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
HIGH BB: 0.00118541 == SMA: 0.00116598 == LOW BB: 0.00114654
------------------------------------------------------------------------------------------------
2017/11/09 15:10:08 : Got Trading History
2017/11/09 15:10:08 : Checking Open Orders
------------------------------------------------------------------------------------------------
2017/11/09 15:10:08 : TrailingStop limit 0.00144126
------------------------------------------------------------------------------------------------
2017/11/09 15:10:08 : Last price 0.00114401 | Target to sell: 0.00115187
------------------------------------------------------------------------------------------------
2017/11/09 15:10:08 : StopLoss limit 0.00142407
------------------------------------------------------------------------------------------------
Price to sell is not in TSSL range
2017/11/09 15:10:08 : Price to buy: 0.00114701
2017/11/09 15:10:08 : Last Bid/Strategy Exit Point: 0.00114401/0.00144126
2017/11/09 15:10:08 : Last Ask/Strategy Entry Point: 0.00114500/0.00114701
No new opportunities found...
After the buy, the price of OMG went up slightly to 0.000115237, which should have triggered a sell on the 5 minute time frame based on the target sell price of 0.000115187 this strategy lists as its target. But it didn't. Instead, the price dropped from there and now sits at 0.000110110, well below the price range that should have triggered a sell order as configured by the TSSL strategy as its sell price range of 0.6.
I see no further evidence of any attempt to sell the coins at any time, but the log is long. If there is a specific phrase I should look for in the logs for the new version I'd be happy to dig through them for more info that might be helpful.
I'll continue testing TSSL to see if it actually does trigger any stop loss orders, and will disable the sell order timeout for this strategy until its proper functionality can be verified in order to collect more data.
Regards,
T.J.
EDIT:
On further examination, I realize that its actually a worse situation than I first thought, because this code has apparently set the stop loss value ABOVE what the buy price is. That makes no sense at all, so hopefully its just a bug that will be fixed. If you're going to set a stop loss above your buy price, you might as well not even have one. It's like the code is done in a way that expects the price to go up after you buy, which often isn't the case. The stop loss limits should be set based on the actual buy price to start with, and then move up based on the price as it changes, rather than assuming that the market will move in your favor.