Log in

View Full Version : AB Calculation in TradeStation?



grems8544
12-12-2011, 11:42 AM
Has anybody implemented the AB calculation for TradeStation? I've searched the forums and it does not appear that this is the case.

If so, please let me know.

Regards,

pgd

EB
12-12-2011, 12:02 PM
I'll post one in a bit.

EB
12-12-2011, 12:43 PM
See attached for the ELD and a sample workspace.



{************************************************* **********************************************
TradeStation implementation of Pascal Willain's ACTIVE BOUNDARIES,
as described in the book, "Value in Time" Wiliey, 2008
http://www.effectivevolume.com

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License
http://creativecommons.org/licenses/by-sa/3.0/
2011, Bob English

Setting "Maximum number of basr study will reference:" to "Auto-Detect" may cause slow
performance. A "User define:" number will need to be at least the maximum number of
historical bars referenced.
************************************************** *********************************************}

Inputs: ContractsShares(100000000),
Price((H+L+C)/3),
MyVolume(Volume), //Use "Ticks" for intraday charts
PlotAB(true),
PlotABxAvg(true),
LengthABxAvg(20),
PlotZero(true),
XAvgUpColor(Blue),
XAvgDnColor(Red),
UpColor(Cyan),
DnColor(Magenta),
UsePercent(true);

Vars: j(0),
TotalVolume(0),
AvgPosition(0),
ActiveBoundaries(0),
XActiveBoundaries(0),
CumeActiveBoundaries(0);


j = 0;
TotalVolume = 0;
AvgPosition = 0;
ActiveBoundaries = 0;

while TotalVolume < ContractsShares begin
AvgPosition = iff(MyVolume[j] + TotalVolume <> 0, ( (Price[j] * MyVolume[j]) + (AvgPosition * TotalVolume) ) / (MyVolume[j] + TotalVolume), AvgPosition);
ActiveBoundaries = iff(UsePercent, (Price - AvgPosition) / AvgPosition * 100, (Price - AvgPosition));
CumeActiveBoundaries = CumeActiveBoundaries + ActiveBoundaries;
TotalVolume = TotalVolume + MyVolume[j];
j = j + 1;
end;

XActiveBoundaries = XAverage(ActiveBoundaries, LengthABxAvg);

if PlotAB then begin
plot1(ActiveBoundaries, "AP");
if ActiveBoundaries >= 0 then SetPlotColor(1, UpColor)
else SetPlotColor(1, DnColor);
end;

if PlotABxAvg then begin
plot2(XActiveBoundaries, "Xavg");
if XActiveBoundaries >= XActiveBoundaries[1] then SetPlotColor(2, XAvgUpColor)
else SetPlotColor(2, XAvgDnColor);
end;

if PlotZero then plot3(0, "Zero");

shamree
12-26-2011, 08:21 AM
Hi everyone

Has anybody have the same calculations for AmiBroker?

trader1970
10-16-2012, 08:54 AM
first of all thnx for sharing , has anyone has an explanation sheet how to analyze signals from AB according to this code. regards




See attached for the ELD and a sample workspace.



{************************************************* **********************************************
TradeStation implementation of Pascal Willain's ACTIVE BOUNDARIES,
as described in the book, "Value in Time" Wiliey, 2008
http://www.effectivevolume.com

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License
http://creativecommons.org/licenses/by-sa/3.0/
2011, Bob English

Setting "Maximum number of basr study will reference:" to "Auto-Detect" may cause slow
performance. A "User define:" number will need to be at least the maximum number of
historical bars referenced.
************************************************** *********************************************}

Inputs: ContractsShares(100000000),
Price((H+L+C)/3),
MyVolume(Volume), //Use "Ticks" for intraday charts
PlotAB(true),
PlotABxAvg(true),
LengthABxAvg(20),
PlotZero(true),
XAvgUpColor(Blue),
XAvgDnColor(Red),
UpColor(Cyan),
DnColor(Magenta),
UsePercent(true);

Vars: j(0),
TotalVolume(0),
AvgPosition(0),
ActiveBoundaries(0),
XActiveBoundaries(0),
CumeActiveBoundaries(0);


j = 0;
TotalVolume = 0;
AvgPosition = 0;
ActiveBoundaries = 0;

