Getting started

Documentation on AlgoStudio


Introduction

Algostudo is a Amibroker Bridge built on top of upstox API which helps traders/investors to build, monitor. execute their trading requirement automatically.


Download

Currently Algostudio is available for Windows users and works with Amibroker. Upstox trading account and upstox API is mandatory requirement to use Algostudio for Automation. If you dont have Upstox trading account then get one before trying Algostudio.


Download Open Upstox Account


Upstox API Creation

1)Login to Upstox Developer Portal

2)Click on Create New App and Select API Trading

Responsive image

3)Now enter

App Name : AlgoStudio
Redirect URI:https://algostudio.in/api/algo
Description: Algostudio Terminal

4)Now copy API KEY and API SECRET
Responsive image


Installation & Setup

Launch ALGO STUDIO by Double click on setup file. Click NEXT.

Responsive image

Click NEXT.

Responsive image

Click NEXT.

Responsive image

Click on CLOSE.

Responsive image

Registration.

For the registration, right click on Register file and give Run as administrator. Type Y and click enter so that automatically upstoxLib will register. This shows Registered successfully as shown below

Responsive image
Responsive image

Launch ALGO STUDIO by Double clicking the Application.


Click on Settings and enter the API key, API secret key and redirect URL as https://algostudio.in/api/algo and save it.

Responsive image

Register for 7 days free trial and enter API and user details. Open AlgoStudio ,Click Login button and enter your Upstox credentials and click Accept button. Responsive image



Now Start ALGO Application, Click on Order Book, and where you can see orders.

Responsive image

In the same way Click on Trade Book, and you can see your trades.

Responsive image

In order to see watchlist click on WATCHLIST.

Responsive image

Actual trades are visible in ALGO BOOK.

Responsive image

Holdings are visible in Holdings.

Responsive image

Positions are visible in Positions.

Responsive image

Virtual trades are visible in Paper Logs.

Responsive image

In order to check fund, click on Funds.

Responsive image

System Requirements

  • Operating System: Windows 7 SP1 or higher
  • RAM: 2 GB or higher
  • CPU: 2 GHz or faster and minimum 2 cores
  • Dot Net Framework: 4.5 or higher
  • Web Browser:Internet Explorer
  • Administrator rights
  • Good Quality Internet

User Requirements


Internet Explorer Settings

Since, the in-built Webbrowser control uses Internet Explorer; the following sites must be added to Trusted Sites in Internet Options


Amibroker Supported Functions

Rules for the Place Order function while using the Bridge to AmiBroker.

PlaceOrderSimple(API key,string,transation_type,exchange , symbol,quantity, order_ type, Product, price, disclosed quantity, trigger price)

Return Value

Type : String

Order Id

# Parameter Type Explanation
1 API Key String Upstox API Key
2 strategy String Strategy Name
3 transactionType String Indicates whether its a buy(b) or sell(s) order
4 exchange String Exchange to which the order is associated
5 symbol String Shows the trading symbol which could be a combination of symbol name, instrument, expiry date etc
6 quantity Integer Quantity with which the order was placed
7 orderType String Type of order. It can be one of the following
  • M refers to market order
  • L refers to Limit Order
  • SL refers to Stop Loss Limit
  • SL-M refers to Stop loss market
8 product String Shows if the order was either Intraday, Delivery, CO or OCO
9 price Double Price at which the order will be placed
10 disclosedQuantity Integer The quantity that should be disclosed in the market depth
11 triggerPrice Double If the order is a stop loss order then the trigger price set is mentioned here

PlaceOrder_CO (API key, string, transation_type, exchange, symbol, quantity, order_ type, price, trigger price,disclosed quantity, stop loss)

Return Value

Type : String

Order Id

# Parameter Type Explanation
1 API Key String Upstox API Key
2 strategy String Strategy Name
3 transactionType String Indicates whether its a buy(b) or sell(s) order
4 exchange String Exchange to which the order is associated
5 symbol String Shows the trading symbol which could be a combination of symbol name, instrument, expiry date etc
6 quantity Integer Quantity with which the order was placed
7 orderType String
  • M refers to market order
  • L refers to Limit Order
