Dear Nagarjuna,
I am using this method for Trade Nifty Future in Intraday. Time Frame : 15 Min. If I get buy signal I will take 2 Lots in Nifty Future. I will Close 1 lot at Every 25 Points+ and Another 1 lot I will hold till 3.29 p.m.
Suppose I booked Ist lot in 25 points+. After that If I get sell signal I will Close that 1 lot Long Position & I will go Short 2 lots Nifty @ Sell Signal. Here also same first I will book one lot @ 25 Points Profit and another 1 Lot I will hold till 3.29 p.m..
Stop Loss :
For Buy : In Uptrend, Which Candle high Breake Pre.Candle High (Here We will get Buy Signal) I will put SL @ That Pre.Candle Low Value - 3 Points.
For Sell : In downtrend, Which Candle Low Break Pre. Candle Low (Here We will get Sell Signal) I will Put SL @ That Pre.Candle High Value + 3 Points .
In which Candle We get Buy or Sell Signal, I will use SL That Pre.Candle H/L value +/- 3 Points. I dont Modify this SL for Each Candle H/L .
One More Condition:
I will use this concept only for Intraday not for delivery. So everyday we should close all the position before market end. Another Day Morning We should get Fresh Signal. So we should add here one more condition If we get buy or Sell signal, We must check here Pre.Candle and Current Candle Date also Should be the Same Date. This will help to Avoid Continuing Yesterday's Signal.
One More Request Can You give your code with Add of this above Condition with SL? and I am trying to write this same concept for Metastock Expert. Can you help to this also?
Please check this
// Logic for uptrend or downtrend
uptrend= IIf( StochK(39,3) > StochD(39,3,3), 1, 0 );
downtrend=IIf( StochK(39,3)<StochD(39,3,3), 1, 0 );
// The current bar should be more than previous bar value + 5 points for buy in uptrend
BuyV = uptrend AND Ref(uptrend, -1) AND (H > ( Ref(H, -1) + 5));
// the current bar should be less than previous bar value - 5 points for sell in downtrend
SellV = downtrend AND Ref(downtrend,-1) AND (L > ( Ref(L, -1) - 5));
// Bars since previous buy or sell signal.
BuySB = BarsSince(Ref(BuyV,-1));
SellSB= BarsSince(Ref(SellV,-1));
// Check the time interval between bars
TInterval = 15 ; // In minutes
TimeFine = iif( timenum() - ref(timenum(),-1) < TInterval* 100 * 2,1,0);
// We can signal buy only if previous signal was a sell.
Buy = BuyV AND BuySB > SellSB;
// We can signal sell only if previous signal was a buy.
Sell = SellV AND BuySB < SellSB ;
//Cover = Buy ;
//Short = Sell ;
_SECTION_BEGIN("Smart Trader");
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() );
PlotShapes( shapeUpArrow * Buy, colorGreen,0,L,-12);
PlotShapes( shapeDownArrow * Sell, colorRed,0,H,-12);
_SECTION_END();
thank you
nagarjuna