Giter Club home page Giter Club logo

Comments (3)

traderpedroso avatar traderpedroso commented on May 30, 2024

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)

from ejtraderct.

savasturkoglu1 avatar savasturkoglu1 commented on May 30, 2024

@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 ?

from ejtraderct.

traderpedroso avatar traderpedroso commented on May 30, 2024

@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

from ejtraderct.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.