This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def adjust_trade_position( | |
self, | |
trade: Trade, | |
current_time: datetime, | |
current_rate: float, | |
current_profit: float, | |
min_stake: Optional[float], | |
max_stake: float, | |
current_entry_rate: float, | |
current_exit_rate: float, |
This file has been truncated, but you can view the full file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import copy | |
import logging | |
import pathlib | |
import rapidjson | |
import numpy as np | |
import talib.abstract as ta | |
import pandas as pd | |
import pandas_ta as pta | |
from freqtrade.strategy.interface import IStrategy | |
from freqtrade.strategy import merge_informative_pair |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import logging | |
import pandas as pd | |
import pandas_ta as pta | |
import numpy as np | |
from pandas import DataFrame | |
from typing import Dict | |
log = logging.getLogger(__name__) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lumibot_original: | |
portfolio_value cash return | |
datetime | |
2023-03-03 09:30:00-05:00 100000.000000 100000.000000 NaN | |
2023-03-04 09:30:00-05:00 100000.000000 60029.000854 0.000000 <- these stats are from friday!!! | |
2023-03-06 09:30:00-05:00 100729.000854 100729.000854 0.007290 <- these stats are from weekend! | |
2023-03-07 09:30:00-05:00 100729.000854 100729.000854 0.000000 <- monday (6) | |
2023-03-08 09:30:00-05:00 100923.100464 160681.602661 0.001927 <- tuesday (7) | |
2023-03-09 09:30:00-05:00 100720.604126 160681.602661 -0.002006 <- wednesday (8) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PolygonClient(RESTClient): | |
''' Rate Limited RESTClient with factory method ''' | |
WAIT_SECONDS = 12 | |
_class_lock = threading.Lock() | |
@classmethod | |
def create(cls, *args, **kwargs) -> RESTClient: | |
if 'api_key' not in kwargs: | |
kwargs['api_key'] = os.environ.get("POLYGON_API_KEY") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RLRESTClient(RESTClient): | |
''' Rate Limited RESTClient ''' | |
def __init__(self, *args, **kwargs): | |
self.paid = kwargs.pop('paid', True) | |
self.seconds = 60 | |
super().__init__(*args, **kwargs) | |
def _get(self, *args, **kwargs): | |
if not self.paid: | |
print( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
from polygon import RESTClient | |
def apply_sleep_to_polygon_api_calls(sleep=60): | |
from polygon.rest import BaseClient | |
# Save a reference to the original method | |
original_get = BaseClient._get | |
# Define a new version of the _get method |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo apt-get install autoconf automake libtool | |
git clone https://github.com/TA-Lib/ta-lib.git | |
cd ta-lib | |
chmod +x autogen.sh | |
./autogen.sh | |
./configure | |
make | |
sudo make install |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/^From:/ REPLACE From: <correo> | |
/^Sender:/ REPLACE Sender: <correo> | |
/^Reply-To:/ REPLACE Reply-To: <correo> | |
/^Subject:/ REPLACE Subject: Escaner |
NewerOlder