File size: 3,990 Bytes
443a71d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d41ed21
443a71d
 
 
 
d41ed21
443a71d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e7ad843
0a2d353
 
e7ad843
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ef66daf
e7ad843
 
 
 
 
 
 
443a71d
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
from pydantic import BaseModel, ConfigDict, Field
from typing import Any, List


## Search Model
class Stock(BaseModel):
    ID: str
    title: str
    NSE_Symbol: str
    contract_id: str

search_response_example = {
        "ID": "zomato-ltd",
        "title": "Zomato Ltd.",
        "NSE_Symbol": "ZOMATO",
        "contract_id": "GSTK543320"
}


## LTP Model
class LTP(BaseModel):
    ltp: float

ltp_response_example = {
   "ltp" : 209.50
}


## Historical Data
class HISTORICAL(BaseModel):
    data: List[dict]

historical_response_example = {
  "data": [
    {
      "Date": "2024-06-24T09:15:00+05:30",
      "Open": 193.9,
      "High": 194.84,
      "Low": 192.02,
      "Close": 194.15,
      "Volume": 2767062
    },
    {
      "Date": "2024-06-24T09:30:00+05:30",
      "Open": 194.14,
      "High": 194.2,
      "Low": 192.8,
      "Close": 193.97,
      "Volume": 4066133
    }
  ]
}


## Historical Data
class CHAIN(BaseModel):
    ltp: float
    expiry: str
    data: List[dict]

chain_response_example = {
  "ltp": 52000.01,
  "expiry": "BANKNIFTY24703",
  "data": [
    {
      "Symbol_CE": "BANKNIFTY2470351600CE",
      "OI_CALL": 3347,
      "CALL": 676.8,
      "strikePrice": 51600,
      "PUT": 43.3,
      "OI_PUT": 61530,
      "Symbol_PE": "BANKNIFTY2470351600PE"
    },
    {
      "Symbol_CE": "BANKNIFTY2470351700CE",
      "OI_CALL": 4870,
      "CALL": 585.55,
      "strikePrice": 51700,
      "PUT": 56.45,
      "OI_PUT": 66516,
      "Symbol_PE": "BANKNIFTY2470351700PE"
    },
  ]
}


## News Data
class NEWS(BaseModel):
    data: List[dict]

news_response_example = {
  "data": [
    {
      "title": "Karnataka's new gig worker draft bill: Why Morgan Stanley is 'overweight' on Zomato",
      "summary": "NSE Morgan Stanley has maintained an overweight rating on Zomato with a target price of ₹235 per share.",
      "url": "https://www.cnbctv18.com/market/karnataka-new-draft-gig-worker-bill-zomato-shares-price-stock-morgan-stanley-target-overweight-19436697.htm",
      "pubDate": "2024-07-02T09:38:15",
      "source": "CNBC TV18",
      "companyName": "Zomato",
      "symbol": "ZOMATO",
      "blogUrl": "https://www.cnbctv18.com/market/karnataka-new-draft-gig-worker-bill-zomato-shares-price-stock-morgan-stanley-target-overweight-19436697.htm",
      "topics": "Regulatory and Legal"
    },
    {
      "title": "Zomato Shares Touch An All-Time High After ESOP Plan Gets Shareholders’ Nod",
      "summary": "Shares of Zomato reached an all-time high of INR 209.75 apiece during Tuesday’s intraday trading session The price surge in the stock came after Zomato said it has secured approval from its shareholders to grant",
      "url": "https://inc42.com/buzz/zomato-shares-touch-an-all-time-high-after-esop-plan-gets-shareholders-nod/",
      "pubDate": "2024-07-02T07:36:51",
      "source": "Inc42",
      "companyName": "Zomato",
      "symbol": "ZOMATO",
      "blogUrl": "https://inc42.com/buzz/zomato-shares-touch-an-all-time-high-after-esop-plan-gets-shareholders-nod/",
      "topics": "Financial Results"
    }
  ]
}


## Signal Model
class SIGNAL(BaseModel):
    data: dict

signal_response_example = {
  "data": {
    "signal_status": True,
    "strike": 24350,
    "option_type": "CE",
    "entry_price": 99.5,
    "stoploss": 88,
    "index_candle": {
      "Date": "2024-07-08T15:15:00+05:30",
      "Open": 24311.6,
      "High": 24344.25,
      "Low": 24301.5,
      "Close": 24331.05,
      "RSI": 60.153783549430166,
      "Prev_RSI": 56.04770925328034,
      "Signal": 1,
      "Option": 24350,
      "direction": "CE",
      "symbol": "NIFTY2471124350CE"
    },
    "symbol_candle": {
      "Date": "2024-07-08T15:15:00+05:30",
      "Open": 94.45,
      "High": 99.5,
      "Low": 88,
      "Close": 95.2,
      "Volume": 57868625
    }
  }
}

## get all stocks
class ALL(BaseModel):
    data: str
    
    
all_response_example = {
  "data": '''[{\"isin\":\"INE002A01018\",\"growwContractId\":\"GSTK500325\"'''
}