Creating a trading system from scratch

How many lines of code you are comfortable with


  • Total voters
    61

ncube

Well-Known Member
Just one question why care about profits main thing is decreasing drawdowns and increasing sharpe ratio na profits will come....n second point is about weights....why give equal weights to all...by doing 1000s of simulation we can optimize the weights and sharpe ratio there by increasing the chances of profitability....so shouldn't monte carlo simulation be concentrated toward maximizing sharpe ratio then maximizing profits...???
The objective of montecarlo simulation is not for optimizing the strategy parameters. Its used to test the stability of the strategy. Strategy creation & optimization should be done before running the montecarlo simulation. Once we have the strategy results available either through historical or walk-forward testing we can run MC simulation on this data. What this test does is simply shuffle the order of the strategy trades in each iteration and measure the performance. It helps us decide what is the probability of going bust using this strategy....i.e if we consider the max drawdown for a strategy to be 25% then MC simulation will give us a probability of the strategy having 25% drawdown.

For example the strategy we are discussing here has just 15% probability of going below 25% drawdown with 3% SL. Hope its clear.
 

UberMachine

Well-Known Member
The objective of montecarlo simulation is not for optimizing the strategy parameters. Its used to test the stability of the strategy. Strategy creation & optimization should be done before running the montecarlo simulation. Once we have the strategy results available either through historical or walk-forward testing we can run MC simulation on this data. What this test does is simply shuffle the order of the strategy trades in each iteration and measure the performance. It helps us decide what is the probability of going bust using this strategy....i.e if we consider the max drawdown for a strategy to be 25% then MC simulation will give us a probability of the strategy having 25% drawdown.

For example the strategy we are discussing here has just 15% probability of going below 25% drawdown with 3% SL. Hope its clear.
Nice explanation. Fully agree. No optimization after the results; create a new strategy then.
We can only improve in trade execution.
And for the most paranoid, just find your top 5 results and bottom 5 results to see how you fare. (Remove the top 5 results and expect the bottom 5 results to happen in the first 5 days)
We can still fail after doing all these things but atleast we can try this again.
 
Sure. The greater the stop loss, the greater the overall profit (upto 7%).
All trades are not executed. In fact, there is a case open=high which doesn't get executed 90% of the time and it takes away 40% of my total profits.
Removing it from results also gives me decent returns, provided I am brutally disciplined with execution.
One of my objectives is to create an extremly simple library based on the above framework.
Its under development here and I believe it would add a statistical edge to the existing frameworks.
Just wanted to ask the rapid series which you are creating is it a new strategy or this same strategy with added indicators and multiple universe and so on??
 

VJAY

Well-Known Member
Once I release the open source library, you can run these sort of simulations within this framework easily.
We would soon be moving this notebook to script for better effectiveness so that each can build their own strategies.
For non-programmers, I would provide an excel template so that you can fill in the necessary details and the backtest does the rest. :)
That would be great UB.......its new era in traderji
 
Once I release the open source library, you can run these sort of simulations within this framework easily.
We would soon be moving this notebook to script for better effectiveness so that each can build their own strategies.
For non-programmers, I would provide an excel template so that you can fill in the necessary details and the backtest does the rest. :)
once finished i have a bunch of strategies(not mine) based on pairs trading and Fibonacci support and resistance which i m finding it hard to retrofit it in current framework.....Hope @UberMachine and @VJAY and @ncube will help
 
Last edited:

VJAY

Well-Known Member
once finished i have a bunch of strategies(not mine) based on pairs trading and Fibonacci support and resistance which i m finding it hard to retrofit it in current framework.....Hope @UberMachine and @VJAY and @ncube will help
Dear vinit,
Remove my name from it :DD:DD:DD:DDI am totally zero and dumb in this coding.....only came to know this when ncube started the pair thread ...otherwise even not know what is this notebook!!!!! after that UB came he gave more on it ...am still not able to do anything on it ...only know copy paste :):)
 

VJAY

Well-Known Member
Dear UB,
Today I noticed one error....some data missing in my backtest report as marked in image...though bhavcopy of these missing dates are showin in DATA folder ....please look it

1538532403419.png
 

VJAY

Well-Known Member
Dear UB,
Today I noticed one error....some data missing in my backtest report as marked in image...though bhavcopy of these missing dates are showin in DATA folder ....please look it

View attachment 29040
But when I exported this result to excel this missing data showing on it ..so may be its hiding data :)

1538532934684.png
 

UberMachine

Well-Known Member
Just wanted to ask the rapid series which you are creating is it a new strategy or this same strategy with added indicators and multiple universe and so on??
Its a framework for strategies which enter and exit at specified time periods with stop loss included. So you can make a strategy on your own based on volume or delivery or anything

once finished i have a bunch of strategies(not mine) based on pairs trading and Fibonacci support and resistance which i m finding it hard to retrofit it in current framework.....Hope @UberMachine and @VJAY and @ncube will help
I think support and resistance go well with the framework. But pairs trading require a different approach, working on it :up:
 

Similar threads