feat(auto-trading): integrate MetaApi for automated trading
- Add metaapi.cloud-sdk for broker integration - Implement AutoTradingView component - Extend Signal interface with secondary take-profit levels - Update UI to include auto-trading navigation tab
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { createRequire } from "module";
|
||||
const require = createRequire(import.meta.url);
|
||||
const metaApiPkg = require("metaapi.cloud-sdk");
|
||||
const MetaApi = typeof metaApiPkg === "function" ? metaApiPkg : metaApiPkg.default || metaApiPkg;
|
||||
async function test() {
|
||||
try {
|
||||
const api = new MetaApi('fake_token_123');
|
||||
await api.metatraderAccountApi.createAccount({
|
||||
name: 'Test',
|
||||
login: '123123',
|
||||
password: 'password',
|
||||
server: 'Server-1',
|
||||
platform: 'mt4',
|
||||
magic: 1000
|
||||
});
|
||||
} catch (err) {
|
||||
console.log("Error details:", err.message, err.response?.data || err.details || err);
|
||||
}
|
||||
}
|
||||
test();
|
||||
Reference in New Issue
Block a user