Thanks its working fine now.
EMA 20 is correct but EMA 200 is not calculating correctly for 5 min candle. please check once.
Thanks its working fine now.
EMA 20 is correct but EMA 200 is not calculating correctly for 5 min candle. please check once.
Hi @Udaycontact ,
Bracket order placement will be available in further sessions
Hi @Vasili_Prasad
The code in folder 3.1 is same same file that you are using.
Video 3.1 is for the traders who have not upgraded their codebase and still working on webscokets to get ltp.
Hi @abhaynarayan27
for open source Backtesting use below link : Open Source Backtesting – Google Drive
tsl.get_intraday_data was a old method to get historical data… it gives data only for today, which makes problem if we want to create indicators on it.
Dhanhq was upgraded and now we can use get_historical_data which gives data for last 5 working days.
Retrieve historical or intraday data:
Get Historical Data
data = tsl.get_historical_data(tradingsymbol='NIFTY', exchange='INDEX', timeframe="DAY")
data = tsl.get_historical_data(tradingsymbol='ACC', exchange='NSE', timeframe="1")
Hi @Subhajitpanja ,
Elaborate about the query.
Upto high level understanding, the instrument file will be downloaded once in a day when programs starts freshly for that day and is read whenever program is restarted during the day.
Okay Sir. Thank You very much for clarification.
Hi @rahulcse56 ,
EMA 200 requires at least 200 candles for accurate calculation. Do check the number of candles present in your dataframe before proceeding to calculate.
Thanks sir
Dear sir
how to backtest my algo code ,please suggest step by step process…
@Tradehull_Imran Sir,
Below line is showing in terminal, although there is no existence of that file in my source folder(which already shared as image). I will try to run it again on Market days and let you know the output
reading existing file all_instrument 2025-02-07.csv
Thank you sir
Sir pre open ka data kaise aaega… my strategy based on pre open volatility . help me this. if there is no method to get pre open data then i will mannualy give it to my algo.
yes i have checked the last 200 candles are present in the historical data. although EMA200 value of 5 min candle is not coming correctly.
Hello @Tradehull_Imran Sir,
entry_order_id = trade_hull.order_placement(tradingsymbol=call_at_the_money,
exchange='NFO',
quantity=lot_size,
price=0,
trigger_price=0,
order_type='MARKET',
transaction_type='BUY',
trade_type='MIS')
stop_loss_order_id = trade_hull.order_placement(tradingsymbol=call_at_the_money,
exchange='NFO',
quantity=lot_size,
price=sell_price,
trigger_price=trigger_stop_loss,
order_type='STOPLIMIT',
transaction_type='SELL',
trade_type='MIS')
average_buy_price = trade_hull.get_executed_price(entry_order_id)
traded_stocks[stock] = {
'Option': call_at_the_money,
'Quantity': lot_size,
'Stop_Loss': trigger_stop_loss,
'Average_buy_price': average_buy_price,
'Stop_loss_order_id': stop_loss_order_id
}
Sir I want to loop over a stock list, and on a loop fill information for that stock in a dictionary.
after placing an order, we want the average buy price
average_buy_price = trade_hull.get_executed_price(entry_order_id)
Do I need time sleep between the order placing and calling its average traded price? Or is it fast enough to immediately get it?
if we need the time sleep, what minimum amount could I put, without slowing the code down ?
Hi @Dhananjay_Umalkar ,
You can call average price immediately.
I want to get the day’s first candle based on 5 min.
For ex,
chart = tsl.get_historical_data('NIFTY FEB FUT', 'NFO', "5")
Not sure which values to pick?
To get first candle of the day use the below code:
first_candle = chart[chart['timestamp'].dt.date == datetime.datetime.now().date()].iloc[0]
mac operating systems ka link chahiya need