Simple Coding Help - No Promise.

_SECTION_BEGIN("visual arrow ema cross over");
SetChartOptions(0,chartShowArrows|chartShowDates);
Plot( Close, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );


for(i=1; i < BarCount; i++)
{

Buy = IIf(H > 800 , 1 , 0);
PlotShapes(IIf(Buy==1, shapeUpArrow , shapeNone), colorGreen, 0,Low, Offset=-15);

Sell = IIf(L <720 , 1 , 0);
PlotShapes(IIf(Sell==1, shapeDownArrow, shapeNone), colorRed, 0,High, Offset=-15);

}
_SECTION_END();



Please correct my syntax
"Buy = ......"
"Sell = ......"

I want to buy a stock when it goes above 800 and sell when goes below 720
in the same form using loop


Thanx in advance


Use this


Code:
_SECTION_BEGIN("visual arrow ema cross over");
SetChartOptions(0,chartShowArrows|chartShowDates);
Plot( Close, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 

Buy = Cross(C,800);
Sell = Cross(720,C);

PlotShapes(IIf(Buy==1, shapeUpArrow , shapeNone), colorGreen, 0,Low, Offset=-15);
PlotShapes(IIf(Sell==1, shapeDownArrow, shapeNone), colorRed, 0,High, Offset=-15);
_SECTION_END();

Happy :)
 

XRAY27

Well-Known Member
Hello Friends

I am logging on to TJ after ages . . . .

Feels nice to see this thread still going strong . . . due to helping nature of few members.

Specially need to mention Pratap, thanks buddy . . .

Also Abhig10 . . . Great going . . .

Have not read everything . . . thanks to all those who are helping . . .

I will still not be able to participate on this thread, but intend to get back to FTT by mid April . . .

Happy :)
Happy sirji

iam felling happy seeing your post's...pratap sir has helped to a large extent for afl query in between...:)
 

pratapvb

Well-Known Member
Happy sirji

iam felling happy seeing your post's...pratap sir has helped to a large extent for afl query in between...:)
Mastermind and others too. And then nehal and abhig took it up. So credit goes to many
 
This code plot all circle for all Peak of Zig according to code in ZigZag_2 (blue line):

ZigZag_2 = Zig(C,6);
Plot(ZigZag_2,"ZigZag_2",colorBlue,styleLine);

war1_2 = ZigZag_2 > Ref( (HHV (ZigZag_2,1)),-1);
war2_2 = Ref(ZigZag_2,1)<ZigZag_2;
szczyt_2 = war1_2 AND war2_2 AND ZigZag_1 != ZigZag_2;
PlotShapes(szczyt_2*shapeCircle,colorBlue,0,H,8);


I would like to plot only circle for Peak of Zig which is the frist befor Peak of Zig of Zig(C,20) (white line).
...So I woulike to plot only Circle for B point.

I hope it's clear what I mean.
 

Attachments

maybe code for white Zig is also necessary:

ZigZag_1 = Zig(C,20);
war1 = ZigZag_1 > Ref( (HHV (ZigZag_1,1)),-1);
war2 = Ref(ZigZag_1,1)<ZigZag_1;
szczyt = war1 AND war2;

Could somebody help please ?
 

XRAY27

Well-Known Member
Mastermind and others too. And then nehal and abhig took it up. So credit goes to many
sorry i have not named them..

sir,
i want value for trend line at start and end.is it possible
 

pratapvb

Well-Known Member
sorry i have not named them..

sir,
i want value for trend line at start and end.is it possible
I mentioned the Study function that is available....you should be able to do something with that....other than that I don't know much on this
 

amitrandive

Well-Known Member


Hello

Just posted a 5 minutes chart on Pratap's thread,
its better to post the code, before I start getting AFL requests for it, :)

Code:
st = Param("UP strength",0.5,0.5,5,0.5);
wk = Param("DN strength",0.5,0.5,5,0.5);

_SECTION_BEGIN("Nishant's Code from Amibroker Library");
No_of_Bars = 	BarCount - 1;
PL1 = LastValue(Trough(L,wk,2)); 							PL2 = LastValue(Trough(L,wk,1));
UB1 = No_of_Bars - LastValue(TroughBars(L,wk,2)); 		UB2 = No_of_Bars - LastValue(TroughBars(L,wk,1));  
UpTrendLine = LineArray(UB1,PL1,UB2,PL2,1);				UTLine = LineArray(UB1,PL1,UB2,PL2,0);

PH1 = LastValue(Peak(H,st,2)); 							PH2 = LastValue(Peak(H,st,1)); 
DB1 = No_of_Bars - LastValue(PeakBars(H,st,2)); 		DB2 = No_of_Bars - LastValue(PeakBars(H,st,1));  
DownTrendLine = LineArray(DB1,PH1,DB2,PH2,1);			DTLine = LineArray(DB1,PH1,DB2,PH2,0);

Plot( UpTrendLine , "", colorGreen,styleLine | styleNoTitle |styleNoLabel|styleNoRescale); 
Plot( UTLine ,"", colorGreen,styleLine | styleNoTitle | styleNoLabel|styleNoRescale); 

Plot( DownTrendLine ,"", colorRed,styleLine | styleNoTitle |styleNoLabel|styleNoRescale); 
Plot( DTLine ,"", colorRed,styleLine | styleNoTitle |styleNoLabel|styleNoRescale);
	
Plot(LineArray( DB2-20, PH2, BarCount,PH2, 0 ),"",colorGreen,styleNoRescale,0,0,20);
Plot(LineArray( UB2-20, PL2, BarCount,PL2, 0 ),"",colorRed,styleNoRescale,0,0,20);

PlotText(" HH ", LastValue(BarIndex())+5,PH2+2, colorRed);
PlotText(" LL ", LastValue(BarIndex())+5,PL2+2, colorGreen);
PlotOHLC(DownTrendLine,UpTrendLine,DownTrendLine,UpTrendLine ,"",ColorRGB(20,50,20),styleCloud|styleNoLabel);
	
_SECTION_END();

like to mention that the code is publicly posted on Amibroker Library
few years back, by some Nishant, all thanks go to him *. . .

Happy :)
Happy Sir

Chart is compressed, nothing is visible after including price.:confused:
 

pratapvb

Well-Known Member

Similar threads