In this video tutorial, we are going to look closer into poor high and poor low and how it is different from weak high and weak low. Also, we look closer into the Trader’s and Investors’ behavior at various price levels.
In case if you are very new to the Market Profile tutorial and get to know the basics of market profile then start with this market profile tutorials
For deeper insights on Market Profile and Orderflow join TradeZilla 3.0 – 85+ hour of mentorship program for Active Traders
Related Readings and Observations
Understanding Market Participants and their Behavior Understanding who is dominating the market on a given day gives fair advantage and plays a crucial role in deciding trading strategy and executing the strategy at the better price. When […]
Poor High and Poor Low Market Profile Structure Explained Poor low and Poor High are market profile structure which generally indicates a market that is too long or too short and the shorter timeframe players in the market has low confidence […]
Market Profile Intraday Trading Strategies – Webinar Trading Intraday is Never better without Market Profile in your trading arsenal. In this webinar, we will be focusing on How to use Market Profile as a tool to collect meaningful data […]
Nifty Futures Short Term Overview – July 2020 Series Markets are trading calm compared to the Month of March, Apr, June 2020. Volatility cooled off and trading ranges get smaller and smaller. However, still, a reasonable intraday volatility […]
[Free Course] Market Profile Vs Price Action – 4 Part Series This is an Introductory webinar series for those who want to get their expertise in Market Profile and Price Action. It is a 4 part trading series webinar on Market Profile and Options […]
As of last 9th Oct 2020 closing of Nifty (11914), PE ratio stands at 34.71. By any means, it indicates euphoric markets.
The above charts show the historical PE-Ratio of Nifty. Recently there is a hockey stick growth in the PE ratio of Nifty since the Mar 2020 lockdown. The rate at which the PE ratio is growing rapidly over the last couple of months indicates that that investors are expecting higher earnings growth in the future and on the other side it also means kind of fundamentally overbought levels from the investing timeframe perspective
At this point of time Financial services contributing 1/3rd of the total weightage in the Nifty 50 index. And next to financial services Oil and Gas and IT sector are the dominant forces actively moving the Nifty 50 near to 12000 levels.
PE ratio tells us how investors value one rupee of per-share-earnings. For example, if the P/E ratio is 34.71, it means investors are willing to pay up to 34.71 times for one rupee of per-share-earnings.
Currently, the PE ratio is way above 3 standard deviation levels which statistically indicates an overheated Euphoric market environment where investor show irrational behavior and chasing the price is the primary motive from the investors and hardly anybody cares about how overvalued a particular stock is and what is the actual value of the stock.
Investors simply Buy the stocks just because it is going up and momentum gears are in top speed.
As per the latest NSEindia Fact sheet for Nifty 50 indicates Reliance and HDFC Bank are the top heavy weights
Returns since the 1st Apr 2020
Post the March 2020 Nationwide lockdown the top 10 Nifty contributors provided fantastic return. Top returns comes from Reliance with more than 100+ returns due to the continuous news flow followed by the IT heavy weights TCS and INFY with 65% and 86.11% returns respectively. And the least returns comes from the FMCG counter Hindustan Unilever and ITC with -0.74% and 6.06% respectively.
India Ranked 4th under the top fundamentally overvalued ratio metrics
So, What do you think? What could possibly go wrong this time? Is it different this time?
Solar tsunami to hit the earth today The earth could be hit by a wave of violent space weather as early as Tuesday(3rd Aug 2010) after a massive explosion on the sun, scientists have warned. The explosion, called a coronal […]
Trading System – Common Mistakes & Belief Iam just listing down some of the common mistakes done by traders and their belief when they jump into the concept of Trading system. These are some of my observance from the people those […]
The 7 Golden Principles of Stock Selection A seasoned investor has to invest time and effort into evaluating the real value of a stock. Making a wise and informed choice has a lot to do with a holistic research and trend analysis […]
Nifty and Bank Nifty November Futures Overview – II Nifty and Bank Nifty hourly charts are in sell mode since 6th November and also both the indices closes negatively on the 7th consecutive trading session.Currently resistance zone is at […]
USDJPY – Short Term Bottom Done Again as Korean Fears Fade? USDJPY tested April 2017 low on fears that Pyongyang (North Korea) would launch another missile test over the weekend, which had added to last Friday’s USDJPY selloff. Last friday Yen had […]
Since the launch of Algomojo (29th June 2020), we have been amazed by the response from the Algomojo users, and Algomojo always striving to bring down the overall essential cost of the Algo traders with more features and facilities at one single market place.
And now to meet the demand of Discount Broking Plan users we are offering free API + Free Platform with No upfront fees, no minimum turnover, no special terms and conditions, no clauses, no strings attached.
What is the Overall Cost Involved in Algomojo?
Traders opening trading account via Algomojo with our partner brokers (Currently Aliceblue, Enrich, Tradejini, Zebu) will be enjoying Free API + Free Platform Fee under both Discount Broking (Rs20 per order / Percentage Based Broking Model (0.01%) or whatever the broking plan our partner broker offers).
Here are the List of Cost Involved while deploying Algos
1)Trading API Cost: Free (For Algomojo Account Opening Clients) 2)Algomojo Platform Fee: Free (For Algomojo Account Opening Clients) 3)Datafeed Cost: Optional 4)Data API Cost: Optional 4)Strategy Cost: Both Free Strategy and Proprietary Trading Strategies Available (Optional). Traders can deploy their own Trading Strategies 5)Supportive Platforms: Amibroker, Metatrader, Tradingview, Excel, C#, Python, Any Platforms that Supports Rest-HTTP APIs 6)Virtual Private Servers: Optional 7)Broking Charges: All F&O and equity trades would continue to be charged at Rs 20 or 0.01% according to your broking plan with our partner Broker and there are no restrictions on choosing on your broking plan with partner broker. Irrespective of the broking plan Algomojo client will enjoy Unlimited & Lifetime free access to Trading API and Algomojo Platform. 8)End to End Integration/Chat Support: Free.
Algomojo Provides data products for NSE Cash, NSE Futures, MCX Futures & NSE Currencies, and currently tied up with Authorized data vendors GlobalDatafeeds & Truedata to offer data & data API products to its customers.
What is the Pricing for Non-Algomojo Clients?
Currently, Non-Algomojo clients who wants to onboard Algomojo Platform with their existing broking account but not mapped under Algomojo will avail free Algomojo API access however there will be a platform fee of Rs 2000/ month or Rs12000/year will be charged and that platform fee will be completely waived off for those taking Tradestudio Subscription / Directly opening a Trading account under Algomojo.
7 Days of Free Trial is available for Non-Algomojo clients to test drive before paying Algomojo Platform Subscription fee.
Trading Terminal Access is totally free for Non-Algomojo Clients to send orders manually/retrieving the orderbook/tradebook/open positions/watchlists from Algomojo to their broker account.
What are the Type of Orders Supported at Algomojo?
All types of orders are supported at Algomojo (Market Order, Limit Order, SL-Limit Order SL-MKT order, Bracket Order, Cover Order, AMO orders).
Algomojo also supports rule based ATM, ITM, OTM Option Orders
Algomojo supports Order Placement, Order Modification, Order Execution and Retrieval of Orderbook, Trade Book, Order History & Open Positions via API.
Algomojo API documentation
Algomojo comes with an inbuilt Free API which also supports existing clients of partner broker and compatible among different partner brokers. For detailed documentation visit here
Is the Web-Based Bridge Slower than the Exe Based Bridge?
Nope. Both use Rest API as a communication layer to transmit or receive information from the broker server. The latency of execution mostly depends upon the client’s internet speed and Brokers’ server responsiveness. In another article will look into this information in detail. However, it is a myth that Web-Based Bridge is slower compared to Exe based Bridge. In-fact web-based bridge has more ease of use and no up-gradation/installation required from the client’s side.
What are the Upcoming Features?
At Algomojo we been striving not only to bring down the overall cost of the Algo traders but algo bringing newer technology & innovative methods, newer platforms to make the overall algo trading experience of users as smooth as possible.
Here are the upcoming features expected in the next Phase of Release
1)Paper trading before taking the trading strategy to live. Expected to be released in next Phase
2)Smart in-built strategy templates to introduce smart execution in your trading strategies
3)Integrating Telegram Bots with Algomojo to send Alerts to your Telegram Account.
4)Ability to do algomojo with more trading platforms.
If you are already a Broker/ Authorized Person/ Sub-Broker/ Educational Provider/ Research Analyst/ Investment Advisor looking for a partnership with Algomojo then kindly do send an email request at partners@algomojo.com
How to Retrieve the Position Book Details from Algomojo This tutorial is for Algomojo users who want to retrieve the realtime position book details (Trading Symbol, Unrealized Profits, Realized Profits, MtoM for the particular traded symbol).
This tutorial explains how to send Automated Bracket orders from Trading view strategies to the Algomojo Trading Platform. Tradingview Supports strategies that contain rules in a pinescript language that instructs the system when to Buy/Sell orders, Modify, Cancel Orders.
Tradingview Strategies allow you to perform backtesting (emulation of a strategy trading on historical data) and forward testing (emulation of a strategy trading on real-time data) according to your algorithms.
What is a Bracket Order?
Bracket order (BO) is a type of order where you can enter a new position along with a target/exit and a stop-loss order. As soon as the main order is executed, the system will place two more orders (profit taking and stop-loss). When one of the two orders (profit taking or stop loss) gets executed, the other order will get cancelled automatically. Bracket orders are essentially algo orders.
Bracket orders can be used only for intraday trades. All bracket orders will be squared off automatically before market close. BOs aren’t allowed on BSE stocks, stock options, currency options, and MCX.
Important Note : Currently you can place the bracket order automatically with predefined target and stoploss/trailing stoploss. However in case if you want to modify the stoploss/exit the bracket order one have to do it manually by going to the algomojo orderbook and exiting manually/modifying the stop or target levels manually from there.
In order to send market orders from Tradingview to Algomojo in the previous tutorial, we have seen how to use Tradingview webhook feature to configure Automated orders using the Tradingview Alert Option.
Among All the Place Holders we are going to use {strategy.order.comment}} which reads the comment from the strategy section and change the order type dynamically based on the supertrend Buy or Sell Signal.
//Alerts
alertcondition(buySignal, title="SuperTrend Buy", message="SuperTrend Buy!")
alertcondition(sellSignal, title="SuperTrend Sell", message="SuperTrend Sell!")
longCondition = buySignal
if (longCondition)
strategy.entry("BUY", strategy.long, when = window(),comment="B")
shortCondition = sellSignal
if (shortCondition)
strategy.entry("SELL", strategy.short, when = window(),comment="S")
Comment PlaceHolder
{{strategy.order.comment}} – returns the comment of the executed order (the string used in the comment parameter in one of the function calls generating orders: strategy.entry, strategy.exit or strategy.order). If no comment is specified, then the value of strategy.order.id will be used.
Configuring Alerts
1)Select the required Timeframe. 2)Apply the Pinescript Buy or Sell Trading Strategy and 3)Click on the Alert option to configure alerts to trigger alerts from that particular timeframe.
Under the Alert Condition Tab use the drop down and change to Supertrend Algomojo and enable the Webhook URL option as shown below
Here is the sample message with necessary placeholders
configure your API Key and API Secret key from the Algomojo portal. Here is the sample code which place Buy and Sell order for Reliance with 2 shares in intraday mode.
Copy the above code modify according to your need and paste in the Alert Webhook comments block as shown below
Getting the Token ID for sending Bracket Orders
Token ID is provided by the brokers and it is unique for each and every symbol. Go to the Watchlist in the Algomojo Symbols. Click on the Security Info of that Particular symbol to retrieve the Token ID
Retieve the Token ID corresponding to that particular symbol. As shown below for Reliance Industries the token no is 2885 and it is unique for each and every ttrading symbols which is mandatory for sending Bracket Orders from Tradingview platform to Algomojo.
use the retrieved Token No to configure Webhook Message as shown above.
Here is the Complete Pinescript Strategy and to place automated orders ensure one configures the Alert Settings as mentioned above.
One the alert triggers automated orders will be placed instantly in algomojo platform
Where to Check the Order in Realtime in Algomojo
You can use order logs to check for any incoming automated orders generating from Tradingview Webhooks in Realtime and can also download the logs for later use.
[Webinar] : How to Send Automated Orders from Amibroker This Webinar will focus on how to send automated orders from Amibroker using Algostudio. It helps traders to understand the nuances involved in Automated trading, challenges faced by the […]
[STA2018] Systematic Trading using Amibroker – Online Workshop You know that Amibroker is one of the best tool to create custom trading strategies, Signal Generation , Performing Technical analysis and even test/validate your trading models. At […]
4 High Frequency Trading (HFT) Order Types You Need To Know High Frequency Trading (HFT) involves the concept of “Order Types”, which signals a trader to enter or exit a position. According to Reuters, Order types can reach an estimated 2,000 […]
Thought of brining weather data into Amibroker. Googled for free weather api data. OpenWeathermap came to my notice. Using Openweathermap one can get weather data for any location on the globe immediately.
Code requires Amibroker 6.17 as some of the new AFL functions like InternetClose( handle ) , InternetOpenURL( “url” ) , InternetReadString( handle ) – which is essecial to read from internet resource/http api is available from v6.17 or higher version.
Now I nevermind to short Nifty Futures if Bangalore weather is crossing 30 degree Celsius!
Related Readings and Observations
Scale-In Positions Explained – Amibroker AFL Code If in case you want to add to your existing open positions to your systematic trading then assign sigScaleIn to the BUY/SHORT variable if you want to scale-in (increase the size of) […]
[Premium] Amibroker AFL Programming 2018 Recorded Webinars Here is the recorded video on how to create custom indicators, scanners/exploration, trading strategies, Signal Generation, Performing Technical analysis and even test/validate your […]
How to Retrieve the Position Book Details from Algomojo This tutorial is for Algomojo users who want to retrieve the realtime position book details (Trading Symbol, Unrealized Profits, Realized Profits, MtoM for the particular traded symbol).
Bernoulli Process – Binary Entropy Function Amibroker AFL Code Here is the Bernoulli Process code snippet translated from Trading pine script indicator which explores the Bernoulli Function/Distribution), and combined with the Shannon Entropy measurement
Tradingview is one of the top 500 websites in the world powered with Interactive charts for various financial markets(stocks, futures, indices, cryptos, commodities). Undoubtedly, it is the first innovative charting product with access to historical and live intraday/EOD charts where one can build their own custom indicators/strategies on top of it
What is Pinescript?
Tradingview is equipped with a powerful formula language (pinescript) allowing traders/coders to write trading system rules, define your own indicators, generate rule-based alerts, buy and sell arrow indications, and more.
In order to simplify the learning of pinescript we are offering an 8-day learning course on Tradingview Pinescript Programming which helps traders/developers to convert their trading ideas into indicators/strategies/automation.
When does the Course Starts
Course Starts from 2nd Nov 2020 onwards. It is a complete 8-day programming session on Pinescript.
Course Timings: 7p.m – 9p.m IST Total Duration of the Course: 16 hours (2 hours/ day)
1)Introduction to Tradingview Platform 2)Charting Tools, Indicators, Templates, Watchlist, Themes & Layouts 3)Data Window, Economic Calendar, Trading Community 4)Basic Introduction to Pinescript Programming Language & Pinescript Editor 5)Pinescript Syntax and Semantics 6)Learn How to Write your First Indicator using Pinescript
Day 2 Agenda
1)Understanding Plot functions 2)Understanding If/Else functions & Nested If-Else functions 3)Understanding Tradingview operators 4)Understanding Inbuilt Functions in Tradingview 3)Learn How to Write your First Trading Strategy in Pinescript 4)Working with colors and bar types in Pinescript 5)Drawings/Trendlines 6)Publishing Scripts to Public Library
Day 3 Agenda
1)Adding numerical inputs to a TradingView script 2)Adding true/false checkbox to a TradingView script 3)Creating a text box input option in Pinescript 4)Creating a TradingView session input to set a time range 5)Adding a symbol search box to a TradingView script 6)Adding a resolution input to a TradingView Pine script 7)Adding a source input type to a TradingView Pine script 8)Understanding Date & Time Functions 9)Understanding TradingView’s ticker variable 10)Understanding TradingView’s tickerid variable 11)Understanding User-defined Functions 12)Self Referencing and Forward referencing Variables. 13)Understanding Boolean Operations and IFF functions
Day 4 Agenda
1)Learn How to Backtest Your Trading Strategy in Pinescript 2)Pinescript Backtesting Strategy Metrics 3)Position Sizing in Pinescript 4)Pyramiding in Trading Strategies 5)Building Non-Repainting Trading Strategies for Automated Trading 6)Understanding Tradingview Strategy Orders
Day 5 Agenda
1)How to Configure & Generate Alerts 2)Understanding variables in Tradingview Alerts 3)How to Send Automated Orders using Tradingview Webhook 4)Bar Replay Feature in Tradingview 5)Understanding Placeholders in Strategy Alerts 6)Plotting Buy and Sell Signals on Top of Trading Strategy
Day 6 Agenda
1)Creating Intraday Trading Strategies using Pinescript 2)How to Send Bracket Orders, Cover Orders, ATM/ITM/OTM Option Orders 3)How to Send Basket orders and Multi-Client Orders using pinescript 4)Making a Trading Bot right from Scratch. 5)Public Scripts
Day 7 Agenda
1)Screeners and Sending Automated Orders from Screeners 2)How to Run Multiple Trading Strategies at Once 3)Paper Trading in Tradingview 4)Tradingview Risk Management Functions 5)Intraday-Risk Management Functions 6)Implementing per day/per week Strategy level stop-loss 7)How to stop the trading system after consecutive losses/wins in a row.
Day 8 Agenda
1)Building Trading Strategies with Stoploss and Targets 2)Building Trading Strategies with Trailing Stoploss 3)Implementing Trend Following, Price Action Strategies 4)Implementing Mean Reversion Strategies 5)Implementing Multi Timeframe Strategies
Anybody who wants to learn Tradingview Pinescript Programming Language to create their own trading indicators, strategies or automated trading can join the course.
What are the Pre Requisite?
Basics of Tradingview Program. No Prior Coding knowledge is required. However any coding knowledge will be fasten up your learning speed.
Does the Recorded Course Access Available?
Yes, all our sessions will be recorded and entire course access will be available for repeated learning from our courses portal. Access will be provided up to duration of 1 Year.
What are the Learning Materials will be Shared?
All the Presentation Materials, Pinscript Coding (Indicators, Strategies, Auto Trading Codes) will be shared in the courses portal.
Whom I have to contact if I have a doubt? Lifetime access to Slack will be provided on the subscription of course. Where you can ask your questions in Market Profile Channel anything related to Market Profile, Volume Profile & Orderflow
Will I get a certificate at the completion of the course?
Yes, you will be awarded the “Certification of Excellence” from Marketcalls after successfully completing the online learning units.
What are the system requirements to do this course?
A fast-speed internet connection and a browser application are required for this course. For the best experience, use Chrome
Equity Drawdown and MaxDD – Tradingview Pinescript Code
Equity Drawdown is a measure from the peak-to-trough decline during a specific recorded period of a stock/index/commodity/currency. A drawdown is usually quoted as the percentage […]
Sentimental RSI – TradingView PineScript Sentimental RSI helps shorter term discretionary Traders to prepare for their trading decision. It doesn't gives buy or sell signals but guides you to focus on right side of the trade […]
Codesnippet : Autocorrelation Amibroker AFL and Pinescript Code "Autocorrelation, also known as serial correlation, is the cross-correlation of a signal with itself. Informally, it is the similarity between observations as a function of the time lag […]
Supertrend Indicator – PineScript – Tradingview Charts This is my first indicator from a series of Pinescript Indicators. And ofcouse supertrend is one of my favorite indicator. So love to take this opportunity to code it in Pinescript […]
In this webinar, Mr Abhishek H.Singh,CMT (Growth Director – Tradingview) will walk you through the Tradingview Platform, features, Drawing tools that are essential for an active trader/investor. You will be learning about advance indicators, setting price alerts, and how to take advantage of social community tools from Tradingview, and a lot more things that you need to know about the Tradingview Platform.
Event Date & Timings : 22nd Oct 2020 (7p.m – 8p.m IST)
Abhishek Sign is a Mechanical Engineer from Bharati Vidhyapeeth College of Engineering, Navi Mumbai 2001, entered into financial markets post a short 2 year stint as Site Engineer at HVAC (Heating & Ventilation) department for Voltas Ltd, Bangalore. Worked as Sales manager with Kotak Commodities & other brokers finally to be part of Network18 group company -NewsWire18 Ltd (Year 2010) now known as Cogencis Information Services Ltd was the platform where he got attracted to technical analysis.
His love & passion for markets got a firm footing with professional certification- CMT (Chartered Market Technician) -2015.
Who Should Attend?
Students, Newbie Traders, experienced traders/investors, brokers/sub-brokers, and those who are very curious about knowing the in and out features of the Tradingview platform.
In his current role as Growth Director(TradingView), he takes care of the development and promotion of Tradingview(India) – a dedicated Indian sub-community on the TradingView platform.
Related Readings and Observations
Practical Approach to Tradingview Pinescript Programming Tradingview is one of the top 500 websites in the world powered with Interactive charts for various financial markets(stocks, futures, indices, cryptos, commodities). Undoubtedly, it is a […]
In this tutorial, I’m going to demonstrate how to use Amibroker AFL code to perform auto cancellation of limit order after N seconds in Algomojo Platform. Let say I want to send 100 shares of INFY and if the fill is not happening immediately within the next 10 seconds from the executed order I want to cancel the placed orders automatically.
Here is the sample Amibroker Code which does the logic and provides the control to specify the amount of seconds to cancel the limit order trade.
The below mentioned code is just a prototype and for educational purpose only not for real-world executions.
//Algomojo Limit Order and Autocancellation after N Seconds
//Coded by Rajandran R
//Founder - Marketcalls & Algomojo - CoFounder
//Websites : www.algomojo.com & www.marketcalls.in
_SECTION_BEGIN("Algomojo Limit Order and Autocancellation after N Seconds");
function GetSecondNum()
{
Time = Now( 4 );
Seconds = int( Time % 100 );
Minutes = int( Time / 100 % 100 );
Hours = int( Time / 10000 % 100 );
SecondNum = int( Hours * 60 * 60 + Minutes * 60 + Seconds );
return SecondNum;
}
//_TRACE("seconds :"+GetSecondNum());
PlaceOrder = ParamTrigger("PlaceOrder","PRESS");
CancelOrder = ParamTrigger("CancelOrder","PRESS");
PositionBook = false; //ParamTrigger("PositionBook","PRESS");
user_apikey = ParamStr("user_apikey","c1997d92a3bb556a67dca7d1446b7087"); //Enter your API key here
api_secret = ParamStr("api_secret","5306433329e81ba41203653417063c71"); //Enter your API secret key here
clnt_id = ParamStr("Client ID","TS2499");
s_prdt_ali = ParamList("s_prdt_ali","BO:BO|CNC:CNC|CO:CO|MIS:MIS|NRML:NRML",3); //Type of order
Tsym = ParamStr("Tsym","YESBANK-EQ"); //Enter the symbol name here
exch = ParamList("Exchange","NFO|NSE|BSE|CDS|MCX|NCDEX|BFO|MCXSXFO|MCXSX",1);
Ret = ParamList("Ret","DAY|IOC",0);
Ttranstype = ParamList("Ttranstype","B|S",0);
prctyp = ParamList("prctyp","MKT|L|SL|SL-M",0);
sectocancel = Param("Sec to Cancel LMT order", 10, 3, 60,1);
Pcode = ParamList("Pcode","NRML|BO|CNC|CO|MIS",4);
Price = Param("Limit Price",0,1,100000,1);
TrigPrice = ParamList("TrigPrice","0");
qty = Param("Quatity",75,0,100000,1);
discqty = ParamList("discqty","0");
AMO = ParamList("AMO","NO|YES",0); //After market order
TokenNo = ParamStr("TokenNo","11184"); //Enter the token number of the symbol here
ltpOratp = ParamList("ltpOratp","LTP|ATP",0);
SqrOffAbsOrticks = ParamList("SqrOffAbsOrticks","Absolute|Ticks",0); //If you select absolute then you can enter a decimal quantity. If you selected ticks you need to enter in multiples of ticks
SqrOffvalue = ParamStr("SqrOffvalue","1");
SLAbsOrticks = ParamList("SLAbsOrticks","Absolute|Ticks",0);
SLvalue = ParamStr("SLvalue","1");
trailingSL = ParamList("trailingSL","Y|N",0);
tSLticks = ParamStr("tSLticks","1"); //Trailing SL value in ticks if user has opted to use trailingSL
stgy_name = ParamStr("Strategy Name", "Test Strategy Chart");
if (PlaceOrder) {
algomojo=CreateObject("XLAMIBRIDGE.Main");
api_data ="{\"stgy_name\":\""+stgy_name+"\",\"s_prdt_ali\":\""+s_prdt_ali+"\",\"Tsym\":\""+Tsym+"\",\"exch\":\""+exch+"\",\"Ttranstype\":\""+Ttranstype+"\",\"Ret\":\""+Ret+"\",\"prctyp\":\""+prctyp+"\",\"qty\":\""+qty+"\",\"discqty\":\""+discqty+"\",\"MktPro\":\""+"NA"+"\",\"Price\":\""+Price+"\",\"TrigPrice\":\""+TrigPrice+"\",\"Pcode\":\""+Pcode+"\",\"AMO\":\""+AMO+"\"}";
resp=algomojo.AMDispatcher(user_apikey, api_secret,"PlaceOrder",api_data);
StaticVarSetText("NestOrderId", StrTrim( resp, "{\"NOrdNo\":" ));
StaticVarSetText("NestOrderId", StrTrim( StaticVarGetText("NestOrderId"), "\",\"stat\":\"Ok\"}" ));
StaticVarSet("OrderTime",GetSecondNum(),persist = True);
_TRACE("Order Response : " +resp);
_TRACE("Order Time : " +Now());
_TRACE("Nest Order Id : " +StaticVarGet("NestOrderId"));
_TRACE("Seconds Left to Cancel the Order : " +sectocancel+" secs");
StaticVarSet("IfOrderPlaced",1);
}
//Manual Cancellation
if(CancelOrder)
{
algomojo=CreateObject("XLAMIBRIDGE.Main");
api_data ="{\"uid\":\""+clnt_id+"\",\"NestOrd\":\""+StaticVarGetText("NestOrderId")+"\",\"sTradeSymbol\":\""+Tsym+"\",\"s_prdt_ali\":\""+s_prdt_ali+"\",\"sExch\":\""+exch+"\"}";
resp=algomojo.AMDispatcher(user_apikey, api_secret,"CancelOrder",api_data);
//OrderTime = Now( 4 );
_TRACE("Order Response : " +resp);
_TRACE("Cancelled Time : " +Now());
}
//Automated Timer Based Cancellation
//If Trade is Placed then cancel the order after n seconds
if(StaticVarGet("IfOrderPlaced"))
{
diff = GetSecondNum() - StaticVarGet("OrderTime");
_TRACE("Timer Starts to Cancel Order: "+ diff);
if(diff >sectocancel) //cancel after n seconds
{
algomojo=CreateObject("XLAMIBRIDGE.Main");
api_data ="{\"uid\":\""+clnt_id+"\",\"NestOrd\":\""+StaticVarGetText("NestOrderId")+"\",\"sTradeSymbol\":\""+Tsym+"\",\"s_prdt_ali\":\""+s_prdt_ali+"\",\"sExch\":\""+exch+"\"}";
resp=algomojo.AMDispatcher(user_apikey, api_secret,"CancelOrder",api_data);
_TRACE("Cancelled Time : " +Now());
_TRACE("Order Response : " +resp);
StaticVarSet("IfOrderPlaced", 0); //reset the flag
}
}
_SECTION_END();
_SECTION_BEGIN("Price1");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();
In the upcoming algomojo we will be studying more algorithmic execution features. If in case you are looking for a specific algo execution feature then comment your requirements down below.
Related Readings and Observations
How to Retrieve the Position Book Details from Algomojo This tutorial is for Algomojo users who want to retrieve the realtime position book details (Trading Symbol, Unrealized Profits, Realized Profits, MtoM for the particular traded symbol).
Displaying Weather Dashboard in your Amibroker Thought of brining weather data into Amibroker. Googled for free weather api data. OpenWeathermap came to my notice. Using Openweathermap one can get weather data for any location on the […]
This quick video tutorial explores how to use the log features in Amibroker to record your trades. Logging your trades is the most important part of automated trading to troubleshoot/debug your trading strategy and to find if there is any deviation between trading logic and trade execution?
Amibroker provides the log window feature which helps traders to do the following this
edit-time errors displayed during formula check
run-time errors that occur when formula is running (not edited)
_trace command output within AmiBroker (without using 3rd party debug view)
In order to get the Amibroker Log Open Amibroker -> Windows Menu -> Log
Amibroker Log helps algotrader in the following way
1)Captures the Trade, Trade Qty, Trade Time 2)Captures the Chart ID, Algo Status, Trading Strategy Name 3)Amibroker Generated Signals
which can be used further to do end of the day audit to ensure all the orders are placed properly. In case of any deviation from the logs with the Algomojo Order Log one can fix if there are any deviation in your algo trading process.
Note that _TRACE output is by default directed to outside debugger (like DebugView), in order to enable internal display you need to switch appropriate option in the Tools->Preferences->AFL You can choose to display internally / externally or in both places
Make sure that logs are enabled so that it helps you to decode your trades in case if something goes wrong. If in case you want to save the logs copy the log content from Amibroker Log window and paste it in a notepad/wordpad and save it.
Related Readings and Observations
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 seconds in Algomojo Platform. Let say I want to send 100 […]
How to Retrieve the Position Book Details from Algomojo This tutorial is for Algomojo users who want to retrieve the realtime position book details (Trading Symbol, Unrealized Profits, Realized Profits, MtoM for the particular traded symbol).
This video tutorial explores time-based automated order execution from Amibroker to Algomojo Platform. Generally, Time Based Execution is generally required to close your intraday orders on time or to do automated time-based options hedging to your positions.
You can download the Algomojo Time Based Order Execution Modules by logging into Algomojo-> Tools -> Amibroker Modules
Here is the step by step guidance on how to test Algomojo Time Based Execution Module
Algomojo Time Based Execution Module for Amibroker
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 seconds in Algomojo Platform. Let say I want to send 100 […]
Displaying Weather Dashboard in your Amibroker Thought of brining weather data into Amibroker. Googled for free weather api data. OpenWeathermap came to my notice. Using Openweathermap one can get weather data for any location on the […]
How to Retrieve the Position Book Details from Algomojo This tutorial is for Algomojo users who want to retrieve the realtime position book details (Trading Symbol, Unrealized Profits, Realized Profits, MtoM for the particular traded symbol).
Bernoulli Process – Binary Entropy Function Amibroker AFL Code Here is the Bernoulli Process code snippet translated from Trading pine script indicator which explores the Bernoulli Function/Distribution), and combined with the Shannon Entropy measurement
Scale-In Positions Explained – Amibroker AFL Code If in case you want to add to your existing open positions to your systematic trading then assign sigScaleIn to the BUY/SHORT variable if you want to scale-in (increase the size of) […]
This video tutorial explains how to send automated orders from Amibroker Scanners/Exploration feature. This will be generally helpful for traders who want to trade a basket of symbols (e.g 10 or 30 symbols) either positionally or intraday.
When one is dealing with Exploration-based modules one should very much aware of the configuration and it is a one-time setup and verification needs to be done. And rest of the daily routine work will be made simple once the initial settings are over. Here is the video tutorial on how to configure for Amibroker Scanner/Exploration based execution.
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 seconds in Algomojo Platform. Let say I want to send 100 […]
How to Retrieve the Position Book Details from Algomojo This tutorial is for Algomojo users who want to retrieve the realtime position book details (Trading Symbol, Unrealized Profits, Realized Profits, MtoM for the particular traded symbol).
This tutorial explains how to use the Algomojo Smart Execution Module to send orders based on the current position book. This will be most suitable for Long/Short Positional Traders who want to execute the first trade with the actual positions and every other trade is double the quantity based upon the open positions.
Practical Approach to Amibroker AFL Coding Marketcalls have been a constant contributor to the trading community especially when comes to developing traders skillset on the vast array of topics most likely on the modern principles […]
[Webinar] : How to Send Automated Orders from Amibroker This Webinar will focus on how to send automated orders from Amibroker using Algostudio. It helps traders to understand the nuances involved in Automated trading, challenges faced by the […]
How to Send Time Based Automated Orders using Algomojo? This video tutorial explores time-based automated order execution from Amibroker to Algomojo Platform. Generally, Time Based Execution is generally required to close your intraday orders […]
This webinar explores automated trading using algomojo platform. Algomojo brings more execution facilities and eases out the costing and pain of the algo traders who want to jumpstart with a better algo trading experience.
What is covered in this webinar?
1) How to Send Automated Orders from Amibroker and Tradingview Platform 2) Types of Trading Systems 3) How to Capture the Trade Logs from Chart Based Algo 4) How to Protect Algos from firing unwanted orders 5) Tips and Tricks while using Algomojo Platform
Structurally Nov 2020 series is closing the long pending island gap reversal which is an investing reference. However, emotions are running high during the US presidential election event.
In-order to play the emotions one have to learn to trade against the crowded trading decisions. And the Crowd is long and getting too emotional.
In-Order to play against the crowded bets one can consider using slight ATM Puts hedged with x2 times of OTM Short calls. The thing could bring some cushion for traders to manage the theta decay in the Put Options.
Entry
Buy 1 lot of 12000PE (slight ATM Puts) – 26th Nov 2020 Expiry at 183.20/Lot
Hedge Protection
Sell 2 lot of 12100CE (OTM Calls) – 26th Nov 2020 Expiry at 206.10/Lot Buy 2 lots of 12500CE (OTM Calls) – 26th Nov 2020 Expiry at 55.00/Lot
Total Margin Required for Hedged Position : Rs1,07.542
Nifty LTP : 12080
Strategy Breakeven Point: 12159 Exit on Nifty Closing the Monthly gap (i.e Nifty Futures testing 11600 levels)
Strategy Risk Level: Moderate Risk Level and Risk increases if Nifty starts moving above 12200 level.
Strategy Expectation : Liquidation towards 11600 levels in Nov 2020 series.
The strategy has protection up to 12150 levels. If Nifty goes beyond 12200 levels it requires exit on the hedge until then, No strategy adjustment is required.
Algomojo provides functionality to send option orders using PlaceFOOptionsOrder function. which can be used to send automated orders from Tradingview/Amibroker application to trigger ITM/ATM/OTM option orders.
Algomojo offers free API + Free Platform with No upfront fees, no minimum turnover, no special terms and conditions, no clauses, no strings attached for the algomojo clients.
PlaceFOOptionsOrder API information
Here is the sample request and response example from the algomojo documentation.
# Here is a curl example
curl \
-X POST https://abapi.algomojo.com/1.0/PlaceFOOptionsOrder
-X POST https://tjapi.algomojo.com/1.0/PlaceFOOptionsOrder
-X POST https://zbapi.algomojo.com/1.0/PlaceFOOptionsOrder
To get characters you need to make a POST call to the following url :
https://abapi.algomojo.com/1.0/PlaceFOOptionsOrder https://tjapi.algomojo.com/1.0/PlaceFOOptionsOrder https://zbapi.algomojo.com/1.0/PlaceFOOptionsOrder
Request example :
{
"api_key":"c1997d92a3bb556a67dca7d1446b7087",
"api_secret":"5306433329e81ba41203653417063c71",
"data":
{
"strg_name":"Options",
"spot_sym":"NIFTY",
"expiry_dt":"05NOV20",
"opt_type":"PE",
"Ttranstype":"B",
"prctyp":"MKT",
"qty":"75",
"Price":"0",
"TrigPrice":"0",
"Pcode":"NRML",
"strike_int":"50",
"offset":"10"
}
}
Response example :
{
"NOrdNo": "200810000017432",
"stat": "Ok"
}
Understanding the ATM/ITM/OTM options selection process
One can select the ATM/ITM/OTM strike price automatically by selecting the offset value as shown from the above API request information. For placing orders in ATM strikes one have to send the offset value to zeroand if one needs to select lower strike price then negative offset needs to be used and positive offset for selecting higher strike price than the last traded price.
Below example explains the various offset values and how to ATM/ITM/OTM values are decided based on the offset parameter selection.
Tradingview Webhook
Tradingview supports webhook alerts from Tradingview Pro plan onwards. Webhook is a unique way of communicating in realtime from one application to another application. Webhooks are automatic. You don’t have to manually utilize them in order to make them work — once they’re set up, they run on their own.
Tradingview Webhook Alert Configuration
Here are the different webhook configuration settings for various type of orders. Note for bracket orders one need to send along with token id. Which will be discussed in the upcoming articles.
Webhook URL for placing Option orders (ATM/ITM/OTM orders)
Note : One can send orders from Nifty Spot/Nifty Futures and also the ATM/ITM/OTM calculations will be done at the Algomojo end and not at the Tradingview side.
Here order is send for ATM PE for 05th Nov 2020 contract and the execution happened immediately at 12100PE when the Nifty spot price is around 12085 levels.
Here is the Tradingview Pinescript code for open range breakout. It a prototype code to build your own indicator/trading system on top of open range breakout levels. Traders can now build backtestable trading systems on top this pinescript code snippet.
Open Range Breakout is a simple strategy that monitors the first 5min / 15min / 15min / 30min / 60min range from the start of the market. From the opening high range and low range is calculated for the specified timeframe. Most of the Pinescript code found on the internet is either buggy or not suitable for building back-testable trading systems.
To solve this issue we are releasing a prototype for ORB – Open Range Breakout Levels.
By default, the code uses a 60min range breakout from the market open. However, Parameters can be changed from the Parameter window. Currently Open Range breakout options are available for various timeframes.
Note : If your charting timeframe is 5min then higher resolution can be accessed from the Resolution Input section. And Ensure while setting the Breakout Timings are set from the start of the exchange timings and ends at the resolution timings. For example if in case you want to monitor first 15min breakout levels then Resolution should be set to 15min and Breakout Timings to 0915 – 0930 range
However, if someone needs a customized ORB range then code customization needs to be done accordingly on top of the code.
Code will start plotting the Open Range values only if the Open Range timeframe is completed else nothing will be plotted. For example for an Open Range value of 60min. The plot will start only from 10:15:00 onwards for NSE Futures instruments and will start from 11:00:00 onwards for MCX futures instruments automatically.
Alerts are also added to set automated alerts and can be later triggered into orders. If in case you are new to Automated Orders in Tradingview check out this tutorial
This a brief video guide for the momentum traders which explains right from what is momentum trading,how momentum trading is related to the diffusion innovation model, How to identify momentum, Different types of momentum
This video tutorial also focus on couple of momentum trading strategies and how one should follow their own strategy. How backtesting plays a major role in systematic trading. How momentum traders can take advantage of fat tails.
I am excited to announce the most demanded feature from Algomojo clients.
Yes, from now onwards Multi-Account Execution from trading tools like Amibroker, Metatrader 4 and Metatrader 5, Ninjatrader 7, Ninjatrader 8, Excel,Tradingview is now possible at zero additional cost for all the algomojo trading clients.
Traders can have multiple trading accounts with multiple partner brokers (Aliceblue, Enrich, Tradejini, Zebu) of Algomojo and enjoy both single client and multiclient execution at no additional cost. And more brokers are likely to onboard in the very short run.
If in case you are new to Algomojo then kick start with this Introductory session
AlgomojoMetatrader 4 & 5 Bridges are designed in such a way to send trading orders from both mql4 and mql5 indicators and expert advisors
Trading Bridge is designed to supports both single client vs Multi-Client Execution, One can use the Algomojo python library to send automated orders to both individual and multi-client accounts.
To install the latest Algomojo Python Library from your command prompt type
All the above features can be retieved via trading platforms like Amibroker, Metatrader4, Metatrader 5, Excel, Ninjatrader 7, Ninjatrader 8, Python and any trading programs supporting algomojo http-rest API.
If you are a custom program user and need to develop trading solutions on top of HTTP-Rest API then try out the in-depth algomojo API documentation
Multi Client Order Placing from Amibroker
Multi Client Order Placement from Metatrader 4 Expert Advisor
Multi-Client Order Placement from Metatrader 5 Expert Advisor
In case you want to access the automated trading facilities offered by algomojo then open a trading account with Algomojo and enjoy unlimited access with Free API and Free Algo Trading Platform.
Hold your breath, more sophisticated, and also Simple Algo Execution tutorials lined up. Stay tuned. The next tutorial will explore the Trading Bridges one by one right from how to setup and how to make use of those facilities provided by Algomojo.
This video tutorial discusses Data Vendors, Data Types, Data Configuration, and How to use the Data Manager with trading tools like Amibroker and the basic difference between Authorized Data Vendors Vs Illegal Data Vendors
Interested in Designing your own trading systems?
If you are interested in creating your own trading indicators, scanners, trading strategies and want to automated your codes?
Then here are the 75+ hours of Mentoring Program Starting from 23rd Nov onwards. Session will be conducted during the evenings 6p.m – 9p.m
1)Who Should use Amibroker? 2)Different Types of Data 3)Authorized Data Vendors Vs Unauthorized Data Vendors 4)About Data Managers 5)How to Configure the Amibroker Database 6)Continous Vs Non-Continous Contracts 7)Importance of Authorized Data vendors 8)How to understand the different data vendors plans 9)How to check the Authority of the data vendors
Thought of implementing a simple intraday trading system with stoploss and target controls with time-based entry and exit controls. Traders can use this code as a prototype to design their own intraday trading strategy
Tradingview Pinescript brings more interesting way of implementing pure intraday trading system with target and stoploss.
Here is a simple Intraday Trading System Module. Sort of a Coding Snippet to create your own intraday trading system with the following signals
1)Buy Signal 2)Sell Signal 3)Stop Exit 4)Target Exit 5)Square.Off Exit
Note: It is not a Tradingview strategy but more of visual indications. Kindly use the module to build your strategy on top of this code. For simplicity purpose explained with EMA crossover strategy.