8 price Double Price at which the order will be placed
9 triggerPrice Double If the order is a stop loss order then the trigger price set is mentioned here
10 disclosedQuantity Integer If the order is a stop loss order then the trigger price set is mentioned here
11 stoploss Double Set a difference from the entry price for stoploss. Use in case the product is CO

PlaceOrder_OCO (API key, string, transation_type, exchange, symbol, quantity, order_ type, price, trigger price, disclosed quantity, stop loss, square off,Trailing Ticks)

Return Value

Type : String

Order Id

# Parameter Type Explanation
1 API Key String Upstox API Key
2 strategy String Strategy Name
3 transactionType String Indicates whether its a buy(b) or sell(s) order
4 exchange String Exchange to which the order is associated
5 symbol String Shows the trading symbol which could be a combination of symbol name, instrument, expiry date etc
6 quantity Integer Quantity with which the order was placed
7 orderType String
  • L refers to Limit Order
  • SL refers to Stop Loss Limit
8 price Double Price at which the order will be placed
9 triggerPrice Double If the order is a stop loss order then the trigger price set is mentioned here
10 disclosedQuantity Integer The quantity that should be disclosed in the market depth
11 stoploss Double Set a difference from the entry price for stoploss. Use in case the product is OCO
12 squareOff Double Set a difference from the entry price for profit. Use in case the product is OCO
13 trailing ticks Double Set trailing ticks product is OCO

4.AMO Order

PlaceOrderAMO (API key, string, transation_type, exchange, symbol, quantity, order type, product, price,trigger price, disclosed quantity)

Return Value

Type : String

Order Id

# Parameter Type Explanation
1 API Key String Upstox API Key
2 strategy String Strategy Name
3 transactionType String Indicates whether its a buy(b) or sell(s) order
4 exchange String Exchange to which the order is associated
5 symbol String Shows the trading symbol which could be a combination of symbol name, instrument, expiry date etc
6 quantity Integer Quantity with which the order was placed
7 orderType String
  • M refers to market order
  • L refers to Limit Order
  • SL refers to Stop Loss Limit
  • SL-M refers to Stop loss market
8 product String Shows if the order was either Intraday, Delivery, CO or OCO
9 price Double Price at which the order will be placed
10 triggerPrice Double If the order is a stop loss order then the trigger price set is mentioned here
11 disclosedQuantity Integer The quantity that should be disclosed in the market depth

5.Close Positions

ClosePositions(API key ,exchange , symbol , product);

Return Value

Type : bool

true/false

# Parameter Type Explanation
1 API Key String Upstox API Key
2 Exchange String Exchange to which the order is associated
3 symbol String Shows the trading symbol which could be a combination of symbol name, instrument, expiry date etc
4 product String Shows if the order was either Intraday, Delivery, CO or OCO

6.Algo Status

AlgoStatus(API key);

Return Value

Type : String

ACTIVE/INACTIVE

# Parameter Type Explanation
1 API Key String Upstox API Key

7.Symbol MTM

SymbolMTM(UpstoxAPI,exchange,Symbol,Product);

Return Value

Type : String

Symbol MTM

# Parameter Type Explanation
1 API Key String Upstox API Key
2 Exchange String Exchange to which the order is associated
3 Symbol String Shows the trading symbol which could be a combination of symbol name, instrument, expiry date etc
4 Product String Shows if the order was either Intraday, Delivery, CO or OCO

8.Total MTM

TotalMTM(UpstoxAPI);

Return Value

Type : String

Total MTM

# Parameter Type Explanation
1 API Key String Upstox API Key

9.Modify Order

ModifyOrder(UpstoxApi, Oredr_id, qty, order type, price, trigger_price, DiscQty);

Return Value

Type : String

