Programming your Trading Ideas in TradersStudio and TradeStation

Discussion in 'Trading Software' started by Murray Ruggiero, Dec 3, 2008.

Does having to program stop you from backtesting your ideas.

  1. Never tried programming a system, too afraid.

    9 vote(s)
  2. Tried before and gave up and will not try again.

    2 vote(s)
  3. Have tried and done simple things, but can't really program useful ideas

    10 vote(s)
  4. I am a system programming wizard.

    19 vote(s)
  1. Murray Ruggiero

    Murray Ruggiero ET Sponsor

    I have had a lot of people interested in TradersStudio recently who have never programmed and this was their main concern in buying the product. I thought I would start this thread to help people get a handle on basic programming concepts.

    TradersStudio and TradeStation both use the concept that code is written to execute on one bar at a time. Past values are stored in variables, where you can access what value that variable had on different past bars.

    The structure of both EasyLanguage and TradersStudio Basic are similar which is why we can translate EasyLanguage.

    I am sure this thread will be a value to both groups of users.
  2. Murray, I think you need another category in your poll. For myself, I'm certainly not a system programming wizard, and yet, I've done some programming and gotten some good systems out of it. So some middle ground seems necessary.

    The biggest problem I have is not really a programming problem - it is how to visualize an answer to an idea.

    So here's an example:

    "To get around questions related to inflation we looked at the price
    of the 25th cheapest stock in the S&P 500 (5th percentile). Since
    1972, when the price of the 25th cheapest stock is below $6 the market
    has a GPA of 23%. When the price of the 25th cheapest stock is between
    $6 and $16 the market has gained 5%. Finally, the S&P 500 has gained
    1% when the price of the 25th cheapest stock is above $16."

    I can't really "visualize" how I would do this in Tradersstudio (or any other program). I don't view this as an issue for TS - it's my issue - but it shows a general problem.
  3. Tums


    It is good news to know TraderStudio can translate EasyLanguage.
    There are thousands of indicators/strategies available on the web... no need to reinvent the wheel !

    How many indicators in the thread EasyLanguage Treasure Chest can be use in TraderStudio unaltered?

    Open E Cry claims to read EasyLanguage codes, but they have problem with some of the advanced keywords.

    Can you post one or two screen shots to demonstrate the compatibility?
  4. Murray Ruggiero

    Murray Ruggiero ET Sponsor

    If you remember high school algerba as well as early math many people had problems understand how to do word problems. Understand how to break a system idea down, is really just a word problem. I will post about your exact question within the next day or so. I just wanted to make the comment about the link between math word problems and developing trading solutions.
  5. Agreed Murray - and I was never that good at word problems either! I'm more of a visual learner.

    There is, of course, an additional issue which is figuring out how you would do something, then matching what you want to do to the programming tool. Some things that might be easy in one program are challenging in others just based on what functions and data structures are available.

    Anyway - I think it's a useful thread.
  6. Murray is correct in saying "look at programming problems as 'word problems' ".

    Droskill is also correct in saying visualizing the problem leads to good solutions.

    I find that Excel is the best tool for quick testing/programming.

    You can "visualize" your problem and its solution in a spreadsheet. Excel also has the added benefit, that coding is extremely simple and it provides a way to manually "massage' the numbers which is an invaluable exercise. Finally, Excel is the best way to discover (a) if there are bugs in the trading software....a very common problem with trading software and (b) confirm that your coding is actually doing what you visualized it to do; this too is very common, where you code the answer to word problem ABC, whereas your word problem was actually, word problem XYZ.

    Another benefit of Excel is that it has a wonderful inbuilt Help tool with great documentation and examples...much much better than what you will find with trading software. also there's an abundance of free help/tools/resources form the online community since Excel has a much larger userbase.

    In sum, I suggest first building EVERY system (at least the basic logical rules/constructs) in Excel then port that over to the trading software. When I refer to Excel I refer to just working with Excel's in-built formulas. via the spreadsheet interface..there is no need for using Excel VBA. Once your Excel spreadsheet is set up and make sense, transferring it to the software should be fairly easy. It will just be a matter of converting your logical statements in Excel cells to the format/syntax of the software. You can then use both tools interchangeably to confirm each other and debug.

    For example, I had a recent trade idea.... conceptually it was easy to visualize it. working by hand I could quickly generate inputs/outputs...but despite my long term experience with trading software... I couldn't easily think of how to code it in the platform. So I returned to my old reliable friend - was a breeze setting it up in Excel and plus Excel even makes it easy to add on/modify your initial trade idea - "visualize" weaknesses in your logic and how to improve your logic. Now I have a working system in Excel...working in that the logical rules/conditions are set. I now want to port it to the trading software so I can perform a historical backtest. I have been pondering all morning how to do this - because there are things hat are so natural to Excel that trading platforms don't have or do in an odd way. I find that I've spent quite some time trying to determine how to port it over....but at least now I can' see how to port it over - I just need to determine matching functions in the trading software for the Excel functions. Note that before coding it in Excel , I couldn't even visualize how to start coding this system.

    I can't recommend Excel strongly enough. It's my key R & D tool.

    Where Excel fails is handling large data sets and portfolio historical backtesting. It's possible but quite intensive. If Excel wasn't deficient in that area I wouldn't even use any of the trading software packages. Yes Excel may be limited in having trading specific data functions..but that's an easy problem. The folks at MS could easily make Excel versions of the common TradeStation trading functions. Actually the more I think of it, there probably is a business idea here in making a Trading version of Excel for system development that would eliminate the need for mastering any trading language in a simple nice GUI platform. Mechanica supposedly uses a spreadsheet type interface (with references to rows/columns)....and I think in that regard it might actually be an easier platform to code in and visualize solutions/problems.
  7. Agreed on Excel - it's an excellent tool for figuring stuff out. I've tried out AnalyzerXL as well - didn't love it but it's certainly interesting.

    Where Excel falls down for me is just in the handling of data. The problem is likely that I don't know Excel well enough, but having dynamic arrays of data would be very helpful.
  8. Excel has super in-built array handling via the row/column cells; far better than most trading analysis platforms.

    Again, Excel's weakness is in handling the historical backtesting
  9. Sorry should have been more specific - what I find challenging is the idea of getting data into the program on a regular basis. I can do one-off tests no problem, but if I want to have, say, the data for the SPY sucked into Excel every day and have my spreadsheet update correctly, I end up doing a ton of manual work. While on the other hand, once I've got a system built in Tradersstudio, I can just run it again.
  10. Murray Ruggiero

    Murray Ruggiero ET Sponsor

    How do you calculate GPA ?. You need to define the word problem clearer.
    #10     Dec 4, 2008