Beispiel #1
0
def overview():
    try:
        strategy_tester = driver.find_elements_by_xpath(
            "//*[@class='title-37voAVwR']")[3]
        active = strategy_tester.get_attribute('data-active')
        if active == 'false':
            strategy_tester.click()
            # time.sleep(.3)
            overview = driver.find_element_by_class_name(
                "report-tabs").find_elements_by_tag_name("li")[0]
            overview.click()
        else:
            overview = driver.find_element_by_class_name(
                "report-tabs").find_elements_by_tag_name("li")[0]
            overview.click()
    except (IndexError, NoSuchElementException,
            ElementNotInteractableException) as error:
        if error:
            strategy_tester = driver.find_elements_by_xpath(
                "//*[@class='title-37voAVwR']")[2]
            active = strategy_tester.get_attribute('data-active')
            if active == 'false':
                strategy_tester.click()
                # time.sleep(.3)
                overview = driver.find_element_by_class_name(
                    "report-tabs").find_elements_by_tag_name("li")[0]
                overview.click()
            else:
                overview = driver.find_element_by_class_name(
                    "report-tabs").find_elements_by_tag_name("li")[0]
                overview.click()
def performance_summary():
    strategy_tester = driver.find_elements_by_xpath("//*[@class='title-37voAVwR']")[2]
    active = strategy_tester.get_attribute('data-active')
    if active == 'false':
        strategy_tester.click()
        # time.sleep(.3)
        performance_tab = driver.find_element_by_class_name("report-tabs").find_elements_by_tag_name("li")[1]
        performance_tab.click()
    else:
        performance_tab = driver.find_element_by_class_name("report-tabs").find_elements_by_tag_name("li")[1]
        performance_tab.click()
def list_of_trades():
    strategy_tester = driver.find_elements_by_xpath("//*[@class='title-37voAVwR']")[2]
    active = strategy_tester.get_attribute('data-active')
    if active == 'false':
        strategy_tester.click()
        time.sleep(.3)
        list_of_trades = driver.find_element_by_class_name("report-tabs").find_elements_by_tag_name("li")[2]
        list_of_trades.click()
    else:
        list_of_trades = driver.find_element_by_class_name("report-tabs").find_elements_by_tag_name("li")[2]
        list_of_trades.click()
def overview():
    strategy_tester = driver.find_elements_by_xpath("//*[@class='title-37voAVwR']")[2]
    active = strategy_tester.get_attribute('data-active')
    if active == 'false':
        strategy_tester.click()
        # time.sleep(.3)
        overview = driver.find_element_by_class_name("report-tabs").find_elements_by_tag_name("li")[0]
        overview.click()
    else:
        overview = driver.find_element_by_class_name("report-tabs").find_elements_by_tag_name("li")[0]
        overview.click()
Beispiel #5
0
def number_losing_trades():
    number_losing_trades = driver.find_element_by_class_name(
        "report-data").find_element_by_tag_name(
            "table").find_element_by_tag_name(
                "tbody").find_elements_by_tag_name(
                    "tr")[13].find_elements_by_tag_name("td")[1]
    print(f'Number Losing Trades: {number_losing_trades.text}')
Beispiel #6
0
def total_open_trades():
    total_open_trades = driver.find_element_by_class_name(
        "report-data").find_element_by_tag_name(
            "table").find_element_by_tag_name(
                "tbody").find_elements_by_tag_name(
                    "tr")[11].find_elements_by_tag_name("td")[1]
    print(f'Total Open Trades: {total_open_trades.text}')
Beispiel #7
0
def win_rate():
    win_rate = driver.find_element_by_class_name(
        "report-data").find_element_by_tag_name(
            "table").find_element_by_tag_name(
                "tbody").find_elements_by_tag_name(
                    "tr")[14].find_elements_by_tag_name("td")[1]
    print(f'Win Rate: {win_rate.text}')
