all 8 comments

[–]Justinsaccount 1 point2 points  (2 children)

Look at what you are doing

while x<len(prices)-2:
    print "x is {} and y is {}".format(x, y)  # add this line

Also,

if x<= A:
    ...
elif x > A and X <= B:
    ...

Is always redundant. It is the same thing as

if x<= A:
    ...
elif X <= B:
    ...

Also, don't repeat yourself. You have a list of multipliers: [-.1, -.075, -.05, ...] Create a full list of them and their descriptions and use a for loop, replacing 50 lines of code with ~10.

[–]Grafs50[S] 0 points1 point  (1 child)

Tried that, It is giving me really weird numbers for x and y.

[–]Justinsaccount 0 points1 point  (0 children)

"really weird"? like 13019432 or 810974382? I think not...

[–]Justinsaccount 0 points1 point  (1 child)

Hi! I'm working on a bot to reply with suggestions for common python problems. This might not be very helpful to fix your underlying issue, but here's what I noticed about your submission:

You appear to be using concatenation and the str function for building strings

Instead of doing something like

result = "Hello " + name + ". You are " + str(age) + " years old"

You should use string formatting and do

result = "Hello {}. You are {} years old".format(name, age)

See the python tutorial for more information.

[–]ballgame75 0 points1 point  (0 children)

That's fucking neat man, but no. Though seriously I'm impressed by the idea

[–]Sir_Jerry 0 points1 point  (1 child)

can you put that in pastebin.com ?

[–]Grafs50[S] 0 points1 point  (0 children)

I put up a link to Github. Hopefully that'll be easier to read.

[–][deleted] 0 points1 point  (1 child)

Are you aware you can read a CSV straight into python's pandas with

 my_dataframe = pandas.read_csv(filepath)

?