PureBytes Links
Trading Reference Links
|
In a series of posts I showed how the trendline drawing function,
TL_New(sDate,sTime,sVal, eDate,eTime,eVal), could be used to add a
variety of types of plots to a chart, beyond the 4 plots available in
TS. See Code-List, 17 Jul 2000 16:41; 18 Jul 2000 11:08 and 29 Nov 2000
19:55.
Ivo Karindi pointed out that this trendline drawing function, in the
format I gave, could be used to plot a moving average in a Signal where
a regular TS Plot statement is not allowed. See Omega-List, Mon 29 Jan
2001 10:51.
Following Ivo's lead and using the Dot Format for
TL_New(sDate,sTime,sVal, eDate,eTime,eVal), given in the last cited of
my posts, Jerry's request for plotting data in a Signal can be
accommodated as follows.
His code with TL_New… added is:
Inputs: Length(2), ShowText(False);
Variables: LXPrice(0), SXPrice(0), StopText(0);
LXPrice = LowestFC(Low, Length) - 1;
If marketposition=1 then begin
TL=TL_New(Date[0], Time[0],.995*LXPrice[0],D[0], T[0],1*LXPrice[0]);
TL_SetStyle(TL, 3);
TL_SetColor(TL, 6);
TL_SetSize(TL, 2);
End;
SXPrice = HighestFC(High, Length) + 1;
If marketposition=-1 then begin
TL=TL_New(Date[0], Time[0],.995*SXPrice[0],D[0], T[0],1*SXPrice[0]);
TL_SetStyle(TL, 3);
TL_SetColor(TL, 2);
TL_SetSize(TL, 2);
End;
(To get TL_New... to plot I had to verify the code after it was on the
chart. As with many TL_New... plots you may have to play around with it
to get it to work).
Of course, Victor's solution to make an indicator works and I have
plotted it in subgraph 2 (I have also include in his code (see below)
TL_New… , which will only plot in the graph in which the price data is
plotted, namely subgraph1). See the gif. So the red dots in both
subgraphs are due to i_marketposition (sub2) and TL_New…(sub1). The blue
dots are from the above code (for clarity, only data for
marketposition=1 is plotted ).
Why there is one more (beginning) data point for "i_marketposition=1"
than "marketposition=1", I have no idea. I am sending the gif separate
from this post due to the 10K (or 20K) size limit on the omega-list
>
> Subject: Re: Plotting problem
> Date: Tue, 9 Oct 2001 19:05:33 -0700 (PDT)
> From: Victor C <victorc17@xxxxxxxxx>
> To: ja@xxxxxxxxxxxx, omega-list@xxxxxxxxxx
>
> Hi,
> You need to create an indicator that plots this for you. Unfortunately there is no >way to have your systems, or strategies plot. In your indicator you would use the >I_MarketPosition (the I_ stands for indicator). So (off the cuff, without testing) >your indicator should look like this:
>
> Inputs: Length(2), ShowText(False);
> Variables: LXPrice(0), SXPrice(0), StopText(0);
>
> LXPrice = LowestFC(Low, Length) - 1;
> If i_marketposition=1 then begin
> Plot1 (LXPrice,"LST");
> <TL=TL_New(Date[0], Time[0],.998* LXPrice [0] , Date, Time, LXPrice);
> <TL_SetStyle(TL, 1);
> <TL_SetColor(TL, 6);
> <TL_SetSize(TL, 2);
> End;
>
> SXPrice = HighestFC(High, Length) + 1;
> If i_marketposition=-1 then Plot2 (SXPrice,"SST");
>
>
> And, there is no way to link the indicator and system together (for inputs or >otherwise).
>
> Regards,
>
> Victor Cuadra
> www.cuadraE.com
>
> --- ja@xxxxxxxxxxxx wrote:
> > Hi All,
> >
> > I'm having a problem getting TS to display stop placement positions on a chart > >from my stop loss signal. TS is giving me
> > error #189 (this word not allowed in signal) when I try to use PLOT.
> >
> > Can anyone tell me how to get TS to display this...?
> > My code:
> >
> >
> > Inputs: Length(2), ShowText(False);
> > Variables: LXPrice(0), SXPrice(0), StopText(0);
> >
> > LXPrice = LowestFC(Low, Length) - 1;
> >
> > If marketposition=1 then Plot1 (LXPrice,"LST");
> > ExitLong ("TrlLX") Next Bar at LXPrice Stop;
> >
> > SXPrice = HighestFC(High, Length) + 1;
> >
> > If marketposition=-1 then Plot2 (SXPrice,"SST");
> > ExitShort ("TrlSX") Next Bar at SXPrice Stop;
> >
> > Any help much appreciated. Thanks...
> >
> > -Jerry
> >
|