Skip to content
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.

Neural Strategy Trade Signals Possibly Inverted #957

Open
sahaka opened this issue Dec 21, 2017 · 17 comments
Open

Neural Strategy Trade Signals Possibly Inverted #957

sahaka opened this issue Dec 21, 2017 · 17 comments

Comments

@sahaka
Copy link

sahaka commented Dec 21, 2017

System information

  • Have I written custom code (as opposed to using zenbot vanilla): No
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Centos 7
  • Zenbot version: 4.0.5
  • NodeJS version: v8.9.3
  • Python version: Python 2.7.5
  • Exact command to reproduce: n/a

Describe the problem

The description for the Neural Strategy is "Buy = mean(last 3 real prices) < mean(current & last prediction)" I understand this to be that if the real mean is 5 and the predicted mean is 10 then it should buy because the price is low now and predicted to go up. But the code for the strat seems to do the opposite.

Line 91 of the strategy code says that global.sig0 is true if the predicted mean is less than the current mean. If true then buy, if false then sell... In my example above the real mean is 5 and the predicted mean is 10 so this code would actually trigger a sell signal.

It seems that it needs to be changed to read "global.sig0 = global.meanp > global.mean". Running this in the sim does not yield the expected results and I am not sure why, but the basic logic behind what I am saying seems sound.

Am I missing something obvious? or is the code backwards?

Source code / logs

Lines 90-104 of zenbot/extensions/strategies/neural/strategy.js

//something strange is going on here
        global.sig0 = global.meanp < global.mean
        if (
           global.sig0 === false
           )
           {
            s.signal = 'sell'
           }
        else if
           (
           global.sig0 === true
           )
           {
           s.signal = 'buy'
           }
@MrSiNiSt3R
Copy link

Tested STDDEV with reversed b/s signals = 3.57% profit, maybe all the b/s signals need to be reversed?

@luponata
Copy link

i tested the STDDEV strategy with standard signals with some profit too :/

@MrSiNiSt3R
Copy link

MrSiNiSt3R commented Dec 26, 2017

lets test longer, and coincidence doesn't exist, someone told me this before, i thought the guy was joking

@luponata
Copy link

luponata commented Dec 27, 2017

atm i get a javascript heap OOM error

but 2 days ago i tested with a lot of simulations, all with profit (with STDDEV and Neural) (+14 days)

this isn't the first time that someone complains about this problem

@tiagosiebler
Copy link
Contributor

what about live trades? Anyone trying that? Profit in sims don't guarantee live profit, and that's where it counts!

@luponata
Copy link

simulation doesn't guarante profit because you are not waiting someone to fill your order (like in real trading)

but at least you must have the right (buy and sell) signals

@sahaka
Copy link
Author

sahaka commented Dec 27, 2017

Try these settings in sim: zenbot sim gdax.BTC-USD --strategy neural --buy_pct 99 --sell_pct 99 --markup_sell_pct 0.33 --markdown_buy_pct 0.33 --period 8s --max_sell_loss_pct 10 --sell_stop_pct 20 --buy_stop_pct 20 --neurons_1 100 --depth 4 --min_periods 200 --min_predict 20 --learns 200 --profit_stop_enable_pct 50 --profit_stop_percent 50 --max_slippage_pct 5 --poll_trades 6000 --order_poll_time 3000 --order_adjust_time 3000 --rsi_periods 14

@sahaka
Copy link
Author

sahaka commented Dec 27, 2017

With the change I can't get profits in sim easily, but in live it seems to be buying low and selling high more often than not.

@Fredrik81
Copy link

Are you using the settings above for the live trading with reverse strat?

@DeviaVir DeviaVir reopened this Dec 28, 2017
@sahaka
Copy link
Author

sahaka commented Dec 28, 2017

yes

@Fredrik81
Copy link

@luponata
What was the results of your extensive tests with neural and stdev, care to share your results? i'm very interested.
Did you reverse signals on any of the tests?

@luponata
Copy link

Still testing, i'll update you, in 2 days (too busy now)

happy new year!

@sahaka
Copy link
Author

sahaka commented Jan 7, 2018

@luponata Did you get a chance to run any tests?

@okonon
Copy link

okonon commented Jan 19, 2018

@luponata curious if you had a chance to run those tests?

@Primea1
Copy link

Primea1 commented Mar 5, 2018

@luponata Do you have the results from your testing?

@Primea1
Copy link

Primea1 commented Apr 8, 2020

Dem test tho...

@Stoner19
Copy link

Also curious about this and if there has been any updates to the code? Seems --reverse flag might be trigger needed to actually make this strategy work?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

9 participants