dimanche 15 novembre 2020

Python Complex IF Statement

I'm getting some syntax error here and can't seem to find it:

if open_prices[0] > close_prices[0]:
  if (close_prices[0] - low_prices[0]) >= 2*(open_prices[0] - close_prices[0]) and          
     (high_pices[0] - open_prices[0]) <= 0.5*(open_prices[0] - close_prices[0]):
      x = 1

The error is

if (close_prices[0] - low_prices[0]) >= 2*(open_prices[0] - close_prices[0]) and (high_pices[0] - open_prices[0] <= 0.5*(open_prices[0] - close_prices[0]):
                                                                                                                                                          ^
SyntaxError: invalid syntax

Am I incorrect in the syntax or formatting?

Aucun commentaire:

Enregistrer un commentaire