Beispiel #8
0
def avg_bars_in_losing_trades():
    avg_bars_in_losing_trades = driver.find_element_by_class_name(
        "report-data").find_element_by_tag_name(
            "table").find_element_by_tag_name(
                "tbody").find_elements_by_tag_name(
                    "tr")[23].find_elements_by_tag_name("td")[1]
    print(f'Avg Bars In Losing Trades: {avg_bars_in_losing_trades.text}')
Beispiel #9
0
def win_loss_ratio():
    win_loss_ratio = driver.find_element_by_class_name(
        "report-data").find_element_by_tag_name(
            "table").find_element_by_tag_name(
                "tbody").find_elements_by_tag_name(
                    "tr")[18].find_elements_by_tag_name("td")[1]
    print(f'Win/Loss Ratio: {win_loss_ratio.text}')
Beispiel #10
0
def percent_profitable():
    percent_profitable = driver.find_element_by_class_name(
        "report-data").find_element_by_tag_name(
            "table").find_element_by_tag_name(
                "tbody").find_elements_by_tag_name(
                    "tr")[14].find_elements_by_tag_name("td")[1]
    print(f'Percent Profitable: {percent_profitable.text}')
Beispiel #11
0
def commission_paid():
    commission_paid = driver.find_element_by_class_name(
        "report-data").find_element_by_tag_name(
            "table").find_element_by_tag_name(
                "tbody").find_elements_by_tag_name(
                    "tr")[9].find_elements_by_tag_name("td")[1]
    print(f'Commission Paid: {commission_paid.text}')
Beispiel #12
0
def buy_and_hold_return():
    buy_and_hold_return = driver.find_element_by_class_name(
        "report-data"
    ).find_element_by_tag_name("table").find_element_by_tag_name(
        "tbody").find_elements_by_tag_name("tr")[4].find_element_by_class_name(
            "additional_percent_value")
    try:
        negative = buy_and_hold_return.find_element_by_class_name("neg")
        if negative:
            display = colored(f'{buy_and_hold_return.text}', 'red')
            print(f'Buy & Hold Return: {display}')
    except NoSuchElementException:
        display = colored(f'{buy_and_hold_return.text}', 'green')
        print(f'Buy & Hold Return: {display}')
Beispiel #13
0
def max_drawdown():
    max_drawdown = driver.find_element_by_class_name(
        "report-data"
    ).find_element_by_tag_name("table").find_element_by_tag_name(
        "tbody").find_elements_by_tag_name("tr")[3].find_element_by_class_name(
            "additional_percent_value")
    try:
        negative = max_drawdown.find_element_by_class_name("neg")
        if negative:
            display = colored(f'{max_drawdown.text}', 'red')
            print(f'Max Drawdown: {display}')
    except NoSuchElementException:
        display = colored(f'{max_drawdown.text}', 'green')
        print(f'Max Drawdown: {display}')
Beispiel #14
0
def gross_loss():
    gross_loss = driver.find_element_by_class_name(
        "report-data"
    ).find_element_by_tag_name("table").find_element_by_tag_name(
        "tbody").find_elements_by_tag_name("tr")[2].find_element_by_class_name(
            "additional_percent_value")
    try:
        negative = gross_loss.find_element_by_class_name("neg")
        if negative:
            display = colored(f'{gross_loss.text}', 'red')
            print(f'Gross Loss: {display}')
    except NoSuchElementException:
        display = colored(f'{gross_loss.text}', 'green')
        print(f'Gross Loss: {display}')
Beispiel #15
0
def net_profit():
    net_profit = driver.find_element_by_class_name(
        "report-data"
    ).find_element_by_tag_name("table").find_element_by_tag_name(
        "tbody").find_elements_by_tag_name("tr")[0].find_element_by_class_name(
            "additional_percent_value")
    try:
        negative = net_profit.find_element_by_class_name("neg")
        if negative:
            display = colored(f'{net_profit.text}', 'red')
            print(f'Net Profit: {display}')
    except NoSuchElementException:
        display = colored(f'{net_profit.text}', 'green')
        print(f'Net Profit: {display}')
