linkon's breakout system

linkon7

Well-Known Member
#1
I always wanted to trade in options and was developing a method for the same. I would appreciate comments from all the seniors here so that i can work on my strategy and hopefully make it better and more workable.

I'll post my progress here and hope to benefit from the comments of my fellow member of this forum.

Strategy : Wait for the breakout of nifty in a direction and continue to hold the position till stop loss hits. System is made up of a band placed 0.001%

confirmation : RSI - guppy gives a confirmation of the trend.

Lots : 2

Target1: 168% of the pivot range
Target2: 268% of the pivot range.

Operation : buying a bulls spread or a bear spread.

Stop loss : when price hits the Kijun line

Investment : about 30 K per lot

Profit target : about 5 K per lot.
 

linkon7

Well-Known Member
#3
Code for the system...


Code:
_SECTION_BEGIN("Simple Pivot based Trading System");

// User defined parameters.

GraphXSpace = 10; //defines how much extra space should be added above and below graph line (in percent).

dist = 0.25*ATR(10); 
Capital=Param("Total capital",100000,10000,1000000,1000);
drawdown=Param("Max. loss per trade as % of Capital", 1.0,0.5,25.0,0.1);
room=Param("Room for S/L as % of Pivot value",0.001,0.001,0.02,0.001);

// Now calculate pivots. Method courtesy : Kenneth (www.traderji.com)

PH= ValueWhen(
(Ref(H,-2) > Ref(H, -4)) AND
(Ref(H,-2) > Ref(H, -3)) AND
(Ref(H,-2) > Ref(H, -1)) AND
(Ref(H,-2) > H), Ref(H,-2));

PL= ValueWhen(
(Ref(L,-2) <= Ref(L, -4)) AND
(Ref(L,-2) <= Ref(L, -3)) AND
(Ref(L,-2) <= Ref(L, -1)) AND
(Ref(L,-2) <= L), Ref(L,-2));

// filter lines

phfilter=PH+(room*PH);
plfilter=PL-(room*PL);

//Uncomment following code if you wish to see the pivot lines.
//Plot(Ref(PH,2), "UpPivot", ParamColor("UpPivot Color",colorRed), styleDashed);
//Plot(Ref(PL,2), "DownPivot",ParamColor("DownPivot Color",colorGreen), styleDashed);

Plot(Ref(Phfilter,2), "Upfilter", ParamColor("upfilter Color",colorRed), styleLine);
Plot(Ref(Plfilter,2), "Downfilter",ParamColor("dnfilter Color",colorGreen), styleLine);


//Plot(Ref(UpFractal,2), "Up Fractal", ParamColor("Up Fractal Color",colorRed),8);
//Plot(Ref(DownFractal,2), "Down Fractal",ParamColor("Down Fractal Color",colorGreen),8);



/* 
for (a=4;a<BarCount;a++)
{
if ((H[a-2] >= H[a-4]) AND
(H[a-2] >= H[a-3]) AND
(H[a-2] >= H[a-1]) AND
(H[a-2] >= H[a]))
PlotText("PH \n"+H[a-2], a-2, H[a-2], colorGreen);

if ((L[a-2] <= L[a-4]) AND
(L[a-2] <= L[a-3]) AND
(L[a-2] <= L[a-1]) AND
(L[a-2] <= L[a]))
PlotText("PL \n"+L[a-2], a-2, L[a-2]-dist[a-2], colorRed);
}
*/
//Condition for buy : Enter when Close crosses latest pivot high.
Buy = C> (PH+(room*PH));

initialStopBuy=Ref(PL,2)-(Ref(PL,2)*room/100);
trailStopBuy=IIf(C>PH,Ref(initialStopBuy,-1),initialStopBuy);

newStopBuy=trailStopBuy;

BuyLimitCapital=int(Capital/C);
SLbuy=round(C-initialStopBuy);
BuyLimitSL=int((Capital*drawdown)/(100*SLbuy));

//Condition for sell : Exit when previous pivot low is cracked.
Sell = C< (PL-(room*PL));

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

