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
-1
votes
1 answer

Cannot read zipline backtest output

I am a newbie using zipline and trying to evaluate the backtest result of a quantitative investment strategy. I use following to perform a backtest: zipline run -f my_strat.py -s '2009-01-01' -e '2020-06-01' -b my_custom_bundle -o results.csv Then…
mccandar
  • 778
  • 8
  • 16
-1
votes
1 answer

pine-script code for closing price on the following day

I understand how to get the closing price on the previous day - close[1] - to use in creating an indicator. But, how do I get the closing on the following day? I want to compare the closing price of the current day to the closing price one day…
-1
votes
2 answers

Is there a way in which I can order requests to be executed at a late time?

To further clarify the question that I asked, is there any way in which I can schedule python requests to an API to be executed at a given API? The solution preferably should work even if my computer is not online or executing the program at the…
Victor Sim
  • 358
  • 1
  • 13
-1
votes
1 answer

BitCoin Algo not iterating through historical data correctly

I'm creating a simple trading backtester on Bitcoin, yet I'm having trouble with the for loops in my code. The current code is based on 2 simple moving averages q and z (currently for learning purposes no real strategy). info is a dataframe holding…
GilbertN
  • 37
  • 5
-1
votes
1 answer

Calculating RSI in Python

I am trying to calculate RSI on a dataframe df = pd.DataFrame({"Close": [100,101,102,103,104,105,106,105,103,102,103,104,103,105,106,107,108,106,105,107,109]}) df["Change"] = df["Close"].diff() df["Gain"] =…
Ravan
  • 35
  • 7
-1
votes
2 answers

What are the best options to store tens of millions of records in a database?

I'm working for a certain trader and he wants to build a relatively huge archive of stock quotes for further analysis. We have an access to information provider, and the data always have the same structure: ticker name, timestamp, and OHLC so it…
chernish2
  • 113
  • 1
  • 9
-1
votes
1 answer

Keep Binance futures wss alive

I have this code : startWss(); function startWss(){ let wsBinance = new WebSocket('wss://stream.binancefuture.com/stream?streams=btcusdt@bookTicker', { apiKeyID: testApiKeys[0], apiKeySecret: testApiSecrets[0] }); if(wsBinance){ …
itneg
  • 73
  • 1
  • 10
-1
votes
1 answer

Interactive Brokers java api, Eclient::reqOpenOrders not working

I am recently playing with IB trading java api. After meddling with the demo, some of the api works fine but some did not. I ran Eclient:: reqPnL, i have the call back as expected. i ran Eclient::reqOpenOrders and Eclient::reqCompletedOrders, i…
Benson
  • 189
  • 2
  • 9
-1
votes
1 answer

Calculating RSI in Python for BTC Trading Backtesting

I already calculated the RSI for BTC which worked fine. I want to add a new column [Position] to my dataframe, which indicates if my current position is long or short. Now I am trying to do a Loop, which should give me the output, if I am Longing or…
Matthias
  • 19
  • 5
-1
votes
1 answer

how creating the Hala indicator with an offset(stepshift) and strategy based on this indicator and a simple strategy script in one long position

I apologize for the request to solve the trivial problem for you, but please help the newbie: 1. I want to create a moving Hull indicator with an offset - I need to implement an offset function in the indicator. 2. The crossover strategy of the…
-1
votes
2 answers

Black Scholes function with vector inputs in Matlab

I'm trying to write a function in Matlab that calculates the Call price using the Black Scholes formula with vector inputs. I have so far: function [C] = BlackScholesCall(S,K,t,r,sigma) %This function calculates the call price per Black-Scholes…
-1
votes
2 answers

How to obtain last trading day of each month

I have a csv file of stock prices for each trading day for 9 years. how do i get the last trading day of each month and the respective prices? I have tried grouping by months followed by the largest day but it doesn't seem to be working. Any…
olleh
  • 23
  • 1
  • 5
-1
votes
2 answers

Constantly running web application

I want to build a constantly running forex trading application (even if the web page is not opened), But I don't know what is the best way to do it, it's a software that should run constantly with constant internet connection, should I write it in…
Alexy Ibrahim
  • 554
  • 1
  • 7
  • 20
-1
votes
1 answer

Convert tick data to 1 minute OHLC (Open, High, Low, Close) in JavaScript?

Similar to create an OHLC data from Date, time, price using Javascript, how does one take the theory of converting basic trade data to OHLC (or Open, High, Low, Close) and apply it to generating 1 minute OHLC? Beside that, I also have problem…
hko04u
  • 43
  • 2
  • 8
-1
votes
1 answer

Allow web apps use your crypto trading API keys, but not trust them

I’m thinking about how to give web apps ability to use your crypto exchanges’ API keys safely, so you can get benefit of using those services, but not trust them. The idea I came up with is to create open source browser extensions which can use your…