Tuesday, January 06, 2009     | Register
TradersStudio Forums
Subject: Building Custom Indicators

You are not authorized to post a reply.   
Author Messages
dbuffalo@charter.net
Posts:4

06-30-2006 11:24 AM Alert 

To Murray and the Forum:

I am getting my feet wet in programming TradersStudio 2.0, and I am trying to build a custom indicator that is built from standard technical indictors (RSI, moving averages, and momentum). In building one custom indicator, I get to the point of storing the custom indicator (which is built as an indicator function) and I continue to get the error message "Variable ____ is a reserved keyword". That blank could be filled with RSI, Close, momentum, etc. I made certain that in the syntax of the variables that I did not include the names of the indicators (to prevent the editor from misreading the code), but I can't seem to get rid of it.

Can you help me with what I am doing wrong (and perhaps steer me to the part of the manual that covers such errors)?

Thank you again for your help and for providing this forum.

DBB

 

murray
Posts:435

06-30-2006 3:38 PM Alert 

Read Chapter 8-9 in the TradersStudio basic book. Also Please open up the editor and view the code I have included. Open up Indicator Plot type functions. You need to create your indicatorplots as IndicatorPlot functions. If you have a plot statement in a system for example you will get a error message.

 

dbuffalo@charter.net
Posts:4

07-04-2006 7:47 PM Alert 

I guess the big question is, if one cannot include indicator plots with currently existing indicators, how can one build custom indicators that include such things as RSI? I could send you a copy of the code, but I would rather keep this part of what I do to myself (as it is proprietary to me at any rate, not that its all that special but it is effective).

I attempted to follow the code in Chapter 8 and used an indicator plot and new variables to define sums of indicators, but I still get the same error message. Does that mean I will have to write out all the formulas for common indicators in the code and start from ground zero (as if no common indicators were included in TradersStudio) in the indicator plots?

I am sorry to have to ask these questions, but I use a program (without the superior statistics package that TradersStudio has) that already has the common indicators included in the code. I think if I can get through one example, I can figure the rest out.

Thanks again for your help.

 

 

murray
Posts:435

07-04-2006 11:13 PM Alert 

You can use any indicator code which you can call from a system

Sub MyRSI(SLen)

Plot1(RSI(Close,SLen,0))

End Sub

This will plot RSI. If you  do the following

Sub MyRSI(SLen)

Plot1(RSI(Input1,SLen,0))

End Sub

Then the custom indicators will let you select the series for RSI as a input to the indicator for example you now can take a RSI of MACD or RSI on a independent data series, or RSI of volumen.

 

 

dbuffalo@charter.net
Posts:4

07-05-2006 9:19 PM Alert 
Murray, thanks. I will take a look at that example and work with it. So that everyone can see how things turned out, I discovered that a simple syntax error created all my problems. By simply not using the brackets () with nothing in between after defining the subroutine, all subsequent variables and expressions were considered as being redefined (which is the way I remember the first versions of Basic doing years ago). Once I fixed that, I fixed the problem.

Now my next learning experience is how to parameterize variables within indicators, but I will tackle that problem over the next few days. Thanks again, this is great forum, even for the inexperienced among us (like yours truly). Take care.
dbuffalo@charter.net
Posts:4

07-09-2006 2:04 PM Alert 

Here goes the next question (and this again is quite basic, but I am running into basic logic errors because of my lack of understanding of programming flow).

I have successfully added variables to my indicator so that it can be optimized later. It tested perfectly without errors. Here is where I get into trouble:

1) What should I be building first to build a trade plan (or should I build the session first)...should it be (from first step to last):

Custom Indicator Plot

Custom Indicator Function

System

Trade Plan

Session

Or is this in opposite order? I think what frustrates me the most at present is that I cannot see how all the pieces fit, and when I pull up the session, TradersStudio's first order of business (as it ought to be for running sessions) is to do the calculations not show the outline of how all this fits together. When I try to build a piece of it at a time, the program either rejects the subroutine or informs me that I cannot store the trade plan.

My first goal is simply to build a crossover system based on the indicator, and then add nuances once I know the basic system is built (using trailing stops or ATR calculations for trailing stops).

Let me know where I am going wrong, and I will gladly write a report of where I went wrong as I did with learning how to program an indicator.

Thanks again for your help.

 

 

 

 

 

You are not authorized to post a reply.
Forums > TradersStudio 2.x > TradersStudio Basic > Building Custom Indicators



ActiveForums 3.6
TradersStudio® Copyright 2004-2009 All Rights Reserved   |  Privacy Statement  |  Terms Of Use