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

[amibroker] Re: Adding the latest Closing value to the Output Results List



PureBytes Links

Trading Reference Links

Hi Graham,

That adds the very next bar's closing price to the output list.  Not
the very last bar in the array.

Let's say I run a scan for 1/4/2005, what I would like to see is the
closing price on 2/10/2006.

So I need someway of identifying the last bar in the array I think.

And if it requires too much hassle or code, just let me know.

Dave

--- In amibroker@xxxxxxxxxxxxxxx, Graham <kavemanperth@xxx> wrote:
>
> addcolumn( ref(c,1), "next bar close", 1.3 );
> 
> --
> Cheers
> Graham
> AB-Write >< Professional AFL Writing Service
> Yes, I write AFL code to your requirements
> http://e-wire.net.au/~eb_kavan/ab_write.htm
> 
> 
> 
> On 2/13/06, marketmonk777 <dlittner@xxx> wrote:
> > Thanks to a lot of you folks, I am making great progress in learning
> > how to write AFL code.
> >
> > I am including my code for basic stock exploration in which I am
> > looking for various conditions either separately or in combinations. A
> > great feature of AB is that the exploration allows me to select a date
> > range in the past (ie one year ago).  I then visually check each
result.
> >
> > Let's say that I want to run it for the dates of 2/7/2005 to 2/11/05
> > (roughly one year ago).  I would like to add this last Friday's
> > closing price (2/10/2006) to the output results.  This would let me
> > have a quick check as to how well the stock has performed since the
> > signal date.
> >
> > Is this possible?
> >
> > Dave
> >
> >
> >
> > // My Basic Stock Exploration
> > // by MarketMonk777 a.k.a. RedEyes
> >
> > //  --------  Parameter Conditions and Variables for Exploration
> > --------------------------------
> > WLF = ParamToggle ( "Add Results to a Watchlist?", "No|Yes") ;   //
> > select whether to add results to watchlist or not
> > WLN = Param("Set Watchlist Number", 2, 2, 60,1);     // sets the
> > watchlist number, but reserves the first 2 and last 4 watchlists
> > PRF = ParamToggle("Check for Price in range?", "No|Yes");
> > HCV = Param("High close value ", 50, 5, 300, 0.5);
> > LCV     = Param("Low close value " , 5, 1, 10, 0.25);
> > MVF = ParamToggle("Check for Min Volume?", "No|Yes");
> > PAV = Param("Period for Avg Vol " , 21, 10, 240, 1);
> > MAV = Param("Stock minimum Avg Vol " , 125000, 50000, 1000000, 5000);
> > VSF = ParamToggle("Check for Volume Spike", "No|Yes");
> > VSP = Param("Volume Spike Percentage" , 50, 10, 100000, 10);
> > NH21F = ParamToggle("Check for NH 21 Day?", "No|Yes");
> >
> >
> > // -------------- Test for conditions
> > ----------------------------------------
> > PR = (Close >= LCV AND Close <= HCV);
> > VR = (MA( Volume, PAV ) > MAV);
> > VS = (Volume/Ref(MA(Volume,PAV),-1))*100 > VSP;
> > NH21 = C >= HHV( Close, 21);
> >
> >
> > // ------------ Buy or Exploration Trigger Conditions Met?
> > ------------------------------------------
> > My_Conditions = IIf(PRF,PR,1) AND IIf(MVF,VR,1) AND IIf(VSF,VS,1) AND
> > IIf(NH21F,NH21,1);
> >
> > Filter = My_Conditions;
> > Buy = Filter;
> >
> > // ------------ Add Symbols to Watchlist?
> > ------------------------------------------
> > Add = IIf( WLF==1, Filter , 0 ) ;
> > if( LastValue( Add ) )
> > {  CategoryAddSymbol( "", categoryWatchlist, WLN ); }
> >
> >
> > //  --------------  Organize the exploration results
> > ------------------------------------
> > AddTextColumn(IndustryID(1),"Industry Sector", -5.0, colorWhite,
> > colorBlue);
> > AddColumn(C, "Close", 2.2,  colorDarkGreen, colorLightGrey);
> > AddColumn(V, "Volume",8.0, colorYellow, colorDarkGreen);
> >                        // Volume Info
> > AddColumn(Ref(MA(V,PAV),-1), "Vol " + WriteVal(PAV, 2.0)+ " dma", 8.0,
> > colorWhite, colorBlue);
> > AddColumn( (V/Ref(MA(V,PAV),-1))*100,"V % Inc " ,3.0,
> > colorLightYellow, colorDarkGrey);
> > AddTextColumn(WriteIf(PR, "Yes", " "), "Price?");
> > AddTextColumn(WriteIf(VR, "Yes", " "), "Min Vol?");
> > AddTextColumn(WriteIf(VS, "Yes", " "), "Vol % Inc?");
> > AddTextColumn(WriteIf(NH21, "Yes", " "), "21 day NH?");
> >
> >
> >
> >
> >
> >
> >
> > Please note that this group is for discussion between users only.
> >
> > To get support from AmiBroker please send an e-mail directly to
> > SUPPORT {at} amibroker.com
> >
> > For other support material please check also:
> > http://www.amibroker.com/support.html
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
>







------------------------ Yahoo! Groups Sponsor --------------------~--> 
Try Online Currency Trading with GFT. Free 50K Demo. Trade 
24 Hours. Commission-Free. 
http://us.click.yahoo.com/RvFikB/9M2KAA/U1CZAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/