python code to find the largest price each day of the week

This is the place for queries that don't fit in any of the other categories.

python code to find the largest price each day of the week

Postby lakx2005 » Tue Jul 16, 2013 1:56 am

how to write a python code to find the largest price in each day of the week :?:
Last edited by micseydel on Tue Jul 16, 2013 5:58 am, edited 1 time in total.
Reason: Locked OP.
lakx2005
 
Posts: 2
Joined: Tue Jul 16, 2013 1:53 am

Re: python code to find the largest price each day of the we

Postby metulburr » Tue Jul 16, 2013 2:39 am

how to write a python code to find the largest price in each day of the week

largest price in each day?

Gonna a need a more info than that.
New Users, Read This
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
https://github.com/metulburr
steam
User avatar
metulburr
 
Posts: 1489
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY

Re: python code to find the largest price each day of the we

Postby micseydel » Tue Jul 16, 2013 5:59 am

Join the #python-forum IRC channel on irc.freenode.net!

Please do not PM members regarding questions which are meant to be discussed publicly. The point of the forum is so that others can benefit from it. We don't want to help you over PMs or emails.
User avatar
micseydel
 
Posts: 1435
Joined: Tue Feb 12, 2013 2:18 am
Location: Mountain View, CA

Re: python code to find the largest price each day of the we

Postby lakx2005 » Tue Jul 16, 2013 6:23 am

actually what i need is To find the best and second best price each day of week.
my code ,can anyone help me solve this
if NewIndex==1:
if newcurrentorder.Side=='Ask':
if newcurrentorder.Price < float(LowestPIndexAsk):
SecondlowestPIndexAsk=LowestPIndexAsk
LowestPIndexAsk=newcurrentorder.Price
elif (newcurrentorder.Price >= float(LowestPIndexAsk)) and (newcurrentorder.Price < float(SecondlowestPIndexAsk)):
SecondlowestPIndexAsk=newcurrentorder.Price
else:
if newcurrentorder.Price > float(BestPIndexbid):
SecondPBestIndexBid=BestPIndexbid
BestPIndexbid=newcurrentorder.Price
elif (newcurrentorder.Price <= float(BestPIndexbid)) and (newcurrentorder.Price> float(SecondPBestIndexBid)):
SecondPBestIndexBid=newcurrentorder.Price
elif NewIndex==2:
if newcurrentorder.Side=='Ask':
if newcurrentorder.Price < float(LowestMBIndexAsk):
SecondlowestMBIndexAsk=LowestMBIndexAsk
LowestMBIndexAsk=newcurrentorder.Price
elif (newcurrentorder.Price >= float(LowestMBIndexAsk)) and (newcurrentorder.Price < float(SecondlowestMBIndexAsk)):
SecondlowestMBIndexAsk=newcurrentorder.Price
else:
if newcurrentorder.Price > float(BestMBIndexbid):
SecondMBBestIndexBid=BestMBIndexbid
BestMBIndexbid=newcurrentorder.Price
elif (newcurrentorder.Price <= float(BestMBIndexbid)) and (newcurrentorder.Price> float(SecondMBBestIndexBid)):
SecondMBBestIndexBid=newcurrentorder.Price
elif NewIndex==3:
if newcurrentorder.Side=='Ask':
if newcurrentorder.Price < float(LowestMYIndexAsk):
SecondlowestMYIndexAsk=LowestMYIndexAsk
LowestMYIndexAsk=newcurrentorder.Price
elif (newcurrentorder.Price >= float(LowestMYIndexAsk)) and (newcurrentorder.Price < float(SecondlowestMYIndexAsk)):
SecondlowestMYIndexAsk=newcurrentorder.Price
else:
if newcurrentorder.Price > float(BestMYIndexbid):
SecondMYBestIndexBid=BestMYIndexbid
BestMYIndexbid=newcurrentorder.Price
elif (newcurrentorder.Price <= float(BestMYIndexbid)) and (newcurrentorder.Price> float(SecondMYBestIndexBid)):
SecondMYBestIndexBid=newcurrentorder.Price
elif NewIndex==4:
if newcurrentorder.Side=='Ask':
if newcurrentorder.Price < float(LowestTSIIndexAsk):
SecondlowestMYIndexAsk=LowestTSIIndexAsk
LowestTSIIndexAsk=newcurrentorder.Price
elif (newcurrentorder.Price >= float(LowestTSIIndexAsk)) and (newcurrentorder.Price < float(SecondlowestTSIIndexAsk)):
SecondlowestMYIndexAsk=newcurrentorder.Price
else:
if newcurrentorder.Price > float(BestTSIIndexbid):
SecondTSIBestIndexBid=BestTSIIndexbid
BestTSIIndexbid=newcurrentorder.Price
elif (newcurrentorder.Price < float(BestTSIIndexbid)) and (newcurrentorder.Price> float(SecondTSIBestIndexBid)):
SecondTSIBestIndexBid=newcurrentorder.Price


metulburr wrote:
how to write a python code to find the largest price in each day of the week

largest price in each day?

Gonna a need a more info than that.
lakx2005
 
Posts: 2
Joined: Tue Jul 16, 2013 1:53 am

Re: python code to find the largest price each day of the we

Postby micseydel » Tue Jul 16, 2013 6:31 am

See that link I posted? I wasn't joking when I said to read it.
Join the #python-forum IRC channel on irc.freenode.net!

Please do not PM members regarding questions which are meant to be discussed publicly. The point of the forum is so that others can benefit from it. We don't want to help you over PMs or emails.
User avatar
micseydel
 
Posts: 1435
Joined: Tue Feb 12, 2013 2:18 am
Location: Mountain View, CA


Return to General Coding Help

Who is online

Users browsing this forum: Bing [Bot], W3C [Linkcheck] and 4 guests