-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom Strategy Based on My existing TV indicator #451
Comments
For Example :- #Strategy Definition
strategy = [
{"kind":"sma"},
{"kind":"bbands"},
{"kind":"macd"},
{"kind":"rsi"},
{"kind":"supertrend"},
{"kind":"mfi"}
] When defining a strategy like this we can pass in multiple inbuilt indicators. I want to pass in my own function which has custom logic to generate the buy/sell signals. #Strategy Definition
strategy = [
{"custom_function": customFunction()}
] something like this. |
Hello @idristarwala,
Thank you. I appreciate it!
That's how I started out as well. I have ported a few indicators from TV into Pandas TA also.
Excellent!
I assume you are referring to the example Watchlist Class as shown in the Pandas TA Strategy Examples Notebook. In order to use your custom_function(), you will first need to create it and hook it up to the DataFrame Extension Class #Strategy Definition
strategy = [
{"custom_function": customFunction()}
] Then you should be able to load the strategy into the watchlist and run like so (Pandas TA Strategy Examples Notebook. Note: Since you are running one indicator, custom_function(), through Hope this helps! Let me know otherwise. Apologies for the delayed response. Kind Regards, |
@twopirllc thanks for your detailed response. I will try this out on the weekend. |
Hello @idristarwala, I assume by no response that the solution provided was sufficient. Thus I will be closing this issue in a few days. Kind Regards, |
Hi,
First of all thanks for creating a great library, this is a game changer.
I have been predominantly using Trading View, I have build many indicators on TV and use them in my daily trading. You can consider them proprietary Algo which are combination of use of basic building blocks all of which are already present in pandas-ta lib.
So my indicator uses a combination of Previous Day High/Low values, Premarket High/low values, EMAs, candle colors , volume pressure, ADR/ATR , curve , pivot points etc.
In a combination, which then results in a buy/sell signal along with take profit and exit signals
I have also been able to create most of it in my Python code using this lib as individual columns in the DF.
What I don't understand is how to now transfer this price of logic into Strategy Class to take advantage of the watch function etc.
Is there an example where I can pass in a function which creates a result column in the DF ?
Regards,
Idris
The text was updated successfully, but these errors were encountered: