Best practices when creating a strategy

keithmj

New member
I have a few indicators, of which I'm using their calculations to create a strategy. I'm wondering which of these is the most efficient approach.

1) I can copy the code from each indicator and mash them all into one strategy. Once done, I could remove the individual indicators from my study set since they are all now in the strategy.

2) I can copy just the calculations from the indicators and mash all those together. I'd change all my "plot" to "def" and remove all the formatting. In this case I'd need to leave the individual studies in the set.

If I go with door #1 then changing the user options will affect the study and the strategy. If I go with door #2, I'd have to change user options in both places, yet the system might run faster?

I currently have door #1, but the more I add the more the system seems to bog down. Which approach do you guys take?

Thanks!
 
Solution
different people may have different experiences and advice. here is mine.

1 and 2.
copy entire TD study code into my code.
if a plot variable will be used in other formulas, i change it to def. comment out original lines. don't delete anything until a couple versions later. might need something. easier to remove a #, than to type out plot code lines.

i try not to use plot variables in other formulas, because i might disable the plot. add yes/no inputs and new plot formulas to control what is plotted.

someone can check this, but i have thought that,
try to limit the quantity of formulas that have to read data external of the study. which means to copy the study code into yours and not just reference the study name in formulas...
different people may have different experiences and advice. here is mine.

1 and 2.
copy entire TD study code into my code.
if a plot variable will be used in other formulas, i change it to def. comment out original lines. don't delete anything until a couple versions later. might need something. easier to remove a #, than to type out plot code lines.

i try not to use plot variables in other formulas, because i might disable the plot. add yes/no inputs and new plot formulas to control what is plotted.

someone can check this, but i have thought that,
try to limit the quantity of formulas that have to read data external of the study. which means to copy the study code into yours and not just reference the study name in formulas.
instead of having close used 20 times, set a new variable to close , then reference that new variable.
def c = close;
close has to read data from a source external to the study.

i would think 2 would bog down tos, as there are 2 copies of the studies , reading data and doing the same calculations.
but on the other hand, when i add many bubbles, it tends to delay when chart objects are drawn. so try to limit how many things are drawn on a chart.

experiment with different ways of doing something and see what works for your project.
 
Solution

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
385 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top