//Short = Sell;
//Cover = Buy;

//Short=ExRem(Short,Cover);
//Cover=ExRem(Cover,Short);

shape = Buy * shapeUpArrow + Sell * shapeDownArrow;
PlotShapes( shape, IIf( Buy, colorGreen, colorRed ),0, IIf( Buy, Low, High ) );


_SECTION_END();
/*
Q=Param("% Change",0.2,0.1,10,0.1);
Z= Zig(C ,q ) ;
HH=((Z<Ref(Z,-1) AND Ref(Z,-1) > Ref(Z,-2)) AND (Peak(z,q,1 ) >Peak(Z,q,2)));
LH=((Z<Ref(Z,-1) AND Ref(Z,-1) > Ref(Z,-2)) AND (Peak(Z,q,1 ) <Peak(Z,q,2)));
HL=((Z>Ref(Z,-1) AND Ref(Z,-1) < Ref(Z,-2)) AND (Trough(Z,q,1 ) >Trough(Z,q,2)));
LL=((Z>Ref(Z,-1) AND Ref(Z,-1) < Ref(Z,-2)) AND (Trough(Z,q,1 ) <Trough(Z,q,2)));
GraphXSpace = 5;
dist = 0.5*ATR(20); 

for( i = 0; i < BarCount; i++ ) 
{ 
if( HH[i] ) PlotText( "HH  \n"+Ref(H[i],-1), i, H[ i ]+dist[i], colorBlack,colorGreen );
if( LH[i] ) PlotText( "SAR \n"+Ref(H[i],-1), i, H[ i ]+dist[i], colorBlack, colorRed ); 
if( HL[i] ) PlotText( "SAR \n"+Ref(L[i],-1), i, L[ i ]-dist[i], colorBlack, colorGreen );
if( LL[i] ) PlotText( "LL  \n"+Ref(L[i],-1), i, L[ i ]-dist[i], colorBlack,colorRed );

}
*/

SL = ( HHV( H, 26 ) + LLV( L, 26) )/2;
TL = ( HHV( H, 9 ) + LLV( L, 9 ) )/2;
Plot (TL, "Stop line", colorYellow,styleThick); 
Plot (SL, "K line", colorWhite,styleThick); 

breakeven = Param ("brokerage",2,0,500,0.05);


risk_long = PH -SL-breakeven;
risk_short = SL - PL-breakeven;
range = PH-PL;
key = range / 2;
Short_tgt1 = PL- range*1.68;
Short_tgt2 = PL- range*2.68;
Long_tgt1 = PH + range*1.68;
Long_tgt2 = PH + range*2.68;

Color_buy = IIf (Close > sl AND Close > TL, colorBlue, IIf (Close < sl AND Close < TL,colorRed,colorYellow));
PlotOHLC( Open, High, Low, Close, "", Color_buy, styleBar ); 


 Title = EncodeColor(colorWhite)+ "LINKON'S PIVOT SYSTEM" + " - " +  Name() + " - " + EncodeColor(colorRed)+ Interval(2) + EncodeColor(colorWhite) +
 "  - " + Date() +" - "+"Op-"+O+"  "+"Hi-"+H+"  "+"Lo-"+L+"  "+ "Cl-"+C+"  "+ "Vol= "+ WriteVal(V) + WriteIf ( V > MA(V,26),EncodeColor(colorGreen)+"  UP "+ ((V/MA(V,26))*100-100) + " %", EncodeColor(colorRed)+"  DOWN "+ ((100- V/MA(V,26)*100)) + " %")
