How to name a manually drawn trendline?
Author: lookingbackon
Creation Date: 12/18/2015 2:49 AM
profile picture

lookingbackon

#1
Hello,

If I mannually draw a trendline by "DrawLine", how can I name it and then access the trendline vaue accordingly?
e.g.:
CODE:
Please log in to see this code.


Thanks in advance
profile picture

Eugene

#2
You're confusing a DrawLine with a manually drawn object (trendline, tradable trendline etc.) A DrawLine object can not be accessed by name as it doesn't have it.
profile picture

lookingbackon

#3
Thanks for the clarification. In Wealthlab, what does the "manually drawn trendline" mean? Is it actually a Dataseries like e.g.: EMA? Or anything else? How should I correctly understand on that? Your further elaberation and ,if possible, a example would be helpful and great.
I tried to study it in QuickRef and wiki but failed.

Thanks
profile picture

Cone

#4
Make sure that View > Drawing Toolbar is displayed. Any object placed on the chart from the Drawing Toolbar is "manually drawn".
profile picture

Eugene

#5
QUOTE:
In Wealthlab, what does the "manually drawn trendline" mean?

Please refer to the Wealth-Lab User Guide > Charting > Drawing Toolbar > Lines and Trendlines.
profile picture

lookingbackon

#6
It's clear now. Obviously I was not in the right place before. Thanks a lot. It's really helpful.
profile picture

lookingbackon

#7
Sorry, there is still a question regarding the tradable trendline (TT).
If I finished the setup for a specific tradable trendline through drawing tool bar, will the TT directly generate Alerts without any strategy code created? Or I still have to type strategy code as we do for "normal" strategy creation?
Thanks
profile picture

Eugene

#8
TTs can generate Alerts without any code. Just note that the bar's close price have to cross above/below the line.
profile picture

lookingbackon

#9
Thanks. Whether all historic Alert will be shown on the price pane or only the last one?
profile picture

Eugene

#10
In general there's no such thing as historic Alerts. Only the last one is visible.
profile picture

Cone

#11
Clarifiying, alerts are trading signals that occur on a bar that does not yet exist in the chart. Does that make sense?

For example, after the closing price crosses a TT, it generates an Alert to buy/sell at market on the next bar that does not yet exist. Think of it in end-of-day terms. If the close crossed a TT yesterday (Monday), it generates an Alert for Tuesday's session, which has not yet started.
profile picture

lookingbackon

#12
My original intention was to check whether all possible alerts will be recorded in the price pane. According to your further elaberation, my understanding is that ONLY the last one, which can ONLY potentially occured in the current last bar(the last bar of the chart), can be shown. Right?

I still get another issue for your clarification. The issue is like below:

1. Drawing a TT in the chart for a certain period. e.g.: start point at 2015/01/15, end point at 2015/12/15
2. After coding the TT into my strategy code, it seems that the TrendlineValue of the TT is applied/available to all bars even though the TT only cross a certain period. During the backtest, the TrendlineValue of the TT will be generated and be effective for the bars before the start point date. That will definitely cause unexpected results.

So,my question is whether it's possible to draw a TT which only effective after the start point bar or not?
Or, what's your comments for the backtest isuue above?

Thanks
profile picture

Cone

#13
QUOTE:
...ONLY potentially occured in the current last bar(the last bar of the chart), can be shown. Right?
Right. Alerts only refer to trading actions for "tomorrow" or on an intraday basis "the next bar". Previous trading signals that did not result in a hypothetical execution in a backtest are lost - unless you make an effort to record them... but why would you care do to that?

Sure, a manual trendline is a line that has a y value (price) at every x coordinate (bar).

Look, backtesting trendlines is a complex issue. The problem is that lines are drawn very subjectively based on what you see today, so this inherently introduces peeking into a backtest. You simply cannot use manually drawn trendlines for backtests. It will be peeking and invalidate the test. If you want to draw a level or a support/resistance line and trade in and out of stock today or tomorrow, fine.

But no one that I know of has attempted to program a proper backtest using trendlines "drawn" objectively by coded procedures in a publication - except for yours truly. It's complex. But you have the benefit of my works published in ActiveTrader magazine. You can download directly into Wealth-Lab at three of these strategies using the Strategy Explorer (Ctrl+O) download feature.


After you complete the download, search for "ActiveTrader 2013" and look for "Trendline"
profile picture

lookingbackon

#14
Hi Cone,
Thanks for the clarification. I have downloaded the strategy you mentioned. Hopefully it would be helpful. Thanks for your support.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).