This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def order_status(self, **dat): | |
try: | |
status_codes = ['COMPLETE', 'REJECTED', | |
'CANCELED', 'TRIGGER_PENDING'] | |
dat['fn'] = self.order_status | |
orders = pd.DataFrame(self.obj.get_order_book()) | |
dct_order = orders[orders.norenordno == dat['norenordno']] | |
entry_order_status = dct_order['status'].values[0] | |
if dat['txt'] != "ORDER STATUS: ": | |
dat['txt'] = "ORDER STATUS: " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
hi, give me python code for prediction market. rules are below | |
a) participants bet on two binary pots for an event that is going to happen that day. | |
b) the bet size changes according to the probability of the event | |
c) one pot bets 'for' the event and another 'against' | |
d) if probability of the even if 70% then the for pot bet size is 70$ and against pot bet size is 30$ | |
e) can you interpolate the probability automatically based on the amount collected in each pot and/or based on the number of bets | |
f) since the bet size is now decided by the prediction class, place_bet will be on the market which inturn will be based on the probability. | |
g) can you maintain a book for prediction market that collects $1 for every bet from the participants. also maintain book for each participants with an option to make deposits and take withdrawal. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Function to do an Ajax call | |
const searchSymbol = async (keys) => { | |
const response = await fetch("/mw/"+keys); // Generate the Response object | |
if (response.ok) { | |
const jsonValue = await response.json(); // Get JSON value from the response body | |
return Promise.resolve(jsonValue); | |
} else { | |
return Promise.reject("file not found"); | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// contents of NIFTY.json | |
[ | |
17861.5, | |
17890, | |
17613.15, | |
17900 | |
] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pyotp | |
import logging | |
from kiteext import KiteExt | |
import pandas as pd | |
from datetime import datetime as dt | |
from time import sleep | |
import json | |
from msexcel import Msexcel | |
from omspy.brokers.zerodha import Zerodha |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
// core components | |
import TableTitle from "components/Cards/TableTitle.svelte"; | |
import TableHead from "components/Cards/TableHead.svelte"; | |
import TableData from "components/Cards/TableData.svelte"; | |
import TableDropdown from "components/Dropdowns/TableDropdown.svelte"; | |
import { onMount } from "svelte"; | |
import { getMemberList } from "../../services/kkk"; | |
let committees |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* private functions */ | |
const millisecs = 100; | |
// progress indicator | |
const _show_progress = (Txn, Start, Ltp, Tgt, Stop) => { | |
let width = 0, rt_txt="Target", lt_txt="Open"; | |
const elem = document.getElementById("bar"); | |
const ptxt = document.getElementById("ptxt"); | |
if( Txn==0) { |