+ EncodeColor(colorRed)+   "\n Pivot High : "+ EncodeColor(colorWhite)+PH+EncodeColor(colorRed)+ "  Place LONG    Trigger at :"+EncodeColor(colorWhite)+ phfilter + EncodeColor(colorRed)+ "   SL of :"+ EncodeColor(colorWhite)+SL+ EncodeColor(colorRed)+ "    Risk of " + EncodeColor(colorWhite)+risk_long
+ EncodeColor(colorYellow)+ "\n Long Target of : "+Long_tgt1 +"  and second target of :" + Long_tgt2   
+ "\n"
+ EncodeColor(colorGreen)+ "\n Pivot  Low : "+EncodeColor(colorWhite)+PL+EncodeColor(colorGreen)+"  Place SHORT Trigger at :"+ EncodeColor(colorWhite)+plfilter + EncodeColor(colorGreen)+"   SL of :"+ EncodeColor(colorWhite)+SL+ EncodeColor(colorGreen)+"    Risk of " + EncodeColor(colorWhite)+risk_short
+ EncodeColor(colorYellow)+ "\n Short Target of : "+short_tgt1 +"  and second target of :" + short_tgt2   
;
 

linkon7

Well-Known Member
#4
Position taken :

Bought 2 lots of 4500 Call Aug @ 110.70
sold 2 lots of 4600 call Aug @ 73.20

current price : 4500 call aug = 116.8, 4600 call aug = 76.10


difference = 110.70-73.20 = 37.5
current difference = 116.80-76.10 = 40.7

profit = 40.7 - 37.5 = 3.2
 

linkon7

Well-Known Member
#5
guppy of rsi 21,
Code for the confirmation :

Code:
_SECTION_BEGIN("RSI");
  
a = Param("rsi", 21, 2, 90, 1, 10 );
b1 = Param("period1", 3, 2, 300, 1, 10 );
b2 = Param("period2", 33, 2, 300, 1, 10 );


COLORRSI= IIf (EMA( RSI(a), 3 )>Ref(EMA( RSI(a), 3 ),-1), colorGreen,colorRed);
COLORRSI1= IIf (EMA( RSI(a), 33 )>Ref(EMA( RSI(a), 33 ),-1), colorBlue,colorDarkBlue);


//Plot( RSI( 21), "", colorWhite, styleThick  );
Plot( EMA( RSI(a), 3 ),  "",colorYellow, styleThick, styleNoLabel ); 
Plot( EMA( RSI(a), 4 ),  "",colorRSI, styleNoLabel); 
Plot( EMA( RSI(a), 5 ),  "",colorRSI, styleNoLabel); 
Plot( EMA( RSI(a), 7 ),  "",colorRSI, styleNoLabel); 
Plot( EMA( RSI(a), 9 ),  "",colorRSI, styleNoLabel); 
Plot( EMA( RSI(a), 11 ),  "",colorRSI, styleNoLabel); 
Plot( EMA( RSI(a), 13 ),  "",colorRSI, styleNoLabel); 
Plot( EMA( RSI(a), 15 ),  "",colorRSI, styleNoLabel); 
Plot( EMA( RSI(a), 17 ),  "",colorRSI, styleNoLabel); 
Plot( EMA( RSI(a), 19 ),  "",colorRSI, styleNoLabel); 
Plot( EMA( RSI(a), 21 ),  "",colorOrange, styleThick, styleNoLabel); 

Plot( EMA( RSI(a), 33 ),  "",colorAqua, styleThick, styleNoLabel ); 
Plot( EMA( RSI(a), 36 ), "", COLORRSI1,  styleNoLabel ); 
Plot( EMA( RSI(a), 40 ),  "",COLORRSI1,  styleNoLabel ); 
Plot( EMA( RSI(a), 44 ),  "",COLORRSI1,  styleNoLabel ); 
Plot( EMA( RSI(a), 50 ),  "",COLORRSI1,  styleNoLabel ); 
Plot( EMA( RSI(a), 55 ),  "",COLORRSI1,  styleNoLabel); 
Plot( EMA( RSI(a), 60 ),  "",COLORRSI1,  styleNoLabel); 
Plot( EMA( RSI(a), 65 ),  "",COLORRSI1,  styleNoLabel ); 
Plot( EMA( RSI(a), 70 ),  "",COLORRSI1,  styleNoLabel); 
Plot( EMA( RSI(a), 75 ),  "",colorGreen, styleThick , styleNoLabel); 


 
ST_buy = Cross(EMA( RSI(a), b1 ), EMA( RSI(a), b2 ));
ST_Sell = Cross(EMA( RSI(a), b2 ), EMA( RSI(a), b1 ));