while TotalVolume < ContractsShares begin
AvgPosition = iff(MyVolume[j] + TotalVolume <> 0, ( (Price[j] * MyVolume[j]) + (AvgPosition * TotalVolume) ) / (MyVolume[j] + TotalVolume), AvgPosition);
ActiveBoundaries = iff(UsePercent, (Price - AvgPosition) / AvgPosition * 100, (Price - AvgPosition));
CumeActiveBoundaries = CumeActiveBoundaries + ActiveBoundaries;
TotalVolume = TotalVolume + MyVolume[j];
j = j + 1;
end;

XActiveBoundaries = XAverage(ActiveBoundaries, LengthABxAvg);

if PlotAB then begin
plot1(ActiveBoundaries, "AP");
if ActiveBoundaries >= 0 then SetPlotColor(1, UpColor)
else SetPlotColor(1, DnColor);
end;

if PlotABxAvg then begin
plot2(XActiveBoundaries, "Xavg");
if XActiveBoundaries >= XActiveBoundaries[1] then SetPlotColor(2, XAvgUpColor)
else SetPlotColor(2, XAvgDnColor);
end;

if PlotZero then plot3(0, "Zero");

Riskslayer
10-16-2012, 09:39 AM
Hi All,

I am in the middle of a project to re-write the TS EV plug-in (focused on making it more efficient and able to work w/n radar screen).

If anyone has worked on this type of project or has ideas, asks, or requirements suggestions, let me know.

For now, I am interested in 20 day and less to screen on Pos LEV, etc. I have a workspace I can forward to those who are interested.

Look at AFFY w/n in the current TS environment & EV plug-in to understand what I am looking to scan for.

Thanks,

Shawn

som4edge
01-04-2013, 02:22 AM
Hi Guys, I downloaded the AB ELD. Seem to get it working with the Daily timeframe only. Would it also work for Intra-day or just Dailies...any info will help.

thnx
som

bh_trade
01-12-2013, 10:37 PM
Don't recall if I made any code changes to "make" it work with intraday data, but the following code I use works with intraday minute, tick, and volume bar charts.


{************************************************* **********************************************
TradeStation implementation of Pascal Willain's ACTIVE BOUNDARIES,
as described in the book, "Value in Time" Wiliey, 2008
http://www.effectivevolume.com

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License
http://creativecommons.org/licenses/by-sa/3.0/
2011, Bob English

Setting "Maximum number of basr study will reference:" to "Auto-Detect" may cause slow
performance. A "User define:" number will need to be at least the maximum number of
historical bars referenced.
************************************************** *********************************************}

Inputs: Price((H+L+C)/3),
MyVolume(Ticks), //Use "Ticks" for intraday charts
PlotAB(true),
PlotABxAvg(false),
LengthABxAvg(20),
PlotZero(false),
XAvgUpColor(Blue),
XAvgDnColor(Red),
UpColor(Cyan),
DnColor(Magenta),
UsePercent(true);

Vars: ContractsShares(0),
j(0),
TotalVolume(0),
AvgPosition(0),
ActiveBoundaries(0),
XActiveBoundaries(0),
CumeActiveBoundaries(0);


j = 0;
TotalVolume = 0;
AvgPosition = 0;
ActiveBoundaries = 0;
ContractsShares=average(Ticks,200)*100;

while TotalVolume < ContractsShares begin
AvgPosition = iff(MyVolume[j] + TotalVolume <> 0, ( (Price[j] * MyVolume[j]) + (AvgPosition * TotalVolume) ) / (MyVolume[j] + TotalVolume), AvgPosition);
ActiveBoundaries = iff(UsePercent, (Price - AvgPosition) / AvgPosition * 100, (Price - AvgPosition));
CumeActiveBoundaries = CumeActiveBoundaries + ActiveBoundaries;
TotalVolume = TotalVolume + MyVolume[j];
j = j + 1;
end;

XActiveBoundaries = XAverage(ActiveBoundaries, LengthABxAvg);

if PlotAB then begin
plot1(ActiveBoundaries, "ActvBound");
if ActiveBoundaries >= 0 then SetPlotColor(1, UpColor)
else SetPlotColor(1, DnColor);
end;

if PlotABxAvg then begin
plot2(XActiveBoundaries, "Xavg");
if XActiveBoundaries >= XActiveBoundaries[1] then SetPlotColor(2, XAvgUpColor)
else SetPlotColor(2, XAvgDnColor);
end;

if PlotZero then plot3(0, "Zero");

som4edge
01-23-2013, 02:48 AM
thanks...let me give it a shot....never done any easy language :)