Python syntax algorithms fixes (#8916)
Python Virtual Environments / build (push) Has been cancelled
API Tests / build (push) Has been cancelled
Benchmarks / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Report Generator Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Syntax Tests / build (push) Has been cancelled

* Python syntax algorithms fixes

* More fixes

* More fixes

* Minor fix

* Update python syntax check accepted percentage
This commit is contained in:
Jhonathan Abreu
2025-08-11 10:55:00 -04:00
committed by GitHub
parent a7265c8a41
commit 4c4a34007d
19 changed files with 115 additions and 109 deletions
@@ -12,6 +12,7 @@
# limitations under the License.
from AlgorithmImports import *
import pytz
### <summary>
### Demonstration of using an external custom datasource. LEAN Engine is incredibly flexible and allows you to define your own data source.
@@ -73,7 +74,7 @@ class Bitcoin(PythonData):
value = live_btc["last"]
if value == 0: return None
coin.end_time = datetime.utcnow().astimezone(timezone(str(config.exchange_time_zone))).replace(tzinfo=None)
coin.end_time = datetime.now(pytz.timezone(str(config.exchange_time_zone)))
coin.value = value
coin["Open"] = float(live_btc["open"])
coin["High"] = float(live_btc["high"])