@Tanmaya - If you are getting Atp (average trading price) from the exchance through the live feed, that vwap for you. incase you are not, you could calculate it using pandas_ta or ta. look for the function ta.vwap or similar. I cited the code in the…
Btw, for Anchored Vwap with Dev bands. the above code should work. I would need a little bit more details as to what you plan to do and how as there are more signal level calc that is reqd. Call me on 95-sev en-3522388 (only if you need more guidanc…
say you have OHLC from kite live stream. Now do the following ....
import pandas_ta as pta
1. df["vwap"]=pta.vwap(df.High, df.Low, df.Close, df.Volume)
2. df["stdd"]=pta.stdev(df.Close, 20) # def window = 30 (choose as per your req)
3. for i in …
Le bhai tu bhi yaad rakhio apne dua mein ...
def TrailStoploss(df, atr_period=14, hhv_period=10, multiplier=2.5, ATRinDF=False):
"""
This function calculates the trailing SL based on ATR and Multiplier set.
"""
# Calculate A…
I faced this and more today again (5-Dec-2023). I had placed in GTT based SL @ 10% and the price went down but GTT didnt hit till i manually had to terminate the algo and exit the trade. stop at 30% instead of 10%. How to handle such events (was thi…