Plot Buy/Sell signals on chart

#12
Hi praveen, from last 2 days I am trying to write buy on Up Green arrow and Sell on Red Arrow.

But not getting desired results.

Buy signal not come exactly at same point. It is always come one or day ahead.

What I do?

Can u plz me out.

thanks in advance
Hi,

I really didn't know what that AFL is doing. I just went through where its plotting Green and Red arrows.

I think those arrows are just pivotal points. Anyway I just inserted Buy and Sell on those points. Please make sure you understood the AFL, and what was the original buy and sell criteria.

Here is the code snipper which you can replace:

Code:
// -- OK, let's plot the pivots using arrows

PlotShapes(IIf(aHPivs==1, shapeDownArrow, shapeNone), colorRed, 0,High, Offset=-8);
Sell = IIf(aHPivs==1, 1, 0);

PlotShapes(IIf(aLPivs==1, shapeUpArrow , shapeNone), colorGreen, 0, Low, Offset=-8);
Buy = IIf(aLPivs==1, 1, 0);
 

chintan786

Well-Known Member
#13
Hi,

I really didn't know what that AFL is doing. I just went through where its plotting Green and Red arrows.

I think those arrows are just pivotal points. Anyway I just inserted Buy and Sell on those points. Please make sure you understood the AFL, and what was the original buy and sell criteria.

Here is the code snipper which you can replace:

Code:
// -- OK, let's plot the pivots using arrows

PlotShapes(IIf(aHPivs==1, shapeDownArrow, shapeNone), colorRed, 0,High, Offset=-8);
Sell = IIf(aHPivs==1, 1, 0);

PlotShapes(IIf(aLPivs==1, shapeUpArrow , shapeNone), colorGreen, 0, Low, Offset=-8);
Buy = IIf(aLPivs==1, 1, 0);

No Sir, not working

shows error when I scan in Ln148.

One person on another forum has given this to me:-

_SECTION_BEGIN("Buy/Sell Conditions");
Cond1 = Close < 2.00; /*Change to whatever price range you're scanning for */
Cond2 = Volume > MA(Volume,10); /*Change to whatever period your looking at applying to the volume */
Cond3 = Volume > 500000; /*Change to whatever minimum volume to apply to scan */

Buy = aLPivs==1 AND Cond1 AND Cond2 AND cond3 AND StrLen(Name())==3; /* strlen is number of letters in stock symbol */
Sell = aHPivs==1 AND StrLen(Name())==3; /* strlen is number of letters in stock symbol */
Filter = Buy OR Sell;


ExRem(Buy,Sell);
ExRem(Sell,Buy);

AddColumn(Buy,"buy",1.0);
AddColumn(Volume,"volume");
AddColumn(Avg,"avg");
AddColumn(Close,"close");
_SECTION_END();

but tht also shows error when I scan.

I don't understand where we are wrong.

I have code for Buy/sell purely on the basis of Pivot Points:---


/*Pivot Point Reversals Automatic Analysis
by Larry Lovrencic*/

buy=ref(L,-1)<ref(L,-2) AND ref(L,-1)<L AND C>ref(H,-1);
sell=ref(H,-1)>ref(H,-2) AND ref(H,-1)>H AND C<ref(L,-1);


I tried to merge this with Hulk.
Again not getting desired results.

wht to do next??????
 
#14
Chintan,

Before using this AFL, try to understand what that AFL does. If you are able to understand it, then it would be easier to write missing AFLs.

As I'd said earlier, I didn't go through the full AFL and its logic behind it. I tried to check the AFL once again, and its not showing any syntax errors for me.

If you still face the problem, you may attach that AFL as such and we may try our best here.

Regards,
Praveen.
 
#15
hello again,
First of all I want to thank to bpraveen for his best effort.Kindly guide me how can I plot the lines joining the buy sell point or these can be shown as candle sticks.
Thanx a lot
Hi,

I didn't understand your first question. You mean you want the bars where buy/sell signal is there, to be displayed as candles? Please explain it clearly.

Regarding displaying the bars as Candle, you should use styleCandle instead of styleBar in the Plot() funtion.

There are lots of other styles which you can use to plot the data in n number of different ways. Below is an excerpt from Amibroker User Guide:

style is a combination of one or more of following values:

styleLine = 1 - normal (line) chart (default)
styleHistogram = 2 - histogram chart
styleThick =4 - fat (thick)
styleDots = 8 - include dots
styleNoLine = 16 - no line
styleDashed = 32 - dashed line style
styleCandle = 64 - candlestick chart
styleBar = 128 - traditional bar chart
styleNoDraw = 256 - no draw (perform axis scaling only)
styleStaircase = 512 - staircase (square) chart
styleSwingDots = 1024 - middle dots for staircase chart
styleNoRescale = 2048 - no rescale
styleNoLabel = 4096 - no value label
stylePointAndFigure = 8192 - point and figure
(new in 4.20):
styleArea = 16384 - area chart (extra wide histogram)
styleOwnScale = 32768 - plot is using independent scaling
styleLeftAxisScale = 65536 - plot is using left axis scale (independent from right axis)
styleNoTitle - do not display values of this plot in the chart title
styleCloud - cloud style (area between high and low arrays) - to be used with PlotOHLC function
styleClipMinMax - clip (do not paint) area between min and max levels - note this style is incompatible with printers and WMF (metafiles).

Hope this helps,
Praveen.
 

Similar threads