Questions tagged [trading]

The act of buying and selling financial instruments, such as money markets spot instruments, stocks, bonds, commodities, virtual currencies, indices, futures, options, CFD-s and other derivatives, performed on a for-profit basis.

Trading in general and speculative trading are a form of participation in a process of mutually beneficial exchange.

Speculative trading is a knowingly speculative, for-profit, participation in a multi-layer scene of sell-side and buy-side market participants ( liquidity providers ), brokerage entities / mediators, market regulators ( where territorially applicable and legally enforced ) and retail traders.

Markets typically offer trading in both Buy ( a.k.a. Long ) and Sell ( Short ) contract positions for various financial instruments such as:

  • money markets spot contracts,
  • ETF contracts,
  • virtual currencies,
  • stocks,
  • bonds,
  • commodities,
  • indices,
  • futures,
  • options,
  • options on index,
  • non-deliverable swaps,
  • CFD-s and other derivatives.
1444 questions
8
votes
3 answers

How to calculate realized P&L of stock trades using the FIFO method?

I'm looking for a Python plugin that would calculate the realized P&L for a number of stock transactions using the FIFO method. For example, assume we have the following three MSFT trades: +75 MSFT 25.10 +50 MSFT 25.12 -100 MSFT 25.22 The sell of…
Nikola Miles
  • 81
  • 1
  • 1
  • 2
8
votes
4 answers

Automating Etrade

Hey everyone, I was wondering how would I start programming an interface to trading stocks in Etrade in python. I am attempting to make an automated trading bot, but there is no api publicly available for automated trading with Etrade. Thanks in…
iAlexTsang
  • 189
  • 2
  • 10
7
votes
2 answers

How to keep a 10 pip profit gap between stop loss and current price as profits increase

I am trying to add another condition to the solution in this post. I want the stop loss to move by 10 pips when a trade is in 10 pips profit. To be more specific, say I've set a pending buy order and the stop loss is 10 pips below the open price and…
TenOutOfTen
  • 467
  • 6
  • 14
7
votes
5 answers

Object oriented design for an investment/stock and options portfolio in Python

I'm a beginner/intermediate Python programmer but I haven't written an application, just scripts. I don't currently use a lot of object oriented design, so I would like this project to help build my OOD skills. The problem is, I don't know where to…
Jason Wirth
  • 745
  • 1
  • 10
  • 17
7
votes
1 answer

How to return an array from a function in MQL4?

I would like to return an array from my function, how can I do that? Look! int GetOrdresVente(){ int ordrevente; int Tabordresvente[]; for(int j = OrdersTotal() - 1; j >= 0 ; j--){ if(OrderSelect( j, SELECT_BY_POS ) == true){ …
packy
  • 71
  • 1
  • 4
7
votes
2 answers

How can I download option tables using the yahoo finance api?

Yahoo Finance changed its web page formats last week (again) and the data isn't copyable, downloadable, or scrapeable, since the data is apparently loaded indirectly. (I can see it in the debugger.) The Yahoo Finance API doesn't currently return…
user1067305
  • 3,233
  • 7
  • 24
  • 29
7
votes
1 answer

Implementation of Kraken API in Java

So I currently working on an implementation of the Kraken API for Java. I am using this sample code I found on http://pastebin.com/nHJDAbH8. The general usage as described by Kraken (https://www.kraken.com/help/api) is: API-Key = API key API-Sign…
hhlw
  • 97
  • 1
  • 7
7
votes
4 answers

Read Amibroker price volume data using python

I would like to read the price volume data of Amibroker stock symbols using python. I cannot find anything useful on google for doing this. Anyone can help?
guagay_wk
  • 26,337
  • 54
  • 186
  • 295
6
votes
1 answer

what is the principle of low latency in trading application?

It seems that all the major investment banks use C++ in Unix (Linux, Solaris) for their low latency/high frequency server applications. How do people achieve low latency in trading high frequency equity? Any book teach how to achieve this?
M-Askman
  • 400
  • 4
  • 17
6
votes
2 answers

Can anyone recommend a forex trading API?

I'm interested in experimenting a bit with foreign exchange trading using PHP, JavaScript and the new HTML 5 canvas object. I've looked around a bit, but was wondering of a JavaScript API I can use for foreign exchange trading. Can anyone recommend…
josef.van.niekerk
  • 11,941
  • 20
  • 97
  • 157
6
votes
3 answers

The function should be called on each calculation for consistency, console output?

My script has just recently started to show these lines in console, when I add to chart or save. "The function 'anonym_function_10' should be called on each calculation for consistency. It is recommended to extract the call from the ternary operator…
cryptobar76
  • 61
  • 1
  • 1
  • 4
6
votes
2 answers

What are the symbols used in Binance's dapi (coin futures api)?

I am trying to download historical price data of BTC/USD perpetual futures using binance's api for coin futures, specifically, I'd like to use this endpoint. However, I cannot find what 'symbol' I have to specify for BTC/USD. I've tried multiple…
Dedados
  • 281
  • 2
  • 7
6
votes
2 answers

Tradingview - How to use multiple input type=source

I'm currently trying to set up a script to generate conditional alerts whenever another script displays several specific data points. input(type=source) works no problem, but as soon as I try to add more than one source input, it stops working all…
saix
  • 61
  • 2
6
votes
1 answer

Python: Real-Time Streaming Data

I am trying to capture real-time streaming financial time data via Python. I want to initially store the information in a database and then at a later date further develop a program to analyze and make trading decisions based on this data. It would…
Sinan Reis
  • 69
  • 1
  • 1
  • 3
6
votes
1 answer

Multiple Quantities in Bracket Orders Using IBrokers in R

I am working with the ibrokers package in R and am trying to set multiple closing prices for a trade. For example, buy 100 shares of AAPL at $106, sell 50 at $107 and 50 at $108, with a stop price of $105. When I send the multiple profit taking…
mks212
  • 901
  • 1
  • 18
  • 40
1
2
3
95 96