+ Reply to Thread
Results 1 to 9 of 9

Thread: AB Calculation in TradeStation?

  1. #1
    Join Date
    Dec 1969
    Location
    Vienna, Virginia
    Posts
    603

    AB Calculation in TradeStation?

    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

  2. #2
    Join Date
    Dec 1969
    Posts
    1,585
    I'll post one in a bit.

  3. #3
    Join Date
    Dec 1969
    Posts
    1,585
    See attached for the ELD and a sample workspace.

    Code:
    {***********************************************************************************************
     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");
    Attached Files

  4. #4
    Hi everyone

    Has anybody have the same calculations for AmiBroker?

  5. #5
    Join Date
    Dec 1969
    Location
    aventura, fl
    Posts
    10
    first of all thnx for sharing , has anyone has an explanation sheet how to analyze signals from AB according to this code. regards



    Quote Originally Posted by EB View Post
    See attached for the ELD and a sample workspace.

    Code:
    {***********************************************************************************************
     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");

  6. #6

    TS EV Plug-in ReWrite

    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

  7. #7
    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

  8. #8
    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");

  9. #9
    thanks...let me give it a shot....never done any easy language :)

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts