5ymph0en1x/SyBrain

Very good performance, except it is backwards

Opened this issue · 2 comments

SyBrain now happily runs and trades, but it loses money with basically every trade. This is terrible, except it is so consistent that if you reverse the logic it would be making quite a good profit.

Could you release a version with reversed trading logic?

@vmajor
If you simply swap the if conditions, then it will be reverse trading logic. Here the swapped one

print("Sell Side: %s - Buy Side: %s" % (str(obk_sell_cum), str(obk_buy_cum)))

if direction == 0 and obk_sell_cum > obk_buy_cum * 10:
print("Go Buy !")
return obk[0]['bids'][1][0]
if direction == 1 and obk_buy_cum > obk_sell_cum * 10:
print("Go Sell !")
return obk[0]['asks'][1][0]

I would do something like that :

               `if fP_var_value_av > 0 and fairPrice_var_actual > fP_var_value_av * 2 and p_verdict > 0:
                    sell_departure = check_order_book(0)
                    if sell_departure != 0:
                        results = fire_sell(sell_departure)
                        if results == 0:
                            print("Resetting...")
                        else:
                            print("Total Balance:", str(results))
                        if results != 0:
                            pos_taken += 1
                        tick_ok = False
                        tick_count = 0
                if fP_var_value_av < 0 and fairPrice_var_actual < fP_var_value_av * 2 and p_verdict < 0:
                    buy_departure = check_order_book(1)
                    if buy_departure != 0:
                        results = fire_buy(buy_departure)`