Edit Your Comment
myfxbook API
Jun 09, 2011 zamanından beri üye
2 iletiler
Oct 14, 2011 at 01:38
Jun 09, 2011 zamanından beri üye
2 iletiler
Can I use the myfxbook API to extract the same values I find in the widgets?
Specifically I am looking to obtain performance data on each of my strategies, example: when the account was opened, my average returns, max draw down, etc.
Can I also call widgets from within the API. Are they the same as the widgets or different?
I am trying to integrate my strategies into a portfolio type system where I can showcase multiple strategies.
Thanks for your help.
Joe
Specifically I am looking to obtain performance data on each of my strategies, example: when the account was opened, my average returns, max draw down, etc.
Can I also call widgets from within the API. Are they the same as the widgets or different?
I am trying to integrate my strategies into a portfolio type system where I can showcase multiple strategies.
Thanks for your help.
Joe
Jul 31, 2009 zamanından beri üye
1449 iletiler
Oct 19, 2011 at 08:35
Jul 31, 2009 zamanından beri üye
1449 iletiler
Joe, all of the information is available in the API section https://www.myfxbook.com/api
The widgets can be invoked easily by changing the oid of the system which is represented in the widget's url.
The widgets can be invoked easily by changing the oid of the system which is represented in the widget's url.
Oct 05, 2020 zamanından beri üye
1 iletiler
Oct 28, 2020 at 05:04
Oct 05, 2020 zamanından beri üye
1 iletiler
Staff posted:
Joe, all of the information is available in the API section https://www.myfxbook.com/api
The widgets can be invoked easily by changing the oid of the system which is represented in the widget's url.
is there any sample or example as reference?
®γσ ξηg
May 06, 2024 zamanından beri üye
1 iletiler
Aug 03 at 19:44
May 06, 2024 zamanından beri üye
1 iletiler
Can I use the myfxbook API to extract the same values I find in the widgets?
Specifically I am looking to obtain performance data on each of my strategies, example: when the account was opened, my average returns, max draw down, etc.
Can I also call widgets from within the API. Are they the same as the widgets or different?
I am trying to integrate my strategies into a portfolio type system where I can showcase multiple strategies.
thankyou i am shantany😄
Specifically I am looking to obtain performance data on each of my strategies, example: when the account was opened, my average returns, max draw down, etc.
Can I also call widgets from within the API. Are they the same as the widgets or different?
I am trying to integrate my strategies into a portfolio type system where I can showcase multiple strategies.
thankyou i am shantany😄
Sep 16, 2020 zamanından beri üye
76 iletiler
Aug 04 at 02:33
Sep 16, 2020 zamanından beri üye
76 iletiler
shantanumore posted:You mean like this?
Can I use the myfxbook API to extract the same values I find in the widgets?
Specifically I am looking to obtain performance data on each of my strategies, example: when the account was opened, my average returns, max draw down, etc.
Can I also call widgets from within the API. Are they the same as the widgets or different?
I am trying to integrate my strategies into a portfolio type system where I can showcase multiple strategies.
thankyou i am shantany😄
import myfxbook
# Initialize the API client
fx = myfxbook.myfxbook('<Your_Email>', '<Your_Password>')
# Login to start a session
fx.login()
# Get a list of your accounts
accounts = fx.get_my_accounts()
# For each account, retrieve detailed performance data
for account in accounts['accounts']:
account_id = account['id']
# Get account open date and basic performance metrics
print(f'Account ID: {account_id}')
print(f'First Trade Date: {account['firstTradeDate']}')
print(f'Gain: {account['gain']}%')
print(f'Daily: {account['daily']}%')
print(f'Monthly: {account['monthly']}%')
print(f'Drawdown: {account['drawdown']}%')
# Get daily performance data (for charts)
daily_data = fx.get_data_daily(id=account_id, start='2023-01-01', end='2023-12-31')
# Get open trades
open_trades = fx.get_open_trades(id=account_id)
# Get trading history
history = fx.get_history(id=account_id)
# Get custom widget data (e.g., for balance chart)
widget_data = fx.get_custom_widget(id=account_id, width=600, height=400)
# Process and use the data as needed for your portfolio system
# ...
# Don't forget to logout when done
fx.logout()
Let's say you have a widget URL like this:
https://widgets.myfxbook.com/widgets/strategy.html?oid=123456
You can use the Myfxbook API to get the list of your accounts and their corresponding IDs (oid). Here is a Python example using the Myfxbook API:
import requests
# Define your Myfxbook credentials
email = 'your_email'
password = 'your_password'
# Login to Myfxbook
login_url = 'https://www.myfxbook.com/api/login.json'
login_params = {
'email': email,
'password': password
}
response = requests.get(login_url, params=login_params)
session_id = response.json()['session']
# Get the list of your accounts
accounts_url = 'https://www.myfxbook.com/api/get-my-accounts.json'
accounts_params = {
'session': session_id
}
response = requests.get(accounts_url, params=accounts_params)
accounts = response.json()['accounts']
# Print account IDs and names
for account in accounts:
print(f'Account Name: {account['name']}, Account ID (oid): {account['id']}')
# Logout
logout_url = 'https://www.myfxbook.com/api/logout.json'
logout_params = {
'session': session_id
}
requests.get(logout_url, params=logout_params)
After retrieving the account IDs, you can create widget URLs for each account. For example, if you retrieved an account ID 654321, you can create a widget URL like this:
https://widgets.myfxbook.com/widgets/strategy.html?oid=654321
"Or die trying...." Sonny Crockett, Miami Vice 1980's
*Ticari kullanım ve istenmeyen e-postalara müsamaha gösterilmez ve hesabın feshedilmesine neden olabilir.
İpucu: Bir resim/youtube urlsi yayınlamak, onu otomatik olarak gönderinize gömer!
İpucu: Bu tartışmaya katılan bir kullanıcı adını otomatik olarak tamamlamak için @ işaretini yazın.