Code Monkey home page Code Monkey logo

Comments (5)

unageanu avatar unageanu commented on September 27, 2024

If you create a new position opposite to the one you currently have, the position will be closed or reduced.

  • If you have 1000 USD/EUR sell position, and you buy 1500 USD/EUR, then 1000 USD/EUR sell position will be closed and 500 USD/EUR buy position will be created.
  • If you have 1000 USD/EUR sell position, and you buy 500 USD/EUR, then 500 USD/EUR sell position will be reduced.

At that time, closed or reduced position information will be returned in tradeReduced or tradeColosed .

from jiji2.

janckerchen avatar janckerchen commented on September 27, 2024
  • If you have 1000 USD/EUR buy position, and you buy 500 USD/EUR more, what's the result returned?

from jiji2.

unageanu avatar unageanu commented on September 27, 2024

In this case, new 500 USD/EUR buy position will be created, and return position information in trade_opened, then tradeReduced will be nil, tradeColosed will be empty array.

from jiji2.

janckerchen avatar janckerchen commented on September 27, 2024

I seemed to understand a little bit, for example:

  • I have no position initially.
  • then I buy 100 USD/EUR, return tradeOpened with internal_id_1
  • then I buy 100 USD/EUR agian, return tradeOpened with internal_id_2 (new position as you said)
  • then I buy 100 USD/EUR agian, return tradeOpened with internal_id_3
  • I got three position by now.
  • then I sell 250 USD/EUR
  • final action will return two tradeColosed in array and one tradeReduced with 50

oanda dont merge position, it's strange to me.

from jiji2.

unageanu avatar unageanu commented on September 27, 2024

We do not have both sell and buy positions at the same time.
It seems to be a spec of OANDA API.

from jiji2.

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.