this is the pivot based buy-sell afl code
i need it to be edited for perfect buy sell trading for auto trading
so plz someone help me sir
i need to make it buy signal at the moment when it touches buy target with green candle, same for sell when it touches sell target with red candle.
next i need to remember todays first made buy or sell signal not repeat same buy or sell signal.only to make a reverse sell or buy signal when it reaches it.
also it has problem at start of day it showing buy/sell signal on yesterday target before calulating todays target. need to avoid it.
hope u experienced gentlemen guys can help me easily.
i need it to be edited for perfect buy sell trading for auto trading
so plz someone help me sir
i need to make it buy signal at the moment when it touches buy target with green candle, same for sell when it touches sell target with red candle.
next i need to remember todays first made buy or sell signal not repeat same buy or sell signal.only to make a reverse sell or buy signal when it reaches it.
also it has problem at start of day it showing buy/sell signal on yesterday target before calulating todays target. need to avoid it.
hope u experienced gentlemen guys can help me easily.
Code:
SetPositionSize( 2000, spsShares ); // 2000 shares by default
_SECTION_BEGIN("camarilla levels");
//---- pivot points
DayH = TimeFrameGetPrice("H", inDaily, -1); // yesterdays high
DayL = TimeFrameGetPrice("L", inDaily, -1); // low
DayC = TimeFrameGetPrice("C", inDaily, -1); // close
DayO = TimeFrameGetPrice("O", inDaily,-1); // current day open
if ( True )
{
A = Optimize("X",Param("A",0.17,0.1,1,0.01),0.1,1,0.01);
R = DayH - DayL; // range
PP = (DayH + DayL +DayC+DayO)/4;
R1 = PP + (R * A);
S1 = PP - (R * A);
BT=R1+4*(R1-PP);
ST=S1-4*(PP-S1);
}
Plot(R1, "",colorGreen,styleStaircase);
Plot(S1, "",colorGreen,styleStaircase);
Plot(PP, "",colorBlue,styleDots+styleNoLine);
Plot(BT, "",colorBlue,styleDots+styleNoLine);
Plot(ST, "",colorBlue,styleDots+styleNoLine);
//----
Title = Name()+" SIMPLE PIVOT & FIBO"+Date()+ EncodeColor(colorRed)+" Long Breakout above "+WriteVal(R1,1.2)+"\n"+EncodeColor(colorRed)+" Short breakout below "+WriteVal(S1,1.2)
;
Filter=1;
AddColumn(C,"cmp",1.2);
AddColumn(R1,"R4",1.2);
AddColumn(S1,"S4",1.2);
AddColumn(PP,"UP",1.2);
_SECTION_END();
Buy=Cover=Cross (C, R1);
Sell=Short= Cross (S1 ,C);
// plot arrows
shape = Buy * shapeUpArrow + Short * shapeDownArrow;
PlotShapes( shape, IIf( Buy, colorGreen, colorRed ), 0, IIf( Buy, Low, High ) );
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );