backtesting framework required...

#1
dear all,
i need a skeleton or a standard code for backtesting which includes the folloing

it should have option to close position by end of day ... or carry forward.. as per our choice..
it should have trailing stoploss and max. loss lock ..
it should have buy sell short and cover conditions as per our choice.. i mean we can modify it .. to test it with various combinations ..
it should have option like how much fix equity how much brokerage etc... if someone has it .. please let me know ..