Rajandran R Creator of OpenAlgo - OpenSource Algo Trading framework for Indian Traders. Telecom Engineer turned Full-time Derivative Trader. Mostly Trading Nifty, Banknifty, High Liquid Stock Derivatives. Trading the Markets Since 2006 onwards. Using Market Profile and Orderflow for more than a decade. Designed and published 100+ open source trading systems on various trading tools. Strongly believe that market understanding and robust trading frameworks are the key to the trading success. Building Algo Platforms, Writing about Markets, Trading System Design, Market Sentiment, Trading Softwares & Trading Nuances since 2007 onwards. Author of Marketcalls.in

How to Send Orders from Metatrader 4 Expert Advisor to Algomojo Trading Account

2 min read

This tutorial helps you to convert your Metatrader 4 expert advisor to send automated orders to the Algomojo Platform. Currently, Algomojo supported brokers are Aliceblue, Enrich, Tradejini, Zebu are the partner brokers.

This Video tutorial is divided into two parts

1)Installing the Algmojo Multi Platform – Multi Broker Bridge
2)Configuring the Sample MT4 Expert advisor to send automated orders to Algomojo connected brokers (Aliceblue, Tradejini, Zebu, Enrich)

Installing the Algmojo Multi Platform – Multi Broker Bridge

Configuring the Sample MT4 Expert Advisor

MT4 Algomojo Modules to Send Automated Orders

//Algomojo Autotrading Modules

input string user_apikey = "xxxxxxxxxxxxxxxxxxxxxx"; //Enter your API key here
input string api_secretkey = "xxxxxxxxxxxxxxxxxxxxxx"; //Enter your API secret key here
input string s_prdt_ali = "BO:BO||CNC:CNC||CO:CO||MIS:MIS||NRML:NRML";
input string Tsym = "NIFTY20NOVFUT"; //Symbol Name
input string exch = "NFO"; //Exchange
input string Ret = "DAY"; //Retention
input string prctyp = "MKT"; // Pricetype
input string Pcode = "MIS"; // Product Code
input int qty = 150; // Quantity
input string AMO = "NO"; //AMO Order
input string stgy_name = "Metatrader Strategy"; // Strategy Name
input string broker = "ab"; //Broker Short code ab - aliceblue, tj- tradejini, zb - zebu , en - enrich
input string ver = "1.0"; //API Version

string response;
string api_data;

#import "AMMT4BRIDGE.dll"
     string AMDispatcher(string api_key, string api_secret, string api_name, string api_data, string br_code, string version);
#import

Algomojo Buy (Double the quantity) to reverse your position

//Algomojo Place Buy Order


api_data ="{\"stgy_name\":\""+stgy_name+"\",\"s_prdt_ali\":\""+s_prdt_ali+"\",\"Tsym\":\""+Tsym+"\",\"exch\":\""+exch+"\",\"Ttranstype\":\""+"B"+"\",\"Ret\":\""+Ret+"\",\"prctyp\":\""+prctyp+"\",\"qty\":\""+qty*2+"\",\"discqty\":\""+"0"+"\",\"MktPro\":\""+"NA"+"\",\"Price\":\""+"0"+"\",\"TrigPrice\":\""+"0"+"\",\"Pcode\":\""+Pcode+"\",\"AMO\":\""+AMO+"\"}";
         
      response=AMDispatcher(user_apikey, api_secretkey,"PlaceOrder",api_data,broker,ver);
      Print("api : " ,api_data);
      Print("Algomojo Buy Order response : " ,response);

Algomojo Sell (Double the quantity) to reverse your position

//Algomojo Place Sell Order


api_data ="{\"stgy_name\":\""+stgy_name+"\",\"s_prdt_ali\":\""+s_prdt_ali+"\",\"Tsym\":\""+Tsym+"\",\"exch\":\""+exch+"\",\"Ttranstype\":\""+"S"+"\",\"Ret\":\""+Ret+"\",\"prctyp\":\""+prctyp+"\",\"qty\":\""+qty*2+"\",\"discqty\":\""+"0"+"\",\"MktPro\":\""+"NA"+"\",\"Price\":\""+"0"+"\",\"TrigPrice\":\""+"0"+"\",\"Pcode\":\""+Pcode+"\",\"AMO\":\""+AMO+"\"}";
         
      response=AMDispatcher(user_apikey, api_secretkey,"PlaceOrder",api_data,broker,ver);
      Print("api : " ,api_data);
      Print("Algomojo Sell Order response : " ,response);
Rajandran R Creator of OpenAlgo - OpenSource Algo Trading framework for Indian Traders. Telecom Engineer turned Full-time Derivative Trader. Mostly Trading Nifty, Banknifty, High Liquid Stock Derivatives. Trading the Markets Since 2006 onwards. Using Market Profile and Orderflow for more than a decade. Designed and published 100+ open source trading systems on various trading tools. Strongly believe that market understanding and robust trading frameworks are the key to the trading success. Building Algo Platforms, Writing about Markets, Trading System Design, Market Sentiment, Trading Softwares & Trading Nuances since 2007 onwards. Author of Marketcalls.in

Send Smart Options Execution Orders from Futures or Spot…

This tutorial provides instructions on how to utilize simple buy and sell trading signals in Spot/Future charts to place option orders (including ATM, ITM,...
Rajandran R
11 min read

Algomojo Autocancellation of Limit Orders After N seconds

In this tutorial, I'm going to demonstrate how to use Amibroker AFL code to perform auto cancellation of limit order after N...
Rajandran R
3 min read

How to Squareoff All OpenPositions using Tradingview – Automation…

One of the most demanded requests from Tradingview-based automated traders is how to square-off all open positions when a particular time is reached. There...
Rajandran R
1 min read

Leave a Reply

Get Notifications, Alerts on Market Updates, Trading Tools, Automation & More