hI JERRY THANK YOU FOR THE CODE and your helping spirit. i AM EXAMINING it for use on stocks. It looks good. It is working.pretty well made. regards ford
--- In amibroker@yahoogroups.com, "Jerry Gress" <pleasenospample...@...> wrote: > > Hello, > > Below is my way for the 6e futures which is 4 decimal places, make the > necessary changes for stocks. Just click on chart after highlighting a bar, > than either F12 or double click to bring up the Green Range bar. With a > little subbing of lines you should be able to get you ATR targets and the > fourth target. > > Hope this helps, > > JG > > PS. And Stupid NT can't do this. > > > > //new way Sep 11 2008 ADJUSTED JUNE 17, 09 by Jerry Gress > Zone = ParamList( "Zones", "1T,2T,1U,1D,2U,2D" ); > ffact = Param("Fuge Factor",0.00000,-0.0009,0.0010,0.0001); > xhi = BeginValue(MA(H,1))+ffact; > xlo = BeginValue(MA(L,1))+ffact; > > //midpt = (xhi + xlo)/2+ffact;//midpt = BeginValue(MA(H-1.15,1))+ffact; > //PlotGrid(midpt,colorYellow); > > xzon1 = Param("1st Profit",0.0004,0,0.0100,0.0001); > xzon2 = Param("2nd Profit",0.0008,0,0.0100,0.0001); > newstp =Param("Stop Amount",0.0009,0,0,0025,0.0001); > > //Profit 1 target up AND dn > if ( Zone == "1T" ) > Plot( xhi, "", colorDarkGreen, styleLine );//buy entry at hi > if ( Zone == "1T" ) > PlotGrid(xhi-newstp,colorGreen);//stop green > if ( Zone == "1T" ) > Plot(xlo,"",colorDarkRed,styleLine);//sell entry at lo > if ( Zone == "1T" ) > PlotGrid(xlo+newstp,colorRed);//stop red > if ( Zone == "1T" ) > Plot(xhi+xzon1,"",colorDarkGreen,styleLine);//1st profit > if ( Zone == "1T" ) > Plot(xlo-xzon1,"",colorDarkRed,styleLine);//sell profit > // profit 1 and 2 up and dn > if ( Zone == "2T" ) > Plot( xhi, "", colorDarkGreen, styleLine );//buy entry at hi > if ( Zone == "2T" ) > PlotGrid(xhi-newstp,colorGreen);//stop green > PlotGrid(xhi-newstp,colorGreen); > if ( Zone == "2T" ) > Plot(xlo,"",colorDarkRed,styleLine);//sell entry at lo > if ( Zone == "2T" ) > PlotGrid(xlo+newstp,colorRed);//stop red > if ( Zone == "2T" ) > Plot( xhi + xzon1, "", colorDarkGreen, styleLine );//1st buy profit > if ( Zone == "2T" ) > Plot( xhi + xzon2 , "", colorDarkGreen, styleLine );//2nd buy profit > if ( Zone == "2T" ) > PlotGrid( (xhi + .0050) , colorDarkGreen);//18.25 MAX > if ( Zone == "2T" ) > Plot(xlo-xzon1,"",colorDarkRed,styleLine);//sell profit > if ( Zone == "2T" ) > Plot(xlo-xzon2,"",colorDarkRed,styleLine );//2nd sell profit > if ( Zone == "2T" ) > PlotGrid( xlo - .0050,colorDarkRed );//18.25 MAX > > //1U > if (Zone == "1U" ) > Plot( xhi, "", colorDarkGreen, styleLine );//buy entry at hi > if (Zone == "1U" ) > PlotGrid(xhi-newstp,colorGreen);//stop green > if (Zone == "1U" ) > Plot(xhi+xzon1,"",colorDarkGreen,styleLine);//1st Profit > //1D > if (Zone == "1D" ) > Plot(xlo,"",colorDarkRed,styleLine);//sell entry at lo > if (Zone == "1D" ) > PlotGrid(xlo+newstp,colorRed);//stop red > if (Zone == "1D" ) > Plot(xlo-xzon1,"",colorDarkRed,styleLine); > //2 up > if (Zone == "2U" ) > Plot( xhi, "", colorDarkGreen, styleLine );//buy entry at hi > if (Zone == "2U" ) > PlotGrid(xhi-newstp,colorGreen);//stop green > if ( Zone == "2U" ) > Plot( xhi + xzon1, "", colorDarkGreen, styleLine );//1st profit > if ( Zone == "2U" ) > Plot( xhi + xzon2 , "", colorDarkGreen, styleLine );//2nd buy profit > if ( Zone == "2U" ) > PlotGrid( (xhi + .0050) , colorDarkGreen);//18.25 MAX > > //2 DN > if (Zone == "2D" ) > Plot(xlo,"",colorDarkRed,styleLine);//sell entry at lo > if (Zone == "2D" ) > PlotGrid(xlo+newstp,colorRed);//stop red > if ( Zone == "2D" ) > Plot(xlo-xzon1,"",colorDarkRed,styleLine);//1ST sell profit > if ( Zone == "2D" ) > Plot( xlo - xzon2 , "", colorDarkRed, styleLine );//2nd sell profit > if ( Zone == "2D" ) > PlotGrid( xlo - .0050,colorDarkRed );//18.25 MAX > //////////////////////////////////////////////////////////////////////////// > ////// > > > -----Original Message----- > From: amibroker@yahoogroups.com [mailto:amibro...@yahoogroups.com] On Behalf > Of ford7k > Sent: Tuesday, August 03, 2010 10:49 AM > To: amibroker@yahoogroups.com > Subject: [amibroker] Req Please help make this afl intraday chart-plot > entry-breakeven-stop-tgt > > Hi afl experts > > I have a 5 minute chart for my trading day. > I know for my stock the entry number. I have a formula to calculate stoploss > and breakeven stop and target 1 and 2 > I want the afl to draw dotted lines on chart for entry ,breakeven , > entry plus 1ATR > > The point here is to give a visual view on chart and then enable me to take > action as per plan > > For example > The entryprice needs to be parameterised.need two options one default and > another user choice number > The code picks up entry if I feed a number or if not fed any number it picks > up a support pointor any reasonable point . > I wont mind if code plots a shape at first entry point. > Evey time price fluctuates it goes from loss zone to profit zone and it has > to pass thru breakeven point,which appears as a dotted line or line.when > price is going from profit to loss, and when it reaches breakeven > point,action time is shown. > I define breakeven as > breakeven = entryprice + 2*(0.0005*entryprice) > The targetS ARE DEFINED BY 1*ATR(10), 2*ATR(10) AND 3*ATR(10) > These need to be plotted as lines. > > > target4----------------------------- > > target3----------------------------- > target2---------------------------- > target1 ------------------------------------ > > Breakeven price ............................... > > Entry price------------------------------------- > > initialstoploss================================= > > The moment ,in a long entry,price goes above the breakeven price,Imove my > stoploss to breakeven level and wait. > Once risk becomes zero,I stay calm,peaceful and take profits at tgt1 > or below it but above breakeven for sure. > Initialsatoploss is below entry and picks 5 the lowestlow to the left of > entry. > > Every trader gets one chance where his trade stays in a zone above breakeven > price. once he looses the chance he will end up in loss. > So the idea is see entry, breakeven, reasonable taergets on chart and focus > on zero risk, then moderate profits. > Missing on highe gains is not the point. going into a zone below breakeven > point or not is the main focus. > > Hope somebody gives me a starting code lines. > I prefer a fixed static line for entry and breakeven and target. > Once the trade is over i restart again > with another stock. > once longtrade code is set, we will do opposite for short trade code lines. > (entry > For entry I used price above ema13 and ema13 sloping upwards at an angle of > above 45 degrees and to 90degrees.manual judging) > > > thanks > regards > ford > > > > ------------------------------------ > > **** 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 >