[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Passing values to an indicator via text boxes



PureBytes Links

Trading Reference Links

Perhaps there is a simple solution for your problem that will eliminate
a duplication of large blocks of code for a strategy and an indicator:

Plot statements are NOT accepatble in EL "Signals" and "Functions"
modules..However, it si perfectly legal to use Trendlines (TL_*) and drawing
of TEXT objects (Text_*) in the above modules.

So, write your reusable EL code as FUNCTION using TL_* and TEXT_* 
statements for visualization/ploting.

Then use this function in indicators "AS IT IS", and when used in Signal
module simply disable TL and TEXT code. One extra input to the
function can enable or disable these plots.

For example, to plot Closing prices using TrendLines(TL) in
Signal/Strategy or Function, use:

ID  = TL_new(D,T,C,D[1],T[1],C[1]);

DC 

----- Original Message ----- 
From: "CRE" <cengholm@xxxxxxxxxxxx>
To: <omega-list@xxxxxxxxxx>
Sent: Friday, April 26, 2002 3:34 PM
Subject: Passing values to an indicator via text boxes


     Rather than duplicate large blocks of almost-identical code for a
strategy and an indicator, I am trying to use a text boxes to pass two
numbers from a strategy to a companion indicator to plot an upper and a
lower breakout channel. The strategy writes the two text boxes with the
current values for the channel, and the indicator is supposed to read and
plot those two values for each bar. So far, so good.

    However, when Tradestation loads a chart, it looks like it evaluates the
EasyLanguage code for all of the historical strategy bars up to the current
bar, then evaluates all of the indicator bars up to the present -- as
opposed to evaluating the strategy and indicator code for each bar in
sequence. This makes it impossible to pass correct values to the indicator
for each bar in the past.

     I have spoken with both TradeStation support and EasyLangugage support,
and was told that if the strategy includes a moving average calculation of
any kind, then Tradestation evaluates all of the strategy bars BEFORE
attempting to calculate any indicators. Since almost any strategy of
significance will include a moving average, this would seem to close the
door to sending data to an indicator on every bar of the chart. Does anyone
have suggestions or ideas on how to change the order in which indicator bars
are evaluated?  Or do you have other shortcut ways to pass data from a
strategy to an indicator so it can be plotted? Thanks.


R. Engholm
Portland, ME