Creating a trading system from scratch

How many lines of code you are comfortable with


  • Total voters
    61
btw one small request can you add targets to order book because many times by end of the day the downside cools down n i end up making less profits or sometimes loss
 
What universe do you use? Can you show the cell with universe and also the excel sheet?
Screenshot (28).png

The excel sheet which you provided
It works fine with backtest only I get usecols do not match names...but it shows backtest results
In live, it shows division by zero error and the file doesn't get generated and shows QTY, not in index error
 
Last edited:

VJAY

Well-Known Member
No

Thats what i m saying except the Nifty50 sheet all the other sheet like niftynext50 is giving me this error and banknifty as well
confussing !!!!!!!!!!
 

UberMachine

Well-Known Member
View attachment 28879
The excel sheet which you provided
It works fine with backtest only I get usecols do not match names...but it shows backtest results
In live, it shows division by zero error and the file doesn't get generated and shows QTY, not in index error
Got it.
One which @VJAY cracked earlier.
The present version is downloading preopen data only for NIFTY50.
Change nifty.json to all.json in fetch_preopen_data function in utils.py
See a few threads back for the reference
 

UberMachine

Well-Known Member
btw one small request can you add targets to order book because many times by end of the day the downside cools down n i end up making less profits or sometimes loss
I cannot add targets to the system because
  1. Each target may hit a different time; so this makes our backtesting unreliable
  2. There may be cases where both target and stop loss may be hit; with end of day data we aren't sure which hit first
  3. Most of the time you are better off closing all the stocks at the end of the day but there were a few cases (including today) where exiting midday would give you better profits
This is something close to what you see is what you get system. If the differences are large, then there is something wrong with our strategy or execution.

Having said all this. you can provide a negative value to STOP_LOSS such as -2 to treat it as a profit but there would be no stop loss and we never know our max drawdown.
 

VJAY

Well-Known Member
I cannot add targets to the system because
  1. Each target may hit a different time; so this makes our backtesting unreliable
  2. There may be cases where both target and stop loss may be hit; with end of day data we aren't sure which hit first
  3. Most of the time you are better off closing all the stocks at the end of the day but there were a few cases (including today) where exiting midday would give you better profits
This is something close to what you see is what you get system. If the differences are large, then there is something wrong with our strategy or execution.

Having said all this. you can provide a negative value to STOP_LOSS such as -2 to treat it as a profit but there would be no stop loss and we never know our max drawdown.
Yes system must be simple ...if we put targets then its not simple...as who cancell stop orders ?if not cancelled and hit its like new trades ....One can exit if see any good profits in midday....but sure you need to cancell sl orders also :)
 
I cannot add targets to the system because
  1. Each target may hit a different time; so this makes our backtesting unreliable
  2. There may be cases where both target and stop loss may be hit; with end of day data we aren't sure which hit first
  3. Most of the time you are better off closing all the stocks at the end of the day but there were a few cases (including today) where exiting midday would give you better profits
This is something close to what you see is what you get system. If the differences are large, then there is something wrong with our strategy or execution.

Having said all this. you can provide a negative value to STOP_LOSS such as -2 to treat it as a profit but there would be no stop loss and we never know our max drawdown.
i saw those replies thats why i m asking you after changing utils
Screenshot (29).png
is this right?
 

Similar threads