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

Update default_logic.js #106

Closed
wants to merge 1 commit into from

Conversation

alternativesurfer
Copy link

@alternativesurfer alternativesurfer commented Jan 23, 2017

Reversing RSI Buy / Sell logic to correctly Buy when RSI drops below lower indicator, and Sell when it rises above upper indicator.
Per Issue: #102

Reversing RSI Buy / Sell logic to correctly Buy when RSI drops below lower indicator, and Sell when it rises above upper indicator.
@danvctr
Copy link

danvctr commented Jan 24, 2017

+1

@cbassols
Copy link

I'm getting this error using ./zenbot sim in your version of default_logic.js

/zenbot/node_modules/numbro/numbro.js:1111
        var parts = x.toString().split('.');
                     ^

TypeError: Cannot read property 'toString' of undefined
    at multiplier (/zenbot/node_modules/numbro/numbro.js:1111:22)
    at /zenbot/node_modules/numbro/numbro.js:1127:22
    at Array.reduce (native)
    at correctionFactor (/zenbot/node_modules/numbro/numbro.js:1125:21)
    at Numbro.subtract (/zenbot/node_modules/numbro/numbro.js:1207:47)
    at first_run (/zenbot/default_logic_v2.js:441:169)
    at Immediate.doNext (/zenbot/node_modules/zenbrain/utils/apply_funcs.js:10:12)
    at runCallback (timers.js:651:20)
    at tryOnImmediate (timers.js:624:5)
    at processImmediate [as _immediateCallback] (timers.js:596:5)

@alternativesurfer
Copy link
Author

alternativesurfer commented Jan 31, 2017 via email

@jangrewe
Copy link

For a stop-loss protection, the current way of selling when it starts to go down is a pretty good idea.

@l0rdh3lix
Copy link

RSI indicates when something is undersold or oversold. When oversold (low RSI), it means the price has momentum to continue upwards. If it's overbought (high RSI) then the price has momentum to move downwards. It does look like default_logic.js has the bot doing the exact opposite.

@Biletnikoff
Copy link

Biletnikoff commented May 18, 2017

it's definitely related to the file. Swapping trend Lines 354 and 357 fixed the issue.

Line 354 trend = 'DOWN'
Line 357 trend = 'UP'

@carlos8f
Copy link
Contributor

Hi, sorry I was away from Zenbot for so long and never merged this. I've been working on Zenbot 4 and just tagged the release last night. The RSI being backwards was a quirk I was aware of, but since the simulations were better that way, I went with it. 4.x is now using an EMA-based approach. Closing this PR since 3.x won't be supported anymore. Thanks for using Zenbot!

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

Successfully merging this pull request may close these issues.

7 participants