Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Using strategies with Live Trading #427

malakeel started this conversation in Ideas
Discussion options

I am wondering if someone already came with a way to run those strategies on live trading. I am running the back testing, and it looks fine to me. For example, when new data (candlestick) is available, it would nice to run some function to produce trade signal.
Using self.I(function_name ..), is time saver to avoid calculating indicators again.

If this possible, please share your knowledge. If not, what alternative could be available to use the strategies with minimal modifications.

Thank you

You must be logged in to vote

Replies: 4 comments

Comment options

Similar use case, but not for actual live trading with various brokers, it would be nice to be able to update a given strategy as new market data becomes available. In order to continually evaluate a strategy's performance and behavior. basically paper trading the strategies but updating the entire object. Rather than rebuilding the entire backtest or trying to figure out how to append two different time periods.

Example, suppose I have multiple (10-20 strategies) that I would like continually update as new market data comes in. I would like to save to our database each evening, or hour, or whatever period, the most up to date _equity_curve _trades and other relevant stats. Rather than re-run the historical backtest, is there a way to save the state then when new data becomes available ingest that new data without re-running the entire backtest? @kernc

You must be logged in to vote
0 replies
Comment options

FWIW there is an open issue which may provide more info #81

You must be logged in to vote
0 replies
Comment options

Working on a similar project TM️ . Quite entertaining attempting to implement the various features together. I will say that the project grows quite quickly ⏫ , once attempting to account for all the possibilities encountered during live trading. i.e. check for existing balance of token 💲 , check to make sure that prior orders have posted (critical if using 'limit' orders), deciding which statistics are valuable enough to display 〽️ , and which would just be adding to the confusion? !?️ In the near future, I will upload the files, but its all a bit piecemeal at this point, need to tie up some lose ends, and clean up a lot of the code first, in order to make it usable by others.

You must be logged in to vote
0 replies
Comment options

I am wondering if someone already came with a way to run those strategies on live trading

I have scheduled to run backtests every day and extract the last day result together with stats. If trading signal is detected, the system sends the notification.

See the function run_backtest_for_ticker here - https://github.com/s-kust/python-backtesting-template/blob/main/strategy/run_backtest_for_ticker.py - and note that it returns last_day_result.

See also the stub of the process_last_day_res function here - https://github.com/s-kust/python-backtesting-template/blob/main/utils/strategy_exec/last_day.py

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /