Logs into the API. If successful, a session token will be returned in the response body and as a cookie. This must be returned to the API either in the Authorization request header as a bearer token or as a cookie to authorize future requests.
The user credentials
user | string |
password | string |
{- "user": "admin",
- "password": "hello"
}
{- "session_token": "52895534080d4460a45dc5e37fb0f8d5"
}
Logs out of the API.
Authorization | string Example: Bearer: 52895534080d4460a45dc5e37fb0f8d5 The session bearer token. Required if the session token cookie is not sent. |
Cookie | string Example: __Host-session_token=52895534080d4460a45dc5e37fb0f8d5 The session token cookie. Required if the Authorization bearer token is not sent. |
{- "error": "Access denied",
- "status": 401
}
Gets a list of trading strategy information. Query parameters can be used to filter the returned list based on certain criteria, e.g. "/strategies?engine=main&active=true". Query parameter names must match strategy information field names returned in the response.
Authorization | string Example: Bearer: 52895534080d4460a45dc5e37fb0f8d5 The session bearer token. Required if the session token cookie is not sent. |
Cookie | string Example: __Host-session_token=52895534080d4460a45dc5e37fb0f8d5 The session token cookie. Required if the Authorization bearer token is not sent. |
{- "strategies": [
- {
- "name": "BuyHighSellLow",
- "engine": "main",
- "active": true,
- "start_time": "2024-03-10T11:53:35.593848+00:00",
- "update_time": "2024-03-10T11:59:12.328174+00:00",
- "last_trade_profit": -19.67,
- "total_profit": -38.4,
- "config": {
- "algo": "moonship.myalgos.MoProfits",
- "auto_start": true,
- "trade_quantity": 0.02,
- "max_drawdown": 70,
- "markets": [
- "ShadyCryptoExchange-BTCUSDT"
]
}
}
]
}
Gets information about the specified trading strategy.
Engine | string Example: main The trading engine name |
Strategy | string Example: BuyHighSellLow The strategy name |
Authorization | string Example: Bearer: 52895534080d4460a45dc5e37fb0f8d5 The session bearer token. Required if the session token cookie is not sent. |
Cookie | string Example: __Host-session_token=52895534080d4460a45dc5e37fb0f8d5 The session token cookie. Required if the Authorization bearer token is not sent. |
{- "name": "BuyHighSellLow",
- "engine": "main",
- "active": true,
- "start_time": "2024-03-10T11:53:35.593848+00:00",
- "update_time": "2024-03-10T11:59:12.328174+00:00",
- "last_trade_profit": -19.67,
- "total_profit": -38.4,
- "config": {
- "algo": "moonship.myalgos.MoProfits",
- "auto_start": true,
- "trade_quantity": 0.02,
- "max_drawdown": 70,
- "markets": [
- "ShadyCryptoExchange-BTCUSDT"
]
}
}
Adds a new trading strategy. The request body must contain the strategy configuration properties specified in the same manner as they would be configured in the Moonship application configuration file.
Engine | string Example: main The trading engine name |
Strategy | string Example: BuyHighSellLow The strategy name |
Authorization | string Example: Bearer: 52895534080d4460a45dc5e37fb0f8d5 The session bearer token. Required if the session token cookie is not sent. |
Cookie | string Example: __Host-session_token=52895534080d4460a45dc5e37fb0f8d5 The session token cookie. Required if the Authorization bearer token is not sent. |
The strategy configuration properties specified in the same manner as they would be configured in the Moonship application configuration file
required | object (StrategyConfigInfo) The trading strategy configuration |
{- "config": {
- "algo": "moonship.myalgos.MoProfits",
- "auto_start": true,
- "trade_quantity": 0.02,
- "max_drawdown": 70,
- "markets": [
- "ShadyCryptoExchange-BTCUSDT"
]
}
}
{- "error": "Missing or bad strategy field",
- "status": 400
}
Updates the specified trading strategy. If the strategy is currently active, the trading engine will attempt to stop it gracefully first before applying the update, and then restart it afterwards. The request body must contain one or more strategy configuration properties specified in the same manner as they would be configured in the Moonship application configuration file.
Engine | string Example: main The trading engine name |
Strategy | string Example: BuyHighSellLow The strategy name |
Authorization | string Example: Bearer: 52895534080d4460a45dc5e37fb0f8d5 The session bearer token. Required if the session token cookie is not sent. |
Cookie | string Example: __Host-session_token=52895534080d4460a45dc5e37fb0f8d5 The session token cookie. Required if the Authorization bearer token is not sent. |
One or more strategy configuration properties specified in the same manner as they would be configured in the Moonship application configuration file
required | object (StrategyConfigInfo) The trading strategy configuration |
{- "config": {
- "trade_quantity": 0.02,
- "max_drawdown": 70
}
}
{- "error": "Missing or bad strategy field",
- "status": 400
}
Removes the specified trading strategy. If the strategy is currently active, the trading engine will attempt to stop it gracefully first.
Engine | string Example: main The trading engine name |
Strategy | string Example: BuyHighSellLow The strategy name |
Authorization | string Example: Bearer: 52895534080d4460a45dc5e37fb0f8d5 The session bearer token. Required if the session token cookie is not sent. |
Cookie | string Example: __Host-session_token=52895534080d4460a45dc5e37fb0f8d5 The session token cookie. Required if the Authorization bearer token is not sent. |
{- "error": "Missing or bad strategy field",
- "status": 400
}
Starts the specified trading strategy if it is not currently active.
Engine | string Example: main The trading engine name |
Strategy | string Example: BuyHighSellLow The strategy name |
Authorization | string Example: Bearer: 52895534080d4460a45dc5e37fb0f8d5 The session bearer token. Required if the session token cookie is not sent. |
Cookie | string Example: __Host-session_token=52895534080d4460a45dc5e37fb0f8d5 The session token cookie. Required if the Authorization bearer token is not sent. |
{- "error": "Missing or bad strategy field",
- "status": 400
}
Stops the specified trading strategy if it is currently active.
Engine | string Example: main The trading engine name |
Strategy | string Example: BuyHighSellLow The strategy name |
Authorization | string Example: Bearer: 52895534080d4460a45dc5e37fb0f8d5 The session bearer token. Required if the session token cookie is not sent. |
Cookie | string Example: __Host-session_token=52895534080d4460a45dc5e37fb0f8d5 The session token cookie. Required if the Authorization bearer token is not sent. |
{- "error": "Missing or bad strategy field",
- "status": 400
}