//w= Param("Timing Tool", 31, 2, 300, 1, 10 );
//r = Param("period", 5, 2, 300, 1, 10 );



//MT_buy = Cross(CCI(w), EMA( CCI(w), r ));
//MT_Sell = Cross(EMA( CCI(w), r ), CCI(w));


//PlotShapes(shapeSmallCircle, COLORRSI1);

PlotShapes(shapeUpTriangle * ST_buy, colorWhite);
PlotShapes(shapeDownTriangle * ST_Sell, colorWhite);

//PlotShapes(shapeSmallUpTriangle * MT_buy, colorGreen);
//PlotShapes(shapeSmallDownTriangle * MT_Sell, colorGreen);





// 5 crosses 21 : short term 
_SECTION_END();
 

AW10

Well-Known Member
#6
Linkon, appreciate that u are trying to design an option trading system here. All the best.

I think on of the important consideration for options system is the selection of strike and right strategy.. Keeping in mind the objective.
You can use TA to form the view about the market and get trading bias but that's where TA's job is over and you have to wear the hat of option trader from now on.
My observation on the spread that u have selected - 4500-4600 Bullish Call spread @ cost of 37. Max value that this spread can achieve is 100, and that's too when
1) you hold this till expiry and
2) market expires above 4600.
If mkt goes above 4600 before expiry, the spread will not be worth 100 because of the time value component of the option.
Max profit potential is 100 - 37 = 63 points. On two contract, i.e. 6300 rs.

Compare this with the 4200-4300 Call spread . At closing price today, it was available at net price of 57 rs (i.e. =281 - 224 ). The spread is already deep in the money.
There is very high probability of mkt closing above 4300 (look at the huge built up of puts at 4300 and 4400).. So you have much higher probability of this strike giving u full value of
100 (i.e. profit of 43 rs) then your spread which still have to see the light of the day. With each passing day, OTM spreads will have lesser probability of getting into the Green whereas the probability of ITM
spread keeps going up with each passing day..

Hope you are able to see my point here.. The trade off of both spreads from options traders mindset will be
trade 1 = 63 rs profit on the risk of 37 but low probability of success
trade 2 = 43 rs profit on the risk of 57 but much higher probability of success

Another points is important to notice with Spreads is that they are slow moving trade. Ex. in 45-4600 spread to gain 63pts market needs to move 150 points and stay there for next 15 days. They are ideal for laid back trading but doesn't give that fast pace action of daytrading NF on 5 min chart. Trading Deep ITM spreads is my favourite strategy for limited risk income generation. I know that we are on different path to same destination of financial freedom and I found spreads a perfect strategy that fits towards that goal.

Hope you have checked out my thread on "Low risk option trading ...." where I have written a lot about spreads.
Hope you won't mind me posting the link to this post there so that people can benefit from it in future as well.

Happy Trading
 

linkon7

Well-Known Member
#8
Linkon, appreciate that u are trying to design an option trading system here. All the best.

I think on of the important consideration for options system is the selection of strike and right strategy.. Keeping in mind the objective.
You can use TA to form the view about the market and get trading bias but that's where TA's job is over and you have to wear the hat of option trader from now on.
My observation on the spread that u have selected - 4500-4600 Bullish Call spread @ cost of 37. Max value that this spread can achieve is 100, and that's too when
1) you hold this till expiry and
2) market expires above 4600.
If mkt goes above 4600 before expiry, the spread will not be worth 100 because of the time value component of the option.
Max profit potential is 100 - 37 = 63 points. On two contract, i.e. 6300 rs.

Compare this with the 4200-4300 Call spread . At closing price today, it was available at net price of 57 rs (i.e. =281 - 224 ). The spread is already deep in the money.
There is very high probability of mkt closing above 4300 (look at the huge built up of puts at 4300 and 4400).. So you have much higher probability of this strike giving u full value of
100 (i.e. profit of 43 rs) then your spread which still have to see the light of the day. With each passing day, OTM spreads will have lesser probability of getting into the Green whereas the probability of ITM
spread keeps going up with each passing day..

Hope you are able to see my point here.. The trade off of both spreads from options traders mindset will be
trade 1 = 63 rs profit on the risk of 37 but low probability of success
trade 2 = 43 rs profit on the risk of 57 but much higher probability of success

Another points is important to notice with Spreads is that they are slow moving trade. Ex. in 45-4600 spread to gain 63pts market needs to move 150 points and stay there for next 15 days. They are ideal for laid back trading but doesn't give that fast pace action of daytrading NF on 5 min chart. Trading Deep ITM spreads is my favourite strategy for limited risk income generation. I know that we are on different path to same destination of financial freedom and I found spreads a perfect strategy that fits towards that goal.

Hope you have checked out my thread on "Low risk option trading ...." where I have written a lot about spreads.
Hope you won't mind me posting the link to this post there so that people can benefit from it in future as well.

Happy Trading
Thanks a lot for the insight. My Intention with the spread was to close the 4600 call tomorrow and ride the 4500 call assuming we have a positive day tomorrow. My innitial intention was to go for a covered call but later shifted to this spread.

I always wanted to be a options trader. I enjoy the huge possibility that's options offer. Sometimes, lack of capital becomes a big deterrent. Trading nifty intraday has been a rich experience. Making me think in a split second and this has made me realise how a bad decision can effect my trading psyche. Its a roller coaster ride that i enjoy only on the day i make a good profit. When given sufficient time to go over various indications, i think i can make a better decisions. Hence this decision to shift to 15 min / 30 min tf.

Options is your avenue and i hope to learn a lot from you. I am going though your thread about options spread. I hope to wear the option traders cap from now on. Guidance from you will help a lot in speeding up the learning curve...
 

linkon7

Well-Known Member
#9


Activity today :

market opened gap up and made a low of 26 and a high of 49. 26 was breached and we made a new day's low at 16 and when 49 was breached, it looked like market was not going to fill the gap today.

At the end of the day,
I shifted to a higher spread...

1. reversed the 4600 call short to a long at 123
2. exited the 4500 call long at 185
3. shorted 4700 call at 85

so the standing is as follows:
4500 call bought at 110 sold at 185 = profit of 75 points
4600 call sold at 73 covered at 123 = loss of 50 points
gross profit = 25
minus brokerage = 25 - 2 = 23 points

new spread
long on 4600 call at 123 now trading at 136
short on 4700 call at 85 now trading at 87

difference while initiating = 123 - 85 = 38
present price difference = 136-87 = 49

unrealized profit = 49-38 = 11
realised profit = 23
 

linkon7

Well-Known Member
#10

Activity today (14th Aug'09):

market opened slightly down and remained choppy though out the day. RSI-guppy was showing the change in sentiments and closed decisively in favour of the bears.

At the end of the day,

I shifted to a bear spread...

1. exited the 4600 call long at 117
2. exited the 4700 call short at 60
3. shorted 4400 put at 54.5
4. long on the 4500 put at 75.5

so the standing is as follows:

4600 call bought at 123 sold at 117 = loss of 6 points
4700 call sold at 85 covered at 60 = gain of 15 points
gross profit = 15-6 = 9
minus brokerage = 9 - 2 = 7 points

new spread

short on 4400 put at 54.5 now trading at 50.5
long on 4500 put at 75.5 now trading at 84

difference while initiating = 75.5 - 54.5 = 21
present price difference = 84-50.5 = 33.5

unrealized profit = 33.5-21 = 12.5
realised profit = 23 +7 = 30
 
Thread starter Similar threads Forum Replies Date
linkon7 Options 170
linkon7 AmiBroker 129
VJAY Options 10
linkon7 Options 36
linkon7 Day Trading 477

Similar threads

Broker Special Offers

Intraday Higher Leverage

Save up to 90% in brokerage and get higher leverage for intraday trades.

Name:Phone:
Email:City:
State:
Are you a day trader?