Beispiel #16
0
def largest_losing_trade():
    largest_losing_trade = driver.find_element_by_class_name(
        "report-data"
    ).find_element_by_tag_name("table").find_element_by_tag_name(
        "tbody").find_elements_by_tag_name(
            "tr")[20].find_element_by_class_name("additional_percent_value")
    try:
        negative = largest_losing_trade.find_element_by_class_name("neg")
        if negative:
            display = colored(f'{largest_losing_trade.text}', 'red')
            print(f'Largest Loss Trade: {display}')
    except NoSuchElementException:
        display = colored(f'{largest_losing_trade.text}', 'green')
        print(f'Largest Loss Trade: {display}')
Beispiel #17
0
def avg_win_trade():
    avg_win_trade = driver.find_element_by_class_name(
        "report-data"
    ).find_element_by_tag_name("table").find_element_by_tag_name(
        "tbody").find_elements_by_tag_name(
            "tr")[16].find_element_by_class_name("additional_percent_value")
    try:
        negative = avg_win_trade.find_element_by_class_name("neg")
        if negative:
            display = colored(f'{avg_win_trade.text}', 'red')
            print(f'Avg Win Trade: {display}')
    except NoSuchElementException:
        display = colored(f'{avg_win_trade.text}', 'green')
        print(f'Avg Win Trade: {display}')
Beispiel #18
0
def sharpe_ratio():
    sharpe_ratio = driver.find_element_by_class_name(
        "report-data").find_element_by_tag_name(
            "table").find_element_by_tag_name(
                "tbody").find_elements_by_tag_name(
                    "tr")[5].find_elements_by_tag_name("td")[1]
    try:
        negative = sharpe_ratio.find_element_by_class_name("neg")
        if negative:
            display = colored(f'{sharpe_ratio.text}', 'red')
            print(f'Sharpe Ratio: {display}')
    except NoSuchElementException:
        display = colored(f'{sharpe_ratio.text}', 'green')
        print(f'Sharpe Ratio: {display}')
Beispiel #19
0
def open_pl():
    open_pl = driver.find_element_by_class_name(
        "report-data"
    ).find_element_by_tag_name("table").find_element_by_tag_name(
        "tbody").find_elements_by_tag_name("tr")[8].find_element_by_class_name(
            "additional_percent_value")
    try:
        negative = open_pl.find_element_by_class_name("neg")
        if negative:
            display = colored(f'{open_pl.text}', 'red')
            print(f'Open PL: {display}')
    except NoSuchElementException:
        display = colored(f'{open_pl.text}', 'green')
        print(f'Open PL: {display}')
Beispiel #20
0
def max_contracts_held():
    max_contracts_held = driver.find_element_by_class_name(
        "report-data").find_element_by_tag_name(
            "table").find_element_by_tag_name(
                "tbody").find_elements_by_tag_name(
                    "tr")[7].find_elements_by_tag_name("td")[1]
    try:
        negative = max_contracts_held.find_element_by_class_name("neg")
        if negative:
            display = colored(f'{max_contracts_held.text}', 'red')
            print(f'Max Contracts Held: {display}')
    except NoSuchElementException:
        display = colored(f'{max_contracts_held.text}', 'green')
        print(f'Max Contracts Held: {display}')
Beispiel #21
0
def profit_factor():
    profit_factor = driver.find_element_by_class_name(
        "report-data").find_element_by_tag_name(
            "table").find_element_by_tag_name(
                "tbody").find_elements_by_tag_name(
                    "tr")[6].find_elements_by_tag_name("td")[1]
    try:
        negative = profit_factor.find_element_by_class_name("neg")
        if negative:
            display = colored(f'{profit_factor.text}', 'red')
            print(f'Profit Factor: {display}')
    except NoSuchElementException:
        display = colored(f'{profit_factor.text}', 'green')
        print(f'Profit Factor: {display}')