| Coding Forum Collaborate, receive help, or discuss coding related issues. |
![]() | | Tweet | |
| | #1 | ||
![]() | Recoding TS Indicators to Make Them More Efficient? https://www.tradestation.com/Discuss...Topic_ID=81245 Anyway, I was wondering if anyone who knows easylanguage and tradestation knows: 1) whether this is possible? 2) how you'd know if your new code was more efficient? 3) whether it would be worth the time and effort? Here's a quote from the thread that gets to the heart of the matter: ----------------------------------------------------------------------- "First thing is make sure your code is running efficiently. Clean up the code, make it efficient. And either use STO or something similar. STO reduces the # of calcs by as much as 90%. I have one indicator that I only update once per second. Another thing I do is to consolidate indicators/paintbars/everything running realtime into one indicator. You have to look at it from the perspective of reducing the # of instructions being sent to the cpu. Every if statement matters. Further still, arrange your code so you don't keep repeating the same calc when nothing will change. For example, there is no need to keep repeating the lookback calcs over and over in stochastics. Do it once then modify the result if the current bar changes. It is worth noting also that many "stock" TS indicators are built for convenience, not speed. I don't use userfunctions in realtime indicators. And sure as heck would never use one of those multi-ouput 3-4 layer of userfunction things. Make your own to do only what you need. Look at the TS function highest. Dig through all the layers to get to the real meat of it. In comparison, all you actually need is 4-5 lines of code. " ------------------------------------------------------------------------ So, my dear Traders Labmates, does this make sense? And is there anybody out there in TL-land that can do this (for a fee, of course)? | ||
| |
|
| | #2 | ||
![]() | Re: Recoding TS Indicators to Make Them More Efficient? Quote:
Quote:
| ||
| |
|
| | #3 | ||
![]() | Re: Recoding TS Indicators to Make Them More Efficient? | ||
| |
|
| | #4 | ||
![]() | Re: Recoding TS Indicators to Make Them More Efficient? How do you know if an indicator is updating on every tick? I can't tell myself by looking at the code. Is there some way to tell the indicator only to update if the value changes, rather than every tick whether the value changes or not? | ||
| |
|
| | #5 | ||
![]() | Re: Recoding TS Indicators to Make Them More Efficient? Quote:
I've sent you an email about it, but I'll quickly explain it here for anyone else reading this. Format the indicator and select the "Advanced tab", then select the "On" rather than "Auto Detect"..... but there is a bug within TS 8.3 build 1631 so this feaute won't work unless you get the fix via request from TS. ![]() Hope this helps Blu-Ray
__________________ “ Search is the ultimate expression of the power of the individual, using a computer, looking at the world, and finding exactly what they want ” – Eric Schmidt, Google | ||
| |
|
| | #6 | ||
![]() | Re: Recoding TS Indicators to Make Them More Efficient? Quote:
For example the common way to do a 10 period simple moving average is in a loop adding each of the 10 closes and then dividing by 10. The efficient way is to add 1/10th of the new close and subtract 1/10th of the close 10 bars ago. There are many examples of this sort of optimisation that will yield significant speed improvements. | ||
| |
|
| | #7 | ||
![]() | Re: Recoding TS Indicators to Make Them More Efficient? Quote:
| ||
| |
|
| | #8 | ||
![]() | Re: Recoding TS Indicators to Make Them More Efficient? Quote:
Just for clarification, are you suggesting that the "On" versus "Auto Detect" option should be used as the default setting only if the indicator has been optimized or regardless if it has been optimized or not? Thanks | ||
| |
|
![]() |
| Thread Tools | |
| Display Modes | Help Others By Rating This Thread |
| |
| ∧ Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Dollar Getting Ready to Make a Big Leg Down | downrivertrader | Market Analysis | 17 | 08-08-2008 09:07 PM |
| Make sure to give the CL (Crude Oil) Contract Consideration! | brownsfan019 | Futures Trading Laboratory | 11 | 12-06-2007 11:40 PM |
| How You Make Money Trading Forex | keegan99k9 | Forex Trading Laboratory | 14 | 07-12-2007 11:08 AM |
| How Can We Make The Site Better? | Soultrader | General Discussion | 37 | 02-04-2007 06:07 PM |
| How Many Trades Do You Make A Day? | Soultrader | Beginners Forum | 13 | 01-16-2007 06:48 PM |