Beispiel #1
0
    #         driver.find_element_by_xpath(xpath2).click()
    #     except:
    #         print('no pop-up')
    xpath = '//div[contains(@id, "upload")]//div[@class="close-icon svg-icon-holder"]'
    try:
        driver.find_element_by_xpath(xpath).click()
    except:
        print('no pop-up')


##### STEPS BY STEPS running  #########

# 1) start webdriver
base_url = "https://www.trading212.com"
chromebrowserdriver = webbrowser('chrome').getWebDriverInstance(base_url)

# 2) login
user1 = "*****@*****.**"
pswd1 = "Serverg0d!"
# user1 = "*****@*****.**"
# pswd1 = "H0meBase"

fxfinal = FxFinalDecision(chromebrowserdriver)
fxfinal.autologin_maxwindows(base_url, user1, pswd1)

# 3) pop-up window (which ask to upload ID documents)
driver2 = fxfinal.driver
clossee_popup_ask_upload_docs(driver2)

# 4) switch to Practice Mode   # Real or Practice
fxfinal.mode_live_or_demo("Practice")
Beispiel #2
0
])

from Forex_CFD.base.webdriverfactory import WebDriverFactory as webbrowser
from Forex_CFD.features.final_fx_decision import FxFinalDecision

##### STEPS BY STEPS running  #########

# 1) start webdriver
base_url = "https://www.trading212.com"
chromedriver = webbrowser('chrome').getWebDriverInstance(base_url)

# 2) login
user1 = "*****@*****.**"
pswd1 = "Serverg0d!"

fxfinal = FxFinalDecision(chromedriver)
fxfinal.autologin_firstwindows(base_url, user1, pswd1)

# 3) pop-up window (which ask to upload ID documents)
fxfinal.close_popup_ask_upload_docs()

# 4) switch to Practice Mode   # Real or Practice
fxfinal.mode_live_or_demo("Practice")

# 5) go to speficic currency or looping all currencies   # looping_check_all_currencies(driver)
# 6) Buy/Sell/Close_Position

## NOW COMBINE NO 5) & 6)

pilihan = 0
rerun = 'Y'
# _PASSWORD       = "******"
_USERNAME = "******"
_PASSWORD = "******"
# Chrome
_CHROME_NAME = 'chrome'
_CHROME_DRIVER = r'C:\tools\chromedriver\chromedriver.exe'

##### STEPS BY STEPS running  #########

# 1) start webdriver
base_url = "https://www.trading212.com"
browser_driver = WebBrowser(
    _CHROME_NAME, driver_path=_CHROME_DRIVER).getWebDriverInstance(base_url)

# 2) login
fxfinal = FxFinalDecision(browser_driver)
fxfinal.autologin_firstwindows(base_url, _USERNAME, _PASSWORD)

# 3) pop-up window (which ask to upload ID documents)
fxfinal.close_popup_ask_upload_docs()

# 4) switch to Practice Mode   # Real or Practice
fxfinal.mode_live_or_demo("Practice")

# 5) go to speficic currency or looping all currencies   # looping_check_all_currencies(driver)
### AUTO RUN SCRIPTS - BUY / SELL / CLOSE POSITION AUTOMATICALLY & CONTINOUSLY

pilihan = 0
while pilihan != 99:
    value_EMA = 25
    tperiod = '1 minute'
_PASSWORD = "******"
# _USERNAME     = "******"
# _PASSWORD     = "******"
# Chrome
_CHROME_NAME = 'chrome'
_CHROME_DRIVER = r'C:\tools\chromedriver\chromedriver.exe'

##### STEPS BY STEPS running  #########

# 1) start webdriver
base_url = "https://www.trading212.com"
browser_driver = WebBrowser(
    _CHROME_NAME, driver_path=_CHROME_DRIVER).getWebDriverInstance(base_url)

# 2) login
fxfinal = FxFinalDecision(browser_driver)
fxfinal.autologin_firstwindows(base_url, _USERNAME, _PASSWORD)

# 3) pop-up window (which ask to upload ID documents)
fxfinal.close_popup_ask_upload_docs()

# 4) switch to Practice Mode   # Real or Practice
fxfinal.mode_live_or_demo("Practice")

# 5) go to speficic currency or looping all currencies   # looping_check_all_currencies(driver)
### AUTO RUN SCRIPTS - BUY / SELL / CLOSE POSITION AUTOMATICALLY & CONTINOUSLY

pilihan = 0
rerun = 'Y'
value_EMA = 25
tperiod = '5 minutes'  # tperiod = '1 minute' / '5 minutes' / '10 minutes' / '15 minutes'