Help with GetSymbol() Function


Category:
0
0

Hi Peter, I have a dynamic watchlist that is not producing results for Futures. My dynamic watchlist has the following conditions:

  • 1,000 or greater in volume
  • 4 consecutive green candles on 15 minute timeframe with ext hours
  • Higher highs
  • Higher lows
  • Only show results for the follow Futures tickers: 
    • /CL:XNYM
    • /ES:XCME
    • /NQ:XCME
    • /SI:XCEC
    • /UB:XCBT
    • /ZS:XCBT

Please know there is no price range set due to the complex nature of Futures.

Due to the character limitation of this form, I have attached the code and  backtesting text file for your review.

Attachments:
Marked as spam
Posted by (Questions: 7, Answers: 13)
Asked on October 1, 2020 5:00 pm
292 views
0
Private answer

I think you have done a through job of testing this and you should report this to TD Ameritrade support as a potential bug.

I rarely find a need to use GetSymbol() in any of my code so I have never run across this myself. Given the available details you have shared I believe my approach would have been to avoid using the GetSymbol() function altogether and apply a top level filter to the scan sourced on a personal watchlist I created with only those tickers symbols I wanted the scan to include. But I like to use shortcuts whenever possible. Also, the scan would run much more efficiently.

Top level filters are demonstrated in the following video during the section on how to improve the performance of scans on Thinkorswim:

https://www.hahn-tech.com/thinkorswim-scans-beginner-to-advanced/

 

 

 

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on October 1, 2020 6:42 pm
0
Thanks Pete for looking into this. I did report this to TD Ameritrade. There is an issue using top level filters. With Futures contracts, say for example /CL (Light Sweet Crude Oil), there can be multiple contracts based on the month of expiration. So if I wanted to use a top level filter, I will have to enter in the tickers into my watchlist like so. /CLV20 /CLX20 /CLZ20 ...and so on This is inefficient and tedious as contracts come close to expiration.
( at October 4, 2020 11:55 am)
0
I see, yes. There was a similar "bug" that prevented this inclusion of index symbols (which begin with a "$" sign). I hope they get this corrected soon and thanks for taking the time to provide this update.
( at October 4, 2020 2:31 pm)