PureBytes Links
Trading Reference Links
|
This is a great formula i hope you don't mind that i uploaded it to the formula library:
http://www.wisestocktrader.com/indicators/208-price-breakout-detection-exploration
--- In amibroker@xxxxxxxxxxxxxxx, Rasheed Momoh <rashmo_70@xxx> wrote:
>
> wow patrick. thanks for everything. my major problem is I don't know how to write an AFL Formula. But if I see a good one I go for it. I have attached more charts & hope this might help. Â Our market moves 5% max up or down daily, I made the LOOKBACK & SHIFT narrow because I wanted to catch those fast rallies, buying when prices hit support L1 & selling when it hits H1.Â
>
> --- On Sat, 1/30/10, NW Trader <ta4charts@xxx> wrote:
>
> From: NW Trader <ta4charts@xxx>
> Subject: Re: [amibroker] REALLY NEED HELP ON BREAKOUT FORMULA
> To: amibroker@xxxxxxxxxxxxxxx
> Date: Saturday, January 30, 2010, 6:27 PM
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> Â
>
>
>
>
>
>
>
>
>
> 
>
>
> Hi Rasheed,
> Â
> Sorry that I didn't understand you. Yes, for me
> breakout has a definite connotation -- meaning that a stock hits a resistance
> (or support) level and proceeds through it to establish a new trading range or
> the breakout is said to fail (although a wider trading range may be now
> established) . I think what you are describing is a reversal at resistance
> (or support). In order to code this correctly, please examine the behavior
> of a number of stocks at resistance or support and then write a concise
> description of their common price action at those levels. The
> attachment you sent is not sufficient for me to develop this as it appears that
> in some cases price penetrates the H1 or L1 level before falling back the
> following day, other times it touches but doesn't close beyond the
> level.Â
> Â
> As a first hack to solve your request, I simply reversed
> the buy and sell conditions, however that led to some disastrous trades when a
> stock would actually breakout (i.e., continue well beyond the H1 or L1 level)
> not reverse. So that isn't the solution.  Perhaps having a
> violation of the level followed the next day (or within X days) a reversal back
> across the level would be a workable solution. Ponder on that or other
> variants and be sensitive not to curve fit a piece of code to one stock your
> chart of NEM makes for a nice idea, but how many other stocks have been in a
> consolidation range of about 5% +/-Â for 6 months?
> Â
> Heading out for a movie now, but will be back
> later.
> Â
> Peace and Justice  ---  Patrick
>
> ----- Original Message -----
> From:
> Rasheed
> Momoh
> To: amibroker@xxxxxxxxx ps.com
> Sent: Saturday, January 30, 2010 5:31
> PM
> Subject: Re: [amibroker] REALLY NEED HELP
> ON BREAKOUT FORMULA [1 Attachment]
>
>
>
>
>
> Hi PatrickÂ
> I really really appreciate the time spent on this formula. I tested
> it & feel its not what i was looking for. please view my attachment
> for ideas. I think the problem is the word "BREAKOUT", i wanted a buy
> signal when prices hit the down(L) & SELL Signal when price hits
> (H)lines and also a column identifying their various support &
> resistant levels.
> Below are columns needed.
> =ticker=date/ time=industry sector=last= action=breakout= resistant
> H1=support L1.
>
> I will appreciate if these criteria's are
> met.
> thanks patrick
> Rasheed.
>
> --- On Sat, 1/30/10, NW Trader
> <ta4charts@xxxxxxxx net> wrote:
>
>
> From:
> NW Trader <ta4charts@xxxxxxxx net>
> Subject: Re: [amibroker]
> REALLY NEED HELP ON BREAKOUT FORMULA [1 Attachment]
> To:
> amibroker@xxxxxxxxx ps.com
> Date: Saturday, January 30, 2010, 3:14
> PM
>
>
> Â
>
> 
> Hi Rasheed,
> Â
> My apologies for taking so long to finish this
> up for you. Some other commitments got in the way of what
> really was not too hard a project. Anyway, I've tweaked the
> output a little so you can select between either the close crossing
> either the H1 or L1 line or the high or low crossing those lines to
> generate a buy or sell signal. Otherwise the signals are as you
> requested. Code is both attached (probably safer as won't introduce
> line breaks in copying) and written below.
> Â
> I didn't code for short and cover as you
> didn't give me rules you wanted to implement. Personally I would
> not use a stop and reverse system with the defined buy and sell
> signals. I think you would get better results if a sell was
> initiated when the close crosses under H1 after a buy when going above
> H1, and a cover when the close crosses above the L1 after a short
> when the close went under L1. But I've not tested this, and it's
> just a feeling from looking some charts.
> Â
> I've added trade signal arrows on the chart
> (again based on the parameter selected) as well as a param to remove
> excess trade signals. I also added the VAP indicator as I think it
> helpful to see possible support or resistance at a
> breakout.
> Â
> Hope this is what you were looking
> for.
> Â
> Peace and Justice  ---  Patrick
> Â
>
> //Â
> RASHEED'S BREAKOUTS
> //Â
> help requested for adding an exploration for End of Day
> breakouts
> /*Â
> coded by NW Trader 1-29-10 with
> exploration, chart signals and chart options
> Â Â Â Â Â Â Â Â Â
> toggle parameter to select between C or H & L for the
> breakout crossings
> Â Â Â Â Â Â Â Â Â
> toggle parameter added to remove extra trade signals
> Â Â Â Â Â Â Â Â Â
> Volume at price added
> */
>
> Â _SECTION_BEGIN("BREAK
> OUTS");
> Â //Â
> ============ == Standard Chart Code ============ =========
> =======
> Â
> CodeName =
> "Rasheed's
> Breakouts" ;
>
> SetFormulaName("Rasheed's
> Breakouts"
> );
> Â //Â Â
> ------------ ---Â Controls for Chart
> Display ------------ --------- ---------
> ----
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â
> SetChartOptions(0,chartShowDates|chartWrapTitle);
> Â Â Â Â Â Â Â Â Â Â Â Â Â
> if(
> ParamToggle("Tooltip
> shows",
> "All
> Values|Only Prices" )
> )
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â
> {
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â
> ToolTip=StrFormat("Open:
> %g\nHigh:Â %g\nLow:Â Â
> %g\nClose:Â %g (%.1f%%) \nVolume:
> "+NumToStr(
> V,
> 1 ),
> O,
> H,
> L,
> C,
> SelectedValue(
> ROC(
> C,
> 1
> )));
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â
> }
> Â Â Â Â Â Â Â Â Â Â Â Â Â
> space = Param("Space
> on Chart",
> 20,
> -15,
> 50,
> 1);
> Â Â Â Â Â Â Â Â Â Â Â Â Â
> GraphXSpace =
> space;Â Â Â Â Â Â Â Â Â Â Â Â
> Â Â Â
> Â Â Â Â Â Â Â Â Â Â Â Â Â
> SetChartBkColor(Â
> ParamColor("Background
> Color" ,
> colorLightGrey)
> );
> Â //
> ============ ===== Rasheed's original code (with Lookback and Shift
> default set to his specs) ============ =====
> Â H0=H;
> Â L0=L;
> Â C0=C;
> Â O0=O;
> Â Lookback=Param("LookBack",10,10,50,1);
> //
> Default for interday commodity currency trading
> Â shift=Param("Shift",
> 5,1,50,1);Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â
> //
> ?
> Â x0=LastValue(Cum(1));
> Â x1=x0-shift;
> Â H=Ref(H,-shift+1);
> Â L=Ref(L,-shift+1);
> Â H1=LastValue(Ref(HHV(H,Lookback),-1));
> Â L1=LastValue(Ref(LLV(L,Lookback),-1));
> Â Plot(H1,"H1",colorYellow);
> Â Plot(L1,"L1",colorYellow);
> Â H=H0;L=L0;C=C0;O=O0;
> Â up=Cross(H,H1)
> AND
> Cum(1)>x1;
> Â dn=Cross(L1,L)
> AND
> Cum(1)>x1;
> Â Plot(C,"Close",IIf(Cum(1)>x1-Lookback
> AND
> Cum(1)<=x1,colorBlue,IIf
> (Up,colorBrightGreen,IIf(
> Dn,colorRed,colorBlack))),64);
> PlotShapes(shapeDownArrow*(Cum(1)==x1+1),colorBlue);
> Â
> //
> ============ ========= == Exploration and Signal Code ============
> =====
> Â
> TRIGGER =
> ParamToggle("Trigger
> "
> ,"CLOSE|HIGH
> OR LOW")
> ;
> Â XH1 =
> Cross(C,H1)
> ;
> XL1 =
> Cross(L1,C);
> XH2 =
> Cross(H,H1);
> XL2 =
> Cross(L1,L);
> Â if( TRIGGER
> ==0)
> {Â
>
> Buy
> =Â XH1 ;
> Sell
> =Â XL1 ;
> }
> else
> {Â
>
> Buy
> =Â XH2 ;
> Sell
> =Â XL2 ;
> }
> TradeDisplay
> = ParamToggle("Remove
> Extra Trades?",
> "No|Yes");
> Â
> if(TradeDisplay
> == 0)
> {
> }
> else
> {
> Â Buy =
> ExRem(Buy,Sell);
> SellÂ
> = ExRem(Sell,Buy);Â
> // THIS
> WILL REMOVE EXESS SIGNALS ON A CHART OR IN AN EXPLORATION
> }
> Filter =
> Buy
> OR
> Sell;
> Â Action =
> WriteIf(Buy,
> "BUY",
> WriteIf(
> Sell,
> "SELL",Â
> "Â Â
> " )
> );
> Â AddTextColumn(IndustryID(1)
> ,"Industry
> Sector ",
> 30.0,
> colorBlue,
> colorYellow);
> AddColumn(C,
> "Last
> ",2.2,
> colorWhite,colorBlue);
> AddTextColumn(Action,
> "Action",
> 8.0,
> IIf(XH1,
> colorDarkGreen,
> colorDarkRed),Â
> colorWhite);Â
>
> AddColumn(
> IIf( XH1, H1
> , L1Â )Â , "BREAKOUT
> LEVEL",
> 3.2
> ,colorYellow, Â
> IIf(XH1,
> colorDarkGreen,
> colorDarkRed)
> );
> Â
> //
> ------------ --------- --------- --------- --------- ---------
> --------- --------- --------Â Arrow signals --- FOR
> TRADESÂ ------------ --------- --------- ---------
> --------- --------- -
> Â PlotShapes(Buy*shapeUpArrow,colorBrightGreen
> ,0,
> L
> /*
> ENTRY_TRAILARRAY */ ,
> -30);
>
> PlotShapes(Sell*shapeDownArrow,colorLightYellow,0,
> H ,
> -30);
> _SECTION_END();
> _SECTION_BEGIN("Volume
> At Price");
> PlotVAPOverlay(
> Param("Lines",
> 1000,
> 100,
> 1000,
> 10 ),
>
> Param("Width",
> 15,
> 1,
> 100,
> 1 ),
>
> ParamColor("Color",
> colorBlueGrey ),
>
> ParamToggle("Side",
> "Left|Right",
> 1 ) |
> 4*ParamToggle("Z-order",
> "On
> top|Behind",
> 1 )
> );
> _SECTION_END();
> Â
> Â
> Â
> Â
> Â
>
> ----- Original Message -----
> From: Rasheed Momoh
> To: amibroker@xxxxxxxxx
> ps.com
> Sent: Friday, January 29, 2010
> 1:40 AM
> Subject: Re: [amibroker] REALLY
> NEED HELP ON BREAKOUT FORMULA [1 Attachment]
>
>
>
>
>
> Hi Patrick,
> i use E.O.D
> I want the L1 H1
> to act as a support & resistant line.
> pls find
> attached
> tx
> rasheed
>
> --- On Thu, 1/28/10, NW
> Trader <ta4charts@xxxxxxxx
> net> wrote:
>
>
> From: NW
> Trader <ta4charts@xxxxxxxx
> net>
> Subject: Re: [amibroker] REALLY NEED HELP ON
> BREAKOUT FORMULA
> To: amibroker@xxxxxxxxx
> ps.com
> Date: Thursday, January 28, 2010, 4:09
> PM
>
>
> Â
>
>
> Hi Rasheed,
> Â
> What time length do you expect this to run on? 1
> Minute, 15 Min, Hourly, end of day??? Do you want the H1 and
> L1 levels set by the time frame selected or some other time
> frame (like end of day if you are charting intraday).
> Â
> How do you define a buy or sell? Is it to be a
> cross of the H1 or L1 line?Â
> Â
> An exploration that produces the H1 and L1 values for
> each stock or instrument is easy enough to code, I just
> don't know what the answer to the above questions are and
> those will determine the code and solution to your question.
> I'll be glad to help in a bit once we know this
> information.
> Â
> Peace and Justice  --- Â
> Patrick
>
> -----
> Original Message -----
> From:
> Rasheed M
>
> To:
> amibroker@xxxxxxxxx ps.com
> Sent:
> Thursday, January 28, 2010 2:33 PM
> Subject:
> [amibroker] REALLY NEED HELP ON BREAKOUT FORMULA
>
> hi guys.
> I need help. I will like to run
> a scan/exploration on an AFL titled "BREAKOUTS". I reduced
> the parameters to (lookback= 10) & (Shift=5). I need
> it to give me "H1'' & "L1" points prices of each
> stocks and perhaps a BUY/SELL within these
> regions.
> Thanks I will really
> appreciate.
>
>
> _SECTION_BEGIN( "BREAK
> OUTS");
> H0=H;
>
> L0=L;
>
> C0=C;
>
> O0=O;
>
> Lookback=Param(
> "LookBack" ,22,10,50, 1); // Default for interday
> commodity currency trading
>
> shift=Param( "Shift",
> 11,1,50,1);Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â
> // ?
>
> x0=LastValue(
> Cum(1));
>
> x1=x0-shift;
>
> H=Ref(H,-shift+
> 1);
>
> L=Ref(L,-shift+ 1);
>
> H1=LastValue(
> Ref(HHV(H, Lookback) ,-1));
>
> L1=LastValue(
> Ref(LLV(L, Lookback) ,-1));
>
> Plot(H1,"H1"
> ,colorYellow) ;
>
> Plot(L1,"L1" ,colorYellow)
> ;
>
> H=H0;L=L0;C= C0;O=O0;
>
> up=Cross(H,H1) AND
> Cum(1)>x1;
>
> dn=Cross(L1, L) AND
> Cum(1)>x1;
>
> Plot(C,"Close" ,IIf(Cum(
> 1)>x1-Lookback AND Cum(1)<=x1,colorBlue,
> IIf
>
> (Up,colorBrightGree n,IIf( Dn,colorRed,
> colorBlack) )),64);
>
> PlotShapes(shapeDow
> nArrow*(Cum( 1)==x1+1) ,colorBlue)
> ;
>
>
> _SECTION_END( );
>
>
>
> ------------
> --------- --------- ------
>
> **** IMPORTANT PLEASE
> READ ****
> This group is for the discussion between
> users only.
> This is *NOT* technical support
> channel.
>
> TO GET TECHNICAL SUPPORT send an e-mail
> directly to
> SUPPORT {at} amibroker.com
>
> TO
> SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
> http://www.amibroke
> r.com/feedback/
> (submissions sent via other
> channels won't be considered)
>
> For NEW RELEASE
> ANNOUNCEMENTS and other news always check DEVLOG:
> http://www.amibroke
> r.com/devlog/
>
> Yahoo! Groups
> Links
>
> group/amibroker/
>
> Traditional
>
> group/amibroker/ join
> Â Â Â (Yahoo! ID
> required)
>
>
> Â Â Â amibroker-fullfeatu
> red@xxxxxxxxxxxx com
>
> amibroker-unsubscri be@xxxxxxxxxxxx
> com
>
> info/terms/
>
------------------------------------
**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.
TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com
TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/amibroker/join
(Yahoo! ID required)
<*> To change settings via email:
amibroker-digest@xxxxxxxxxxxxxxx
amibroker-fullfeatured@xxxxxxxxxxxxxxx
<*> 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/
|