Help needed - plz Add BUy sell - Urgent

#13
In the second image , the start and close time are the same.

Which are these two scrips?
If you are using for Crudeoil, it will obviously be wrong.You have to change the time settings for commodities

Yes sir .. im doing mcx trade and i have tested in mcx crude oil ...... :(:(:( .. all pic are in same script sir ...

what i have to do for rectify this sir ?:confused::confused:

anything has to be changed in properties sir ?
 

amitrandive

Well-Known Member
#14
Yes sir .. im doing mcx trade and i have tested in mcx crude oil ...... :(:(:( .. all pic are in same script sir ...

what i have to do for rectify this sir ?:confused::confused:

anything has to be changed in properties sir ?
Revised code for commodities.
Start time : 10:05
Close time : 23:55

Try now this for commodities and let me know.


Code:
TimeRange = ParamToggle("Time","No|Yes");
Starttime = Param("Starttime",100500,100500,235500,0);
Closetime = Param("Closetime",235500,100500,235500,0);
ExitToday = (Ref(DateNum(),1) > DateNum());

 _SECTION_BEGIN("Buy Sell");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = EncodeColor(colorRed)+ "www.bstarplus.com " + 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() );

tO = TimeFrameGetPrice("O", inDaily);

BA=ceil((tO*.236/100)+tO);
DayO = TimeFrameGetPrice("O", inDaily);

SB=ceil(tO-(tO*.236/100));
DayO = TimeFrameGetPrice("O", inDaily);

BT1=ceil((tO*.455/100)+tO);
DayO = TimeFrameGetPrice("O", inDaily);


ST1=ceil(tO-(tO*.455/100));
DayO = TimeFrameGetPrice("O", inDaily);

BT2=ceil((tO*.786/100)+tO);
DayO = TimeFrameGetPrice("O", inDaily);


ST2=ceil(tO-(tO*.786/100));
DayO = TimeFrameGetPrice("O", inDaily);

BT3=ceil((tO*1/100)+tO);
DayO = TimeFrameGetPrice("O", inDaily);


ST3=ceil(tO-(tO*1/100));
DayO = TimeFrameGetPrice("O", inDaily);

BB=ceil(BA+3);
DayO = TimeFrameGetPrice("O", inDaily);

SS=ceil(SB-3);
DayO = TimeFrameGetPrice("O", inDaily);

Plot(BA, "BUY ABOVE",colorGreen,styleLine);
Plot(SB, "SELL BELOW",colorRed,styleLine);
Plot(to, "Daily open",colorBlack,styleDots+styleNoLine);
Plot(BB, "BB",colorYellow,styleLine);
Plot(SS, "SS",colorYellow,styleLine);
Plot(BT1, "BUY TARGET1",colorBlue,styleLine+styleNoTitle);
Plot(ST1, "SELL TARGET1",colorDarkRed,styleLine|styleNoTitle);
Plot(BT2, "BUY TARGET2",colorBlue,styleLine|styleNoTitle);
Plot(ST2, "SELL TARGET2",colorDarkRed,styleLine|styleNoTitle);
Plot(BT3, "BUY TARGET3",colorBlue,styleLine|styleNoTitle);
Plot(ST3, "SELL TARGET3",colorDarkRed,styleLine|styleNoTitle);
Plot(BB, "BB",colorYellow,styleNoLine);
//Buy=C>BA;
//Sell=C<SB;
//Buy = ExRem( Buy, Sell );
//Sell = ExRem( Sell, Buy ); 
B1 =C>BA;
S1 = C<SB;
Sh1 = C<SB;
Co1 = C>BA;
Buy = IIf(TimeRange==False,B1,B1 AND TimeNum() > Starttime AND TimeNum() < Closetime);
Sell = IIf(TimeRange==False,S1,S1 OR TimeNum() > Closetime OR ExitToday);
Short = IIf(Timerange==False,Sh1,Sh1 AND TimeNum() > Starttime AND TimeNum() < Closetime);
Cover = IIf(Timerange==False,Co1,Co1 OR TimeNum() > Closetime OR ExitToday);
Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);
Short=ExRem(Short,Cover);
Cover=ExRem(Cover,Short);
//PlotShapes(IIf(Buy==1, shapeUpArrow , shapeNone), colorGreen, 0,Low, Offset=-20);
//PlotShapes(IIf(Sell==1, shapeStar, shapeNone), colorRed, 0,High, Offset=30);
//PlotShapes(IIf(Short==1, shapeDownArrow, shapeNone), colorRed, 0,High, Offset=-20);
//PlotShapes(IIf(Cover==1, shapeStar, shapeNone), colorGreen, 0,Low, Offset=-30);
//PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorGreen, 0, L, Offset=-40);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorLime, 0,L, Offset=-50);                      
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-45); 
PlotShapes(IIf(Cover, shapeSquare, shapeNone),colorLime, 0,L, Offset=-50);                      
PlotShapes(IIf(Cover, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-45);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorRed, 0, H, Offset=40);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorOrange, 0,H, Offset=50);                      
PlotShapes(IIf(Sell, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-45);
PlotShapes(IIf(Short, shapeSquare, shapeNone),colorRed, 0, H, Offset=40);
PlotShapes(IIf(Short, shapeSquare, shapeNone),colorOrange, 0,H, Offset=50);                      
PlotShapes(IIf(Short, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-45);
//shape =Buy * shapeUpArrow +Sell * shapeDownArrow;
//PlotShapes( shape, IIf(Buy, colorLime, colorRed ), 0, IIf(Buy, Low, High));

Filter=Buy OR Sell;
AddColumn(Close,"CMP ",1.2);
AddColumn(Buy,"Buy",1.0);
AddColumn(Sell,"Sell",1.0);

_SECTION_END();
 
#15
amit sir , what if we want to take our trade if it is strong one , i mean if it breaks our buy/short citeria in time 9.20 to 10.00 .
if trade trigger in this time range than we take trade otherwise soh .
on nifty it is not fruitful .......
any other system u recommend for nifty , amit sir .
 
#16
Revised code for commodities.
Start time : 10:05
Close time : 23:55

Try now this for commodities and let me know.


Code:
TimeRange = ParamToggle("Time","No|Yes");
Starttime = Param("Starttime",100500,100500,235500,0);
Closetime = Param("Closetime",235500,100500,235500,0);
ExitToday = (Ref(DateNum(),1) > DateNum());

 _SECTION_BEGIN("Buy Sell");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = EncodeColor(colorRed)+ "www.bstarplus.com " + 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() );

tO = TimeFrameGetPrice("O", inDaily);

BA=ceil((tO*.236/100)+tO);
DayO = TimeFrameGetPrice("O", inDaily);

SB=ceil(tO-(tO*.236/100));
DayO = TimeFrameGetPrice("O", inDaily);

BT1=ceil((tO*.455/100)+tO);
DayO = TimeFrameGetPrice("O", inDaily);


ST1=ceil(tO-(tO*.455/100));
DayO = TimeFrameGetPrice("O", inDaily);

BT2=ceil((tO*.786/100)+tO);
DayO = TimeFrameGetPrice("O", inDaily);


ST2=ceil(tO-(tO*.786/100));
DayO = TimeFrameGetPrice("O", inDaily);

BT3=ceil((tO*1/100)+tO);
DayO = TimeFrameGetPrice("O", inDaily);


ST3=ceil(tO-(tO*1/100));
DayO = TimeFrameGetPrice("O", inDaily);

BB=ceil(BA+3);
DayO = TimeFrameGetPrice("O", inDaily);

SS=ceil(SB-3);
DayO = TimeFrameGetPrice("O", inDaily);

Plot(BA, "BUY ABOVE",colorGreen,styleLine);
Plot(SB, "SELL BELOW",colorRed,styleLine);
Plot(to, "Daily open",colorBlack,styleDots+styleNoLine);
Plot(BB, "BB",colorYellow,styleLine);
Plot(SS, "SS",colorYellow,styleLine);
Plot(BT1, "BUY TARGET1",colorBlue,styleLine+styleNoTitle);
Plot(ST1, "SELL TARGET1",colorDarkRed,styleLine|styleNoTitle);
Plot(BT2, "BUY TARGET2",colorBlue,styleLine|styleNoTitle);
Plot(ST2, "SELL TARGET2",colorDarkRed,styleLine|styleNoTitle);
Plot(BT3, "BUY TARGET3",colorBlue,styleLine|styleNoTitle);
Plot(ST3, "SELL TARGET3",colorDarkRed,styleLine|styleNoTitle);
Plot(BB, "BB",colorYellow,styleNoLine);
//Buy=C>BA;
//Sell=C<SB;
//Buy = ExRem( Buy, Sell );
//Sell = ExRem( Sell, Buy ); 
B1 =C>BA;
S1 = C<SB;
Sh1 = C<SB;
Co1 = C>BA;
Buy = IIf(TimeRange==False,B1,B1 AND TimeNum() > Starttime AND TimeNum() < Closetime);
Sell = IIf(TimeRange==False,S1,S1 OR TimeNum() > Closetime OR ExitToday);
Short = IIf(Timerange==False,Sh1,Sh1 AND TimeNum() > Starttime AND TimeNum() < Closetime);
Cover = IIf(Timerange==False,Co1,Co1 OR TimeNum() > Closetime OR ExitToday);
Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);
Short=ExRem(Short,Cover);
Cover=ExRem(Cover,Short);
//PlotShapes(IIf(Buy==1, shapeUpArrow , shapeNone), colorGreen, 0,Low, Offset=-20);
//PlotShapes(IIf(Sell==1, shapeStar, shapeNone), colorRed, 0,High, Offset=30);
//PlotShapes(IIf(Short==1, shapeDownArrow, shapeNone), colorRed, 0,High, Offset=-20);
//PlotShapes(IIf(Cover==1, shapeStar, shapeNone), colorGreen, 0,Low, Offset=-30);
//PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorGreen, 0, L, Offset=-40);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorLime, 0,L, Offset=-50);                      
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-45); 
PlotShapes(IIf(Cover, shapeSquare, shapeNone),colorLime, 0,L, Offset=-50);                      
PlotShapes(IIf(Cover, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-45);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorRed, 0, H, Offset=40);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorOrange, 0,H, Offset=50);                      
PlotShapes(IIf(Sell, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-45);
PlotShapes(IIf(Short, shapeSquare, shapeNone),colorRed, 0, H, Offset=40);
PlotShapes(IIf(Short, shapeSquare, shapeNone),colorOrange, 0,H, Offset=50);                      
PlotShapes(IIf(Short, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-45);
//shape =Buy * shapeUpArrow +Sell * shapeDownArrow;
//PlotShapes( shape, IIf(Buy, colorLime, colorRed ), 0, IIf(Buy, Low, High));

Filter=Buy OR Sell;
AddColumn(Close,"CMP ",1.2);
AddColumn(Buy,"Buy",1.0);
AddColumn(Sell,"Sell",1.0);

_SECTION_END();


:thumb::thumb: Done sir ... Working perfect ... Tons of Thanks ... Great ... plz suggest ur idea if any for getting nice result in trade sir ..
 

amitrandive

Well-Known Member
#17
amit sir , what if we want to take our trade if it is strong one , i mean if it breaks our buy/short citeria in time 9.20 to 10.00 .
if trade trigger in this time range than we take trade otherwise soh .
on nifty it is not fruitful .......
any other system u recommend for nifty , amit sir .
SDL

The above AFL works on the break of previous day high and previous day low.
Unless Nifty is trending , this AFL will not give you good results.

Most of the days Nifty is sideways , so need to find a sideways strategy.
Nothing works perfectly, even I got hit in today's sideways market.
 

amitrandive

Well-Known Member
#18
:thumb::thumb: Done sir ... Working perfect ... Tons of Thanks ... Great ... plz suggest ur idea if any for getting nice result in trade sir ..
bluesquare

I do not trade commodities.But , I can tell you that you need to find one strategy as per your risk appetite and stick to it with discipline.

Sometimes change that strategy with your experiences.
 
#19
bluesquare

I do not trade commodities.But , I can tell you that you need to find one strategy as per your risk appetite and stick to it with discipline.

Sometimes change that strategy with your experiences.


Yeah sir ... u r right ... any ways u did great job today for me .... very thank full sir .. :thumb::thumb::clapping::clapping::clapping::clapping:
 
#20
bluesquare

I do not trade commodities.But , I can tell you that you need to find one strategy as per your risk appetite and stick to it with discipline.

Sometimes change that strategy with your experiences.

Dear sir ....


i need another help in this coding ....

1 ) Actually some times after buy/sell signal appears trend reverse and touches the black line stop loss line ( " to " in code formula ) and again traveling to my target ..... so plz code according again buy / sell signal appears after trend gets revers after touching black ( " to " ) stoploss line sir ...






2 ) secondly i need to draw another Dot line which should be 10 points from the closing price of buy / sell signal candle ...





plz do favor sir ... :)

Thanks ...
 

Similar threads