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.
we will be moving to python-forum.io on October 1 2016
more details here
User avatar
metulburr
 
Posts: 2243
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

Due to the reasons discussed here we will be moving to python-forum.io on October 1, 2016.

This forum will be locked down and no one will be able to post/edit/create threads, etc. here from thereafter. Please create an account at the new site to continue discussion.
User avatar
micseydel
 
Posts: 3000
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.
Due to the reasons discussed here we will be moving to python-forum.io on October 1, 2016.

This forum will be locked down and no one will be able to post/edit/create threads, etc. here from thereafter. Please create an account at the new site to continue discussion.
User avatar
micseydel
 
Posts: 3000
Joined: Tue Feb 12, 2013 2:18 am
Location: Mountain View, CA


Return to General Coding Help

Who is online

Users browsing this forum: Google [Bot] and 6 guests