# Parameter Type Explanation
1 API Key String Upstox API Key
2 Oredr_id String order id
3 quantity String quantity
4 Order Type String order type(buy/sell)
5 Price String price
6 Trigger Price Double trigger price
7 DiscQty Integer disclosed quantity

10.Cancel Order

TotalMTM(UpstoxAPI);

Return Value

Type : String

OK

# Parameter Type Explanation
1 API Key String Upstox API Key
2 orderId String order id

11.Order Status

OrderStatus(string apikey,string orderId);

Return Value

Type : String

Status

# Parameter Type Explanation
1 API Key String Upstox API Key
2 orderId String order id

12.GetLtp

GetLtp(string apikey,string exchange,string symbol);

Return Value

Type : Double

Ltp

# Parameter Type Explanation
1 API Key String Upstox API Key
2 Exchange String Exchange to which the order is associated
3 Symbol String Shows the trading symbol which could be a combination of symbol name, instrument, expiry date etc

13.GetDayOpen

GetDayOpen(string apikey,string exchange,string symbol);

Return Value

Type : Double

DayOpen

# Parameter Type Explanation
1 API Key String Upstox API Key
2 Exchange String Exchange to which the order is associated
3 Symbol String Shows the trading symbol which could be a combination of symbol name, instrument, expiry date etc

14.GetDayHigh

GetDayHigh(string apikey,string exchange,string symbol);

Return Value

Type : Double

DayHigh

# Parameter Type Explanation
1 API Key String Upstox API Key
2 Exchange String Exchange to which the order is associated
3 Symbol String Shows the trading symbol which could be a combination of symbol name, instrument, expiry date etc

15.GetDayLow

GetDayLow(string apikey,string exchange,string symbol);

Return Value

Type : Double

DayLow

# Parameter Type Explanation
1 API Key String Upstox API Key
2 Exchange String Exchange to which the order is associated
3 Symbol String Shows the trading symbol which could be a combination of symbol name, instrument, expiry date etc

16.GetClose

GetClose(string apikey,string exchange,string symbol);

Return Value

Type : Double

Close

# Parameter Type Explanation
1 API Key String Upstox API Key
2 Exchange String Exchange to which the order is associated
3 Symbol String Shows the trading symbol which could be a combination of symbol name, instrument, expiry date etc

17.ExitBOCOOrder

ExitBOCOOrder(string apikey, string parentorderId);

Return Value

Type : String

Exit BOCO Order

# Parameter Type Explanation
1 API Key String Upstox API Key
2 parentorderId String call GetParentOrderId function and get the parentorderId

18.GetParentOrderId

GetParentOrderId(string apikey, string Exch, string Symbol, string Product);

Return Value

Type : String

ParentOrderId

# Parameter Type Explanation
1 API Key String Upstox API Key
2 Exchange String Exchange to which the order is associated
2 Symbols String Shows the trading symbol which could be a combination of symbol name, instrument, expiry date etc
2 Product String Shows if the order was either Intraday, Delivery, CO or OCO

19.CancelAllOrders

CancelAllOrders(string apikey);

Return Value

Type : String

Status OK

# Parameter Type Explanation
1 API Key String Upstox API Key

20.CancelOrder

CancelOrder(string apikey, string orderId);

Return Value

Type : String

Status OK

# Parameter Type Explanation
1 API Key String Upstox API Key
1 orderId String call GetOrderId function and get OrderId

21.OrderId

OrderId(string apikey, string Exch, string Symbol, string Product);

Return Value

Type : String

OrderId

# Parameter Type Explanation
1 API Key String Upstox API Key
1 Exchange String Exchange to which the order is associated
1 Symbol String Shows the trading symbol which could be a combination of symbol name, instrument, expiry date etc
1 Product String Shows if the order was either Intraday, Delivery, CO or OCO

Amibroker Execution

Details will be published soon.


Trade from Charts

Details will be published soon.


Trade from Scanners

Details will be published soon.


Sample Amibroker AFL Codes

Download AFL Files here


Paper Trading

Details will be published soon.


Trade Logs (Paper Trading/Live Trading)

Details will be published soon.