jesse-ai / example-strategies

Example trading strategies to get you started with Jesse
https://jesse.trade/
MIT License
161 stars 61 forks source link

add SMACrossover strategy #1

Closed fengkiej closed 4 years ago

fengkiej commented 4 years ago

This strategy can be considered as Hello World in world of algorithmic trading, it may help new user to familiarize themselves to Jesse structure and syntax.

saleh-old commented 4 years ago

Hey. This strategy is good. I have a suggestion to make it more beginner friendly:

instead of:

sma(self.candles, self.vars["slow_sma_period"], "close")

write it as:

sma(self.candles, 200)
saleh-old commented 4 years ago

Also instead of from jesse.indicators import sma, write import jesse.indicators as ta and then use it as ta.sma. Of course you way is correct, but this way is the default import when generating strategy files, and I think beginners might get confused by it.

fengkiej commented 4 years ago

@saleh-mir thank you! I has been updated your suggestions

saleh-old commented 4 years ago

Thank you. One more thing, could you please not use should_long /should_short inside update_position? In this case It works just fine, but I want to keep should_long /should_short known as the entry method only.

I've found it causing issues in certain strategies.

Sorry I didn't see it before

fengkiej commented 4 years ago

@saleh-mir changes updated 👍

saleh-old commented 4 years ago

Thank you so much