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
6
votes
7 answers

Which programming language for compute-intensive trading portfolio simulation?

I am building a trading portfolio management system that is responsible for production, optimization, and simulation of non-high frequency trading portfolios (dealing with 1min or 3min bars of data, not tick data). I plan on employing Amazon web…
Bijan
  • 6,675
  • 6
  • 33
  • 29
6
votes
2 answers

Technical Analysis - Parabolic Stop and Reverse Indicator

I'm trying to build a class to create SAR serie. But it seems I don't understand the steps well. I'm not sure about the initial values for the calculation. Here is my first attempt: public class SAR : IndicatorCalculatorBase { public override…
xkcd
  • 2,538
  • 11
  • 59
  • 96
6
votes
1 answer

What are some good data structures to store a large orderbook?

I'm writing a Bitcoin trader app that is fetching orderbooks from exchanges. A typical orderbook looks like this: https://www.bitstamp.net/api/order_book/ (it has two parts, "bids" and "asks", they should be stored separately but in identical data…
orion3
  • 9,797
  • 14
  • 67
  • 93
5
votes
1 answer

Trading view charting library week start by default from Monday I want to change it to Sunday

I am using the trading view charting library and the issue is that all of the stocks are Saudi Arabian so in Saudi Arabia week starts on Sunday, and in the library, the week begins on Monday so when I click on weekdays from the tab, the footer show…
Noman
  • 594
  • 1
  • 18
5
votes
1 answer

Could not find function or function reference 'ema'

I'm getting the error line 13: Could not find function or function reference 'ema'. When I know for a fact ema is a function. I'm trying to do a simple strategy, where it enters a long trade if the price is above the 200 DEMA, and there is a "buy"…
Washy
  • 61
  • 1
  • 1
  • 3
5
votes
0 answers

How exactly does trail_price, trail_offset work in pinescript?

Thank you all for your help so far. I have been coding many different strategies in pinescript so far, and I have read through pinescript manual and many google articles, but I am still confused as to how trailing stop work in pinescript. For…
5
votes
1 answer

How to get the default_qty_value in PineScript?

I'm coding a strategy and I want to perform calculations based on the default_qty_value, which is set in the strategy settings. Yes, I know I can use the strategy.position_avg_price to get the position size, but these calculations must be done…
Eduardo
  • 184
  • 8
5
votes
1 answer

Pinescript set a position size

My strategy() is fully working but now I'm trying to manage how money is put in the trade. HERE'S MY CURRENT SITUATION : I have a SL set at the lowest low of the last 10 bars and a TP set at 1.5xSL. My strategy.exit : strategy.exit("EXIT…
PepeW
  • 477
  • 1
  • 8
  • 24
5
votes
1 answer

How to get profit percentage of trade during backtest in Amibroker

I am using Amibroker v6.3 I would like to find out the profit percentage of a trade taken during backtest, then adjust the sell criteria accordingly. When profit is below 10%, I want to use this function sell_below10(). When profit is >10%, then use…
user3848207
  • 3,737
  • 17
  • 59
  • 104
5
votes
3 answers

How to create a simple flag in Python

After getting data of the SPY from Yahoo I create a channel of closing prices using, as you can see below, the Max and Min rolling window. The columns are HC and HL. I need to create a column (which I have called flag) that shows 1 when the close…
Martingale
  • 511
  • 1
  • 6
  • 15
5
votes
3 answers

How to apply the Hurst Exponent in Python in a rolling window

I am trying to apply the Hurst Exponent on SPY closing prices on a rolling window. The below code (which I got from here: https://www.quantstart.com/articles/Basics-of-Statistical-Mean-Reversion-Testing) works well if I apply it on the closing…
Martingale
  • 511
  • 1
  • 6
  • 15
5
votes
3 answers

How to manipulate a price series (indicator) oscillate around a Center Value?

I’m no expert programmer, but I’m attempting to change the way in which some technical indicators are displayed in a financial charting package called TradeStation (not that the specific charting supplier is relevant). Here is the problem: Most…
5
votes
2 answers

Pine Script Entry Strategy Referencing Previous Exit Price

I am trying to build a strategy (long positions only) in TV wherein strategy.entry will consider the previous exit price. For example: strategy.entry("long", strategy.long, when = longcondition==true) strategy.close("long", strategy.close, when =…
emotheraphy
  • 97
  • 11
5
votes
1 answer

How to add multiple pictures in Python ebay sdk

Here is my setup: Python 3.4 Using the Trading API Attempting to call eBay's "VerifyAddItem" I marked where I get the Error, in PicURL, and I'm trying to post multiple pictures with multiple URLs. I'm currently just trying out two pictures let's…
adonix56
  • 101
  • 5
5
votes
1 answer

Courses etc. for developing an automated trading algorithm?

Does anyone know of any courses etc for teaching people how to learn how to apply technical analysis and trading mechanics to the development of an automated trading algorithm?
John
  • 51
  • 2
1 2
3
95 96