Closed savasturkoglu1 closed 2 years ago
envoriment python version its been tested only on python 3.7! but there is no api class you need to define it!
could be any name your won't
example
ctrader = Ctrader(FIX_SERVER,FIX_BROKER,FIX_LOGIN,FIX_PASSWORD,FIX_CURRENCY)
ctrader.buy("EURUSD", 0.01, 1.18, 1.19)
follow full example on readme
from ejtraderCT import Ctrader
FIX_SERVER="h8.p.c-trader.cn"
FIX_BROKER="icmarkets"
FIX_LOGIN="3152339"
FIX_PASSWORD="393214"
FIX_CURRENCY="EUR"
# api defined here
api = Ctrader(FIX_SERVER,FIX_BROKER,FIX_LOGIN,FIX_PASSWORD,FIX_CURRENCY)
api.buy("EURUSD", 0.01, 1.18, 1.19)
@traderpedroso ye I know that I can connect the server that way. But when i call history method so this Method in ctrader.py:
def history(self, symbol, chartTF, fromDate):
return json.loads(json.dumps(self.api.Command(action="HISTORY", actionType="DATA", symbol=symbol, chartTF=chartTF, fromDate=fromDate)))
i got this error
AttributeError: 'Ctrader' object has no attribute 'api'
coz there is no api defination in the class what mean -api- in ctrader.py ?
@traderpedroso ye I know that I can connect the server that way. But when i call history method so this Method in ctrader.py:
def history(self, symbol, chartTF, fromDate): return json.loads(json.dumps(self.api.Command(action="HISTORY", actionType="DATA", symbol=symbol, chartTF=chartTF, fromDate=fromDate)))
i got this error
AttributeError: 'Ctrader' object has no attribute 'api'
coz there is no api defination in the class what mean -api- in ctrader.py ?
sorry its not implemented yet on readme saying its future function
when i try get history with this method;
history = api.history("GBPUSD", "H1", int(datetime.datetime.now().timestamp()) - 10000)
i got error;AttributeError: 'Ctrader' object has no attribute 'api'
there is no api defination in the class