Replies

raypang
21 Aug 2024, 15:32

RE: RE: RE: Bars can only fetch latest 200 bars

PanagiotisCharalampous said: 

raypang said: 

PanagiotisCharalampous said: 

Hi there,

You can use Bars.LoadMoreHistory() method to load more bars.

Best regards,

Panagiotis

protected override void OnStart()

{

    Print(Bars.Count); //200

    Bars.LoadMoreHistory();

    Print(Bars.Count); //200

}

it seems not work

Can you tell us the broker and the symbol?

EURUSD  backtest  timeframe 1min  ICMarkets


@raypang

raypang
21 Aug 2024, 11:51

RE: Bars can only fetch latest 200 bars

PanagiotisCharalampous said: 

Hi there,

You can use Bars.LoadMoreHistory() method to load more bars.

Best regards,

Panagiotis

protected override void OnStart()

{

    Print(Bars.Count); //200

    Bars.LoadMoreHistory();

    Print(Bars.Count); //200

}

it seems not work


@raypang

raypang
23 May 2024, 13:26 ( Updated at: 24 May 2024, 05:28 )

Sorry, I  found it,  Seems like it named  ProtoOAReconcileReq


@raypang

raypang
23 May 2024, 08:54 ( Updated at: 23 May 2024, 09:42 )

actually there is a way, 

you deploy your bot on your vps, 

you can email that grant access web url to your email, so you can operate auth on any device, 

doesn't have to operate auth on your vps.


@raypang

raypang
23 May 2024, 08:50 ( Updated at: 23 May 2024, 09:42 )

redirect url is your server's api, for example yourhost.com/auth

in the  auth process, ctrader will send authcode to yourhost.com/auth, 

with that  authcode, you can request your token

so you have to deploy a simple server to get that authcode.

I done this using vercel's free host. 

I wrote a simple python server with flask, within 100 lines of code.


@raypang

raypang
23 May 2024, 08:44 ( Updated at: 23 May 2024, 09:42 )

RE: RE: Server ping

kemenist said: 

PanagiotisChar said: 

Hi there,

You get heartbeats from the server, why do you need a ping?

Sorry, to clarify I mean the one-way latency to the server.

if  you using python websockets library, you can use ping to get latency, example code:

async def _auto_ping(self, interval:int, connection:WebSocketClientProtocol):

        while True:

            await asyncio.sleep(interval)

            future_pong = await connection.ping()

            # print('', end='♡')

            latency = await future_pong

            # print('', end=f'❤︎')


@raypang

raypang
23 May 2024, 08:40 ( Updated at: 23 May 2024, 09:42 )

RE: RE: RE: I use spotware

1179259534 said: 

我已经说得很清楚了…

我刚注册,平台指引我用spotware,我是用demo application登录的,我在spotware没有搜到黄金(GOLD)

然后我尝试用 ctrader-open-api 获取资产列表(ProtoOAAssetListReq),里面有GOLD,然后我获取所有的标的列表(ProtoOASymbolsListReq),发现里面没有GOLD这个Symbol,我只是想知道能不能交易GOLD,如果能为什么我不能通过api获取,要如何才能交易GOLD,我只是想知道这个

非常感谢

麻烦您用chatgpt翻译一下,中国不能用chatgpt

可以, 你用 Symbol List 接口, 里面有 XAUUSD, 就是黄金, XAGUSD 就是白银 


@raypang