indiTraders - Forum for the Active Indian Trader  

Go Back   indiTraders - Forum for the Active Indian Trader > Technical > Indicators & Systems

Indicators & Systems Compendium of Code

GFDL
Reply
 
Bookmark and Share LinkBack Thread Tools Display Modes
  #91 (permalink)  
Old 06-03-2012, 11:05 AM
alex alex is offline
indiTraders VIP
 
Join Date: Mar 2009
Location: Mumbai
Posts: 4,928
Thanks: 14,925
Thanked 13,265 Times in 4,255 Posts
alex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond repute
alex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond repute
Default

Originally Posted by bharatk8 View Post
See BT reports.One report is for 365 days(Days in a year)another report is for 220 days(approx.number of trading days in a year).Why does annual return% and net return% differ?

See all trades figures, those are different, that change all calculations, furthermore anual rate of return counts non working days as well i.e. total number of days in year so obviously figures will be different.
__________________
The essence of mathematics is not to make simple things complicated, but to make complicated things simple.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #92 (permalink)  
Old 06-03-2012, 01:16 PM
bharatk8 bharatk8 is offline
Addicted
 
Join Date: Jan 2010
Posts: 267
Thanks: 209
Thanked 114 Times in 65 Posts
bharatk8 will become famous soon enoughbharatk8 will become famous soon enough
Default

BT for 365 days consist of non working days too.But net profit is 77.94% while annual return is 34.82% for same period.Why?
Originally Posted by alex View Post
anual rate of return counts non working days as well i.e. total number of days in year so obviously figures will be different.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #93 (permalink)  
Old 06-03-2012, 08:54 PM
alex alex is offline
indiTraders VIP
 
Join Date: Mar 2009
Location: Mumbai
Posts: 4,928
Thanks: 14,925
Thanked 13,265 Times in 4,255 Posts
alex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond repute
alex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond repute
Default

Originally Posted by bharatk8 View Post
BT for 365 days consist of non working days too.But net profit is 77.94% while annual return is 34.82% for same period.Why?

Net profit% is percent of netprofit /turnover, and annual return is percentage of netpofit on your investment over period of time. Those two are different things. If you increase or decrease your capital and/or time span annual return figure will change but it's not necessarily mean that net profit percentage will change, simply put net profit is imp figure than annual return as it can vary with change in capital & time, but to increase net profit or netprofit % one need to have improved strategy.
__________________
The essence of mathematics is not to make simple things complicated, but to make complicated things simple.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following 2 Users Say Thank You to alex For This Useful Post:
  #94 (permalink)  
Old 07-03-2012, 06:48 AM
bharatk8 bharatk8 is offline
Addicted
 
Join Date: Jan 2010
Posts: 267
Thanks: 209
Thanked 114 Times in 65 Posts
bharatk8 will become famous soon enoughbharatk8 will become famous soon enough
Default

Scrips found during Exploration are different than scrips found during Back testing.Is there any thing wrong with settings?

P.S I am not able to load .ABS file(Settings)
Attached Images
File Type: png EXPLO.PNG (50.6 KB, 5 views)
File Type: png BT.PNG (69.3 KB, 4 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #95 (permalink)  
Old 07-03-2012, 09:17 AM
alex alex is offline
indiTraders VIP
 
Join Date: Mar 2009
Location: Mumbai
Posts: 4,928
Thanks: 14,925
Thanked 13,265 Times in 4,255 Posts
alex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond repute
alex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond repute
Default

Originally Posted by bharatk8 View Post
Scrips found during Exploration are different than scrips found during Back testing.Is there any thing wrong with settings?

P.S I am not able to load .ABS file(Settings)

I can only tell about Multicharts or MatLab, saw your platform in the post it's Amibroker, might be other Amibroker users would help you out. Also it's good idea to check system in live markets for few days to get an idea how it take trades.
__________________
The essence of mathematics is not to make simple things complicated, but to make complicated things simple.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following User Says Thank You to alex For This Useful Post:
  #96 (permalink)  
Old 07-03-2012, 09:26 AM
alex alex is offline
indiTraders VIP
 
Join Date: Mar 2009
Location: Mumbai
Posts: 4,928
Thanks: 14,925
Thanked 13,265 Times in 4,255 Posts
alex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond repute
alex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond repute
Default

One thing is very important to understand in back testing is that it has an advantage of hindsight and that's why it's easy to fall into curve fitting trap. Best way to avoid it is, paper trade the backtested system for a week and then compare the backtest results of the week with paper trades, should match exactly except slippages.This will give rough idea that how much slippage should add so we can expect more realistic performance.
__________________
The essence of mathematics is not to make simple things complicated, but to make complicated things simple.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following 4 Users Say Thank You to alex For This Useful Post:
  #97 (permalink)  
Old 14-03-2012, 07:35 PM
alex alex is offline
indiTraders VIP
 
Join Date: Mar 2009
Location: Mumbai
Posts: 4,928
Thanks: 14,925
Thanked 13,265 Times in 4,255 Posts
alex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond repute
alex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond repute
Default

Slippage and commissions are very important factors in backtesting.
Results will be more accurate if slippage and commissions added first and then started the evaluation process. Because in optimization results can be easily improved by increasing the frequency of trading, if slippage & commissions would have been added results will be totally different.
Also came across one interesting point about slippage, smaller the size of the scrip more will be the risk of loss due to slippage. This is mainly because smallest size of the tick is mostly 5 paise. ( I think only exception is ETFs )
Simple comparison - To buy 1 nifty if added minimum 1 tick as slippage then amount loss would be 5 paise for one leg of trad and when we sell it total loss for 1 trade will be 10paise. For one contract slippage will be 50*10 = 500 that is 5rs. That's our slippage per trade for nifty contract. If NF last closing price is 5000 then value of the portfolio is 250000.

Now consider ashokleyland(AL) as small scrip, say last closing price is 30, minimum slippage that is 1 tick will be 5 paise so to complete 1 trade for 1 share of AL will be 10 paise same as nifty, but huge difference is to execute the same amount of portfolio value we need to buy more shares of AL.. Approximately 830 shares so that portfolio value will be 250000. 10 paise * 830 = 8300 that is whopping 83 rs as mere slippage for 1 trade!!
And if some one tried to execute complex option strategy which usually needs two or three legs position can bleed significantly without any mistake.
If the strategy backtested on only nifty future and some one tried it on ashokleyland no wonder same system can produce big losses.
__________________
The essence of mathematics is not to make simple things complicated, but to make complicated things simple.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following 2 Users Say Thank You to alex For This Useful Post:
  #98 (permalink)  
Old 14-03-2012, 08:47 PM
no1lives4ever no1lives4ever is offline
Newbie
 
Join Date: Jul 2009
Posts: 1,944
Thanks: 5,149
Thanked 2,951 Times in 1,257 Posts
no1lives4ever has much to be proud ofno1lives4ever has much to be proud ofno1lives4ever has much to be proud ofno1lives4ever has much to be proud ofno1lives4ever has much to be proud ofno1lives4ever has much to be proud ofno1lives4ever has much to be proud ofno1lives4ever has much to be proud ofno1lives4ever has much to be proud ofno1lives4ever has much to be proud ofno1lives4ever has much to be proud ofno1lives4ever has much to be proud ofno1lives4ever has much to be proud ofno1lives4ever has much to be proud of
Default

Another thing to consider is the ability to execute the trade. It is next to impossible to execute trade at the closing price or opening price in our markets.

One way to get past this problem of execution is to apply a formula like the following, which will take care of both execution delay and slippage:

. If trading eod, then use the intraday price of the entry bar and if your strategy calls for a market at open order, then consider executing the order at the most unfavourable price in the first 5min candle. Typically you will get a better execution.

. If strategy calls for a entry at a signal price using a sl order, then assume a reasonable slippage. E.g. for something like current month nifty future, a 1 point slippage is a decent starting point for any breakout based strategy. This figure will need to be calibrated based on live orders using this given strategy in the real market or using past experience with order execution. Another slightly more difficult to code method would be to use 1 min data and then execute at the most unfavourable price during the 1min candle which triggers entry, irrespective of the timeframe in which you are actually trading. Using smaller than 1 min candles will not necessarily get you a more realistic result.

. If it is an intraday strategy that calls for a entry at market price then take into consideration the delay between signal bar and entry. I would consider the most unfavourable price from the next 5 min bar after signal bar for any intraday system irrespective of the actual candle duration used for the backtesting. This is unless you can execute real fast and if you have data feed with zero lag.

. Assume similar rules for exit.

Now when you start backtesting with something as severe as this, you will notice that a large number of formerly profitable strategies turn unprofitable. I would personally not consider a strategy tradeable in the real world without applying some similar form of slippage.

Besides slippage, one must also calculate brokerage and take that into account. Applying brokerage is easy with most software.

-- no1lives4ever
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following 3 Users Say Thank You to no1lives4ever For This Useful Post:
  #99 (permalink)  
Old 14-03-2012, 10:52 PM
alex alex is offline
indiTraders VIP
 
Join Date: Mar 2009
Location: Mumbai
Posts: 4,928
Thanks: 14,925
Thanked 13,265 Times in 4,255 Posts
alex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond repute
alex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond reputealex has a reputation beyond repute
Default

Rightly said N1LF ... One of the biggest reason that most break out strategies fail in longer run is because lack of better execution, especially executed on penny stocks with higher tick size. Orders which are market orders are always prone for slippage. Opposite to market orders there are stop orders which enter in the market at predefined price, with this type of order slippage is almost negligible. But the problem with popular break outs is every one is looking at that specific price to break so no guaranty that order going to fill at your stop order.
To get around with this is other method. Enter at retrace after break out, your risk is that you may miss the bus. But one author tested it and suggested that it gives better results compare to market orders. ( Encyclopedia of trading strategies by Jeffery Katz .) Furthermore he observed that break out strategies work well on currencies compare to other volatile markets which mostly because 'v' shape rallies, gaps and slippage.
__________________
The essence of mathematics is not to make simple things complicated, but to make complicated things simple.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following 3 Users Say Thank You to alex For This Useful Post:
  #100 (permalink)  
Old 15-03-2012, 10:06 PM
no1lives4ever no1lives4ever is offline
Newbie
 
Join Date: Jul 2009
Posts: 1,944
Thanks: 5,149
Thanked 2,951 Times in 1,257 Posts
no1lives4ever has much to be proud ofno1lives4ever has much to be proud ofno1lives4ever has much to be proud ofno1lives4ever has much to be proud ofno1lives4ever has much to be proud ofno1lives4ever has much to be proud ofno1lives4ever has much to be proud ofno1lives4ever has much to be proud ofno1lives4ever has much to be proud ofno1lives4ever has much to be proud ofno1lives4ever has much to be proud ofno1lives4ever has much to be proud ofno1lives4ever has much to be proud ofno1lives4ever has much to be proud of
Default

I have seen slippage of 10pts and more when using a stop market order with nf while trading breakouts. In one case it was a nasty 20 pt slippage during a suddern spike that reversed within 5 mins!!! The reason for the spike was release of iip or some other such number.

So market stop or even regular market order can kill you if you are trying to trade a breakout strategy when the market seems to have a huge number of resting stop orders.

-- no1lives4ever
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following User Says Thank You to no1lives4ever For This Useful Post:
Reply

indiTraders - Forum for the Active Indian Trader > Technical > Indicators & Systems


Tags
backtest, backtesting, evaluation, mechanical system, money management, past performance, system

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


GFDL

All times are GMT +5.5. The time now is 07:19 AM.


vBulletin Copyright by vBulletin

Content Relevant URLs by vBSEO 3.3.2