In this webinar, we will be discussing the practical challenges faced by the Naked Option Buyers and Naked Option Sellers and how to better trading decisions while Naked Option Buying or Naked Option Selling.
Who Should Attend?
Beginners Who are new to Options and Who want to know the basics of Option Buying and Option Selling.
What Topic is Covered
1)When to Trade Naked Option Buying. 2)When to Trade Naked Selling. 3)Practical Challenges involved in Naked Buying and Naked Selling. 4)Nifty and Bank Nifty Market Outlook and Market Preparation. 5)How to take Expiry View.
Webinar – Introduction to Algomojo Platform We are doing 2 hours of live session on Introduction to Algomojo Platform for Automated trading where we will be discussing How to set your trading desk, trading requirements, and cost […]
How to Build a Winning Trading System Here is a practical guide to Building a Winning Trading System. It explains what a trading system is all about and what are the key components required for building a profitable trading system.
Practical Approach to Trend Following Here is a course on Trend following which brings you a step by step approach in gaining expertise towards trend following and systematic trend following systems with proper risk management […]
Introduction to Market Profile – Recorded Webinar This webinar gives you the basic introduction to Market Profile and helps traders how to read market profile charts. And What one can understand from the Profile and Profile Distribution.
Algotrading using Amibroker – Hindi Webinar First ever hindi webinar from marketcalls on how to send automated orders using Amibroker software and Algoaction Platform. This webinar will be the basics of how to kick start your career […]
[Webinar] : How to Create Multi Timeframe Trading Strategies In this webinar, you will be learning how to create How to Create Multi Timeframe Trading Strategy. And insights on how multi timeframe apporach could help you to take better trading decisions.
Last time we tried to evaluate the fair value of metal index using extreme sentimental and running point of control when the metal index stares at 60% draw-down.
The metal index in the last couple of months had recovered from the drawdown moved significantly from 1483 to 2550 levels which delivered 72% returns since the low of March 2020 when the entire nation goes for a lockdown. Tremendous value investing opportunity struck when the economy almost came to standstill.
At this point in time sector is bit over heated and nearing the important resistance zone 2580 where profit booking and consolidations are likely to be expected in this zone before the metal index move out of this zone.
As the price travels around important zone more trading participants will be likely to chase momentum and might get could with any breaks and breakout failures are likely common when the whole crowd is expecting more and more.
Related Readings and Observations
Nifty IT – Stretched Valuations – Investors Caution Zone Listen, IT is the hottest sector when USDINR is hitting the all-time high. pharmaceutical and information technology are the sectors which earn a big part of their revenues in dollars. […]
6 Reasons Why Nifty Pharma Will Make 50% upside from here. Nifty Pharma one the most hated sector in this bull market for a variety of reasons. The number one reason is negative returns since Apr 2015. Till now index had lost a maximum of 42.28% […]
RRG Study : Indian Stock Sectors Under Trouble? Bank Nifty shows a considerable strength in the current fall of CNX Nifty. Compared to other sectors the relative strength in Bank Nifty is far better. However most of the sectors shows a […]
Nifty Hourly Fibonacci Resistance
Nifty CMP : 2922 Charts Shows the Fibonnaci Resistance levels drawn between the recent high 3110 and the recent low of 2813. And Here are the Fibonacci levels. […]
In this tutorial we discussed how to bring Cointegration statistics into Amibroker using Amipy and how to interpret the values returned by Augmented Dickey Fuller test.
Cointegration is used in Statistical Arbitrage to find best Pair of Stocks (Pair Trading) to go long in one stock and short(Competitive peers) another to generate returns.
Tools required to Compute Cointegration in Amibroker
sometime back did a detailed AmiPy Installation Procedure to send data from Amibroker to python program to do complex statistical computations and return the values back to Amibroker.
What is Statistical Arbitrage?
Statistical Arbitrage is nothing but pair trading based on their relation of stock with one another.
Often, the stock price of companies in the same sector or type of business follows one another very closely. Cointegration is a better way to observe the relationship between two stocks and buys or sells. whenever the relationship gets out of sync, acting on the assumption that the spread will revert back to the mean.
What is Co-Integration?
Co-Integration helps in identifying best stock pairs where the spread could revert to mean value. Co-Integration looks for stationary pair where the mean of the spread is fixed. Whenever the spread is deviating from the mean it generates trading opportunity and the spread will possibly revert back to the mean value.
What is Stationarity?
Most of the financial trading instruments are non-stationary i.e mostly unpredictable whereas Stationarity is more of a predictable time series and which satisfies the following conditions 1) has a constant mean 2) has a constant variance 3) There is no seasonality observed
Let me explain with a funny example which explains Co-Integration in a better way. “A drunken man is walking on the road along with his dog chained and tied up with the drunkard’s hand. When the man is drunk and he is expected to walk random and the chained dog is also expected to walk random(assume a small little puppy 🙂 ). The maximum distance between them could be the length of rope holding the chained dog and it is always fixed. Whenever the distance/spread between the Drunken Man and the Dog goes near to the max distance we can expect a mean reversion in the distance to the mean” In simple words the drunken man and the dog both are Co-Integrated.
If two stocks are highly correlated then both the stocks will move in the same direction most of the time however the magnitude of the moves is unknown and spread can keep increasing as long as it could as shown in the above example. However Co-Integration looks for mean reversion in the spread/distance and the spreads are tradeable. Augmented Dicky Fuller test is generally used to identify with a certain level of confidence whether the spread between two stocks or time series is stationary and cointegrated or not.
Augmented Dickey-Fuller (ADF) Test
The Augmented Dicky Fuller test is a hypothesis test that a signal contains a unit root, we want to reject this hypothesis. The test gives a pValue, the lower this number the more confident we can be that we have found a stationary signal. P-values less than 0.5 are considered to be good mean-reverting stock pairs. Some of the experts even look for values P-values less than 0.1. P-values above 0.1 are likely to be non-statinary and trading such stock pairs are not advisable.
The null hypothesis of the Augmented Dickey-Fuller is that there is a unit root, with the alternative that there is no unit root. If the pvalue is above a critical size, then we cannot reject that there is a unit root.
The p-values are obtained through regression surface approximation from MacKinnon 1994, but using the updated 2010 tables. If the p-value is close to significant, then the critical values should be used to judge whether to reject the null.
Values returned by ADF test using statmodels python library
Parameters
Interpretation
adf
The test statistic.
pvalue
MacKinnon”s approximate p-value based on MacKinnon (1994, 2010)
usedlag
The number of lags used.
nobs
The number of observations used for the ADF regression and calculation of the critical values
critical values
Critical values for the test statistic at the 1 %, 5 %, and 10 % levels. Based on MacKinnon (2010).
icbest
The maximized information criterion if autolag is not None.
Above image shows Cointegration Statistics between ICICI Bank and HDFC Bank since the last 75 trading sessions which shows the P-Value is less than 0.05 (Highly Co-Integrated) and thereby rejecting the null hypothesis (stationary data)
Dashboard also shows the that ADF test statistic value -2.9379 is greater than the critical values 5% – -2.9020 which indicate a possibly best pair to look for mean reversion in the spread.
The second example showing Infy and TCS Hourly Future charts with P-Value 0.25 is greater than 0.05 threshold which indicates the data is non-stationary (that means it has relation with time).
Computing Co-Integration in Amibroker
Since Co-Integration is a statistical model it is relatively difficult to code in AFL Programming Language we rely on AmiPy 64 bit Amibroker plugin and statistical computing python packages like numpy(to handle arrays), Pandas(to handle time-series data) and statsmodels(to do ADF test) where the close arrays of two stock pair are passed from Amibroker and the CoIntegration is computed by python and revert back to Amibroker.
Cointegration – Amibroker AFL
Coinegration.py
Sample IPython Notebook to compute Cointegration below using NSEPy without Amibroker:
Sample values are verified with the Amibroker using Datalink as the data source for the HDFC and HDFC Bank Pair
Hope this article help you lean more about co-integration.
Introduction to QuantZilla QuantZilla is a 75+ hours of immersive coding mentor-ship program on designing trading systems, converting trading ideas into indicators and trading strategies, automating the trading systems.
[Online Workshop] Trading Strategies for Active Traders Learn the nuances of trading/investing strategies, the art of chart reading and picking up high probability trades. It is an educational workshop for active traders focused on how to pick […]
K-Lintra is a trend following system which uses the combination of Kaufman adaptive moving average and Linear regression-based volatility channel. It uses an adaptive approach to switch the time period and thereby dynamically able to adapt to changing market dynamics.
Primary objective of the k-lintra trend following system is to reduce the number of trades and thereby making the system completely independent of slippages and thereby bringing consistency in return and maximizing the overall gain of the portfolio.
What is a Trend Following System?
According to Wikipedia, Trend following or trend trading is a trading strategy according to which one should buy an asset when its price trend goes up, and sell when its trend goes down, expecting price movements to continue.
Traders who employ a trend following strategy do not aim to forecast or predict specific price levels; they simply jump on the trend (when they perceived that a trend has established with their own peculiar reasons or rules) and ride it.
How to classify the market based on market volatility?
K-Lintra uses a PercentRank Based Smooth ATR to Predict Change in Volatility, in-order to identify market regime shift from low volatility zone to high volatility zone and vice versa.
Basically Volatile seasons are classified into four categories
1)Low volatile season 2)Extremely low volatile season 3)High volatile season 4)Extremely high volatile season
input parameters are dynamically changed based on the changing volatile market dynamics. Volatility is measured on the hourly timeframe.
Strategy is ready to plug and play with Automated trading tools. However one can play with manual limit order execution as well.
Backtesting Performance
Inorder to test the system parameters following parameters are used
Parameters
Value
Trading Instrument
Nifty Futures
Backtesting Timeframe
Hourly (Continous Data)
Backtest Length
Jan 2011 – May 2020
Strategy Type
Volatility based Trend Following
Position Size
1 Lot (Fixed Position Sizing)
Slippage + Commissions
0.03%
Trading Capital
RS 3,00,000
Trading Leverage
max of 4 times
Backtesting Statistics
Key Backtesting Performance Metrics
Key Performance Metrics
Value
Sharp Ratio
1.14
Max System Drawdown
1.58L/lot (unhedged risk)
Calmar Ratio (CAR/MDD)
1.02
Recovery Factor
7.73
Profit Factor
1.71
Payoff Ratio
1.86
Risk-Reward Ratio
2.06
Trading System Parameters
Parameters
Values
ATR Value
100
Length 1 – Extreme Low Volatility
90
Length 2 – Low Volatility
50
Length 3 – Extreme High Volatility
90
Length 4 – High Volatility
200
Is the strategy looks into future
No
Does the Strategy Repaints
No
Does the Strategy Optimized
Yes
Is it over-optimized or Curvefitted?
No
Does it Pass the System Validation Test?
Yes
kLinTRA V5 – Equity Curve
K-Lintra – Drawdown Curve
K-Lintra Absolute Profit Table in Multiples of Thousands
Points Made – Year wise
Year
Points Made per lot (Net of Slippages/Commissions)
Nifty Futures Quick Flip November Overview : Short Term Outlook Nifty is still trading in a 10500 - 10640 consolidation range where quick flip strategy turned to sell mode around 10587 and it continues to be in the sell mode with immediate resistance […]
Nifty Futures Quick Flip Overview – Nov Futures Nifty Futures quick flip is continuing its uptrend since 31st Oct 2018 onwards so far current buy signal completed 6 trading session or 1785 minutes. Comparing with the historical holding […]
Quick Flip Trading System – Tradingview Indicator Quick Flip is an interesting short-term trend following trading system from marketcalls for identifying quick turns in the markets and to take faster trend decisions in identifying the […]
Introduction to Backtesting a Trading System using Amibroker Backtesting is a simple process which helps a trader to evaluate his trading ideas and provides information about how good the trading system performs on the given historical dataset. It […]
This webinar we focus on Different type of traders emotions using Market Profile Concepts and How one can convert that into a trading edge.
1)How Market Profile helps traders to uncover the overall trader’s emotions in the market
2)How to understand the emotions of Momentum Traders
3)How to convert trading emotions into a trading opportunity
4)Importance of Visual references while markets are showing emotions.
Related Readings and Observations
Tradezilla – Online Mentorship Program for Traders Tradezilla is India's first ever exclusive and intensive ever online trading mentorship program for budding traders. Event will focus on providing quality information to Traders, […]
How to Read a Market Profile Chart? Market Profile is not a trading system but a market generated information and a decision supportive system along with your existing trading systems. It provides you knowledge about who is […]
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 […]
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) LONG/SHORT position.
sigScaleIn is a special value assign to BUY/SHORT value to add to the existing positions. Here is a prototype AFL code that performs automated scale-in when the buy signal continues and also 39-EMA hook reversal happens.
What is 39-EMA hook reversal?
Is is a price zone where the previous candle breaks down below the 39-EMA followed by the candle which closes above 39EMA
buycontinue = Flip(Buy,Sell);
//Scalein Conditions
pyramid = buycontinue AND Ref(C,-1) < EMA(Close,39) AND Close > EMA(Close,39);
Position Sizing
Position Sizing needs to be done accordingly. If Buy = True then regular positionsize should happen For Example Purchasing 2,00,000 worth of shares and during scalein 1,00,000 worth of shares will be added to the existing position.
Introduction to QuantZilla QuantZilla is a 75+ hours of immersive coding mentor-ship program on designing trading systems, converting trading ideas into indicators and trading strategies, automating the trading systems.
[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 […]
Here is the Bernoulli Process code snippet translated from Trading pinescript indicator which explores the Bernoulli Function/Distribution), and combined with the Shannon Entropy measurement
In case you need a primer for Bernoulli Distribution. Start here
//////////////////////////////////////////////////////////
//Coded By Rajandran R - Founder - Marketcalls //
//Co-Creator - www.algomojo.com //
//Creation Date - 01st Sep 2020 //
//////////////////////////////////////////////////////////
//Translated from Tradingview Pinescript
//url : https://www.tradingview.com/script/bvYZ1CdF-Bernoulli-Process-Binary-Entropy-Function/
_SECTION_BEGIN("Bernoulli Entropy function");
SetChartOptions(0,chartShowArrows|chartShowDates);
src = ParamField("Source");
len = Param("Length",22,1,100,1);
range = Param("Range",0.67,0.01,1,0.01);
average = Param("Average",88,1,100,1);
vPR = Param("Percent Rank Limit",5,1,10,1);
cr = src/sum(src,len); //source, typ close, percent of close, measured over summation period
vr = log(volume)/sum(log(volume),len) ; //volume data, percent of volume, measured of summation period
vr2 = min(max(percentrank(vr,average)/100,0.001),0.999) ; //cutting out 100% and 0% readings, changing to +/-3sigma
cr2 = min(max(percentrank(cr,average)/100,0.001),0.999) ;
infoc = sum((cr2*log10(cr2)/log10(2)) - (1-cr2)*log10(1-cr2)/log10(2),len); //p(close)*log2(p(close)) - (1-p(close))*log2(1-p(close))
infov = sum((vr2*log10(vr2)/log10(2)) - (1-vr2)*log10(1-vr2)/log10(2),len);
info2 = infoc - infov ;
color = IIf(info2>range, colorGreen, IIf(info2<-range,colorRed,colorGrey40));
Plot(info2,"Info",color,styleHistogram | styleThick);
Plot(infoc,"Price",colorBlue);
Plot(-infov,"Volume",colorOrange);
hvp = percentrank(info2,average);
PlotShapes(IIf( hvp < vPR;, shapeUpArrow, shapeNone),colorlime, 0,info2, Offset=-25);
PlotShapes(IIf(hvp>(100-vPR), shapeDownArrow, shapeNone),colorred, 0,info2, Offset=-25);
_SECTION_END();
Simple Trading System Based on Bernoulli Entropy function
//////////////////////////////////////////////////////////
//Coded By Rajandran R - Founder - Marketcalls //
//Co-Creator - www.algomojo.com //
//Creation Date - 01st Sep 2020 //
//////////////////////////////////////////////////////////
_SECTION_BEGIN("Trading System Based on Bernoulli Entropy function");
src = ParamField("Source");
len = Param("Length",22,1,100,1);
range = Param("Range",0.67,0.01,1,0.01);
average = Param("Average",88,1,100,1);
vPR = Param("Percent Rank Limit",5,1,10,1);
cr = src/sum(src,len); //source, typ close, percent of close, measured over summation period
vr = log(volume)/sum(log(volume),len) ; //volume data, percent of volume, measured of summation period
vr2 = min(max(percentrank(vr,average)/100,0.001),0.999) ; //cutting out 100% and 0% readings, changing to +/-3sigma
cr2 = min(max(percentrank(cr,average)/100,0.001),0.999) ;
infoc = sum((cr2*log10(cr2)/log10(2)) - (1-cr2)*log10(1-cr2)/log10(2),len); //p(close)*log2(p(close)) - (1-p(close))*log2(1-p(close))
infov = sum((vr2*log10(vr2)/log10(2)) - (1-vr2)*log10(1-vr2)/log10(2),len);
info2 = infoc - infov ;
color = IIf(info2>range, colorGreen, IIf(info2<-range,colorRed,colorGrey40));
//Plot(info2,"Info",color,styleHistogram | styleThick);
//Plot(infoc,"Price",colorBlue);
//Plot(-infov,"Volume",colorOrange);
hvp = percentrank(info2,average);
Buy = info2>range;
sell = info2<-range;
Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);
/* Plot Buy and Sell Signal Arrows */
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorGreen, 0, L, Offset=-40);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorLime, 0,L, Offset=-50);
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-45);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorRed, 0, H, Offset=40);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorOrange, 0,H, Offset=50);
PlotShapes(IIf(Sell, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-45);
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", color, styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();
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) […]
Introduction to QuantZilla QuantZilla is a 75+ hours of immersive coding mentor-ship program on designing trading systems, converting trading ideas into indicators and trading strategies, automating the trading systems.
Simple Volatility Exploration – Amibroker AFL Code Here is a simple Amibroker AFL Code to Explore (Scan) in Amibroker to get a picture about the recent volatility and how the volatility in the market is behaving to get a perspective about the market.
Hurst exponent is originally developed by the famous hydrologist Harold Edwin Hurst to study the Long-Term Storage Capacity of Reservoirs. Hurst is developed to model reservoirs but later found to be used in other natural systems to measure the long term memory of time series.
Hurst was looking for a better way to model the levels of the river Nile to construct an appropriately sized reservoir system.
In a Hurst Exponent is used to determining the trend persistence (i.e whether a given time series is trending, mean-reverting or random series)
How to Read Hurst Exponent Values?
Hurst value ranges between 0 < H < 1
i) Trending: If the Hurst value range is between 0.5 < H < 1 indicates persistence in time series. The higher the value of the Hurst exponent more the trendiness of the market structure. For values close to 1 the series is persistent.
ii) Mean Reverting: If the Hurst value range is between 0 < H < 0.5 indicates anti persistence in time series. The lower the value of the Hurst exponent more the mean-reverting behavior (trend reversal). For values close to 0, the series is anti-persistent
iii) Geometrical Brownian Motion: It explains the random walk with the l unpredictability of the time series. If Hurst Exponent value is H = 0.5 then the time series is expected to move in a random walk.
Geometric Brownian Motion is widely used to model stock prices in finance
Jupyter Python Notebook to compute Hurst Exponent for Nifty
To Compute Sectoral NSE Indices Returns using Python First of all thanks for your impressive and motivational reponse for the Nifty Returns Heatmap Generation post. Here is yet another simple visualization stuff using python to compute bunch […]
Nifty Returns Heatmap Generation using NSEpy and Seaborn Everyone love to visualize this market in their own way. Python comes handy when comes to visualization. One of the Awesome programming language to code any level of complexity. However I […]
Tradingview undoubtedly a single place to access all the global trading instruments at one single place and up to date the online portal never failed to surprise the traders and investors.
Now Tradingview recently enabled NSE Futures and MCX Futures realtime charts and guess the popularity of Tradingview just only goes higher from the Indian Fans side.
If you are very new to Tradingview then one can start with this Intro Webinar.
NSE Future Charts
Currently, all the NSE Future charts are available in both continuous and non-continuous contracts as shown below. Continous contracts are available for both Current Month and Next Month and However contract-based futures data is available for the Current Month, Next Month, and Far Month.
Nifty Futures – Continuous Contract
MCX Futures
When comes to MCX Contract Trading view offers both continuous and non continuous contract. Current and Next Month continuous contract is provided and upto 6 contracts are offered in non continuous contract section.
Crude Oil MCX Futures
How to Access NSE and MCX Contracts?
Step 1 : Goto TradingView Platform Step 2 : Goto the Symbol Section and type the exchange name NSE: or MCX: and select the future option as shown below
Quick Flip Trading System – Tradingview Indicator Quick Flip is an interesting short-term trend following trading system from marketcalls for identifying quick turns in the markets and to take faster trend decisions in identifying the […]
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 […]
How to Integrate Tradingview Charts and Ideas with Amibroker In the last tutorial we had seen a simple trick to access fundamental screener inside the Amibroker EOD database. Now how about accessing trading intraday charts, indicators and trading […]
We are doing a Webinar on Introduction to Orderflow Trading and How to Spot Trading nuances using order flow.
When : Sep 12, 2020 08:00 PM
Topics Covered :
1) How to Understand Orderflow Charts 2) Tracking the Buyers and Sellers using Orderflow Charts 3) Orderflow Charts Vs BookMap 4) How Orderflow helps traders to time their intraday trades
Discussion: Naked Option Buying Vs Naked Option Selling In this webinar, we will be discussing the practical challenges faced by the Naked Option Buyers and Naked Option Sellers and how to better trading decisions while Naked Option Buying or […]
Webinar – Introduction to Algomojo Platform We are doing 2 hours of live session on Introduction to Algomojo Platform for Automated trading where we will be discussing How to set your trading desk, trading requirements, and cost […]
How to Build a Winning Trading System Here is a practical guide to Building a Winning Trading System. It explains what a trading system is all about and what are the key components required for building a profitable trading system.
Practical Approach to Trend Following Here is a course on Trend following which brings you a step by step approach in gaining expertise towards trend following and systematic trend following systems with proper risk management […]
Tijori Finance a sleek design portal to access in-depth data such as market share, revenue break-up, location exposure, operational metrics shareholding & financial on companies
Compared to traditional market scanners, Tijori Finance provides various financial & operational metrics with detailed insights into the particular company or sector level analysis that helps long term investors to make better trading decisions.
Undoubtedly the alternative data stream on companies and supply chains provided by Tijori Finance helps Investors and Fund Managers to extract new sources of information that may provide an untapped source for creating Alpha.
What is Alternative Data?
Alternative data is an unorthodox way of collecting unstructured data about the company or sector and convert into a structured format, so that when you apply analytics to the data, they yield additional insights that complement the information you receive from traditional sources
Operational Metrics for Page Industries
One can also run queries such as “Show me FMCG companies with sales volume increasing”
Other than Alternative data tijori also provides the traditional company financials, competitor analytics, company balance sheets, investor metrics, shape holding pattern, financial ratios etc in a very detailed fashion.
Company Financials
Insights into Competitor Analysis
Suppliers and Investors Details
Sector Level Analysis
Here are the insights for the pharma sector where one can appreciate the amount of alternative data collected by the portal. And the Alternate-Data varies for various sector and it is mind-blowing the way the details are organized
Macro Indicators
Tijori also provides marco indicators which tracks the core strength of the indian industries thereby knowing the Indian economy.
Alternative data provides huge value insights and all thanks to Tijori Finance for bringing a global standard to Indian Investors.
Related Readings and Observations
How to Look for Smart Money Flow? Identifying Smart money flow is the key essential skill for every professional trader. There are many online tutorials and indicators which explains how to spot smart money flow. But how […]
Nifty and Montly 5 EMA
As the trading month is going to end tommrow its good to view the montly charts ofnifty. As of now its trading below 5 EMA(4883). So Possibly nifty could close above 4883by […]
How Are Commodities Chosen In The Commodities Market? What are the most important commodities that are traded in the commodities market? Well, this is not only a potent question but a vital one whether we are purchasing these commodities in […]
Next GANN Supports around 5180 Nifty GANN Resistance near at 5180.However NMA had already delivered the sell signal in nifty. Also it had been observed that still 5200PE has the huge Open Interest among the strike […]
Year 2013 Performance in Nutshell – Infographic Year 2013 is about to end by tomorrow. So which assest class among Index,Commodities,Forex performed good for this year? Below infographic shows the year to date performance of various […]
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 about the market participants and how one can use effectively for their Intraday Trades.
Date & Time : 19th Sep 2020, Sat 8.00p.m – 10.00p.m
What is Covered in the Webinar?
1)How Market Profile can be used for Intraday trades 2)Mindset for Intraday Trading 3)Market Profile and Intraday Trading References 4)Preparing for the Next Trading Week using Market Profile 5)Market Profile Outlook for Nifty and Bank Nifty Futures
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 […]
Thought of titling “What could possibly go wrong with Nifty IT sector” – however, thought of let’s not get into overhype mode. By any means, IT is the hot sector in town. And the valuation of the counter is skyrocketing and investors are busy chasing the momentum.
Interestingly quarterly charts are way above one standard deviation levels and making it fundamentally overvalued and riskier from the long term investing perspective.
Too make it even more alarming the real volatility is accelerating at 3457. Acceleration is not stopping by that shows the Euphoria and extreme positive feedback loop among the investors.
Currently, the Quarterly return is at 33% i.e a move from 14767 to 19627 levels. Needless to say Nifty IT index around 2009 low was 1992 levels and since then 10x returns in the index component itself. And now the acceleration of returns are reaching the extreme.
What do you think. How far Nifty IT could accelerate? When it will be crashing? What could be the trigger for the crash?
Let me know your observation in comments.
Related Readings and Observations
Nifty IT – Stretched Valuations – Investors Caution Zone Listen, IT is the hottest sector when USDINR is hitting the all-time high. pharmaceutical and information technology are the sectors which earn a big part of their revenues in dollars. […]
Nifty Metal Index – Sector Outlook Last time we tried to evaluate the fair value of metal index using extreme sentimental and running point of control when the metal index stares at 60% draw-down.
Nifty Futures – Short Term Overview – October Futures A lot of weird things happened during Wednesday trading session. Nifty Smallcap closed positive while Nifty Spot lost more than 150 pts. India VIX spiked above 18.12 levels.
Prevailing […]
6 Reasons Why Nifty Pharma Will Make 50% upside from here. Nifty Pharma one the most hated sector in this bull market for a variety of reasons. The number one reason is negative returns since Apr 2015. Till now index had lost a maximum of 42.28% […]
Is the Nifty IT Sector OverValued? Nifty IT (Previously CNX IT) hit is bear market low at 1992.8 on 6th March 2009 since then its journey towards the upside move had generated more than 5.5x returns in the last 6 years. But […]
If you are planning to backtest a trading system with leverage in Amibroker this tutorial will help you to backtest leveraged trading systems properly. This example helps cash market trader to build their leverage trading systems properly.
What is Leverage?
Leverage is a way to increase the purchasing capacity of the trading instrument. It is a facility provided by the broker firm to maximize the trader’s returns. Playing a leveraged strategy will result in maximized returns with lower capital and at the same time it also directly increase the trading risk involved.
For Example, Let say if the broker provides 4 times leverage then with Rs40,000 investment one can take a position up to Rs160,000.
Assume that you are having a investing capital of Rs1,00,000 and in every trade you are planning to invest Rs40,000 per trade. Whenever there is a 20EMA and 50 EMA positive crossover long entry will be made with a position sizing of 40,000 x 4 times the leverage provided by the broker. Hence the Net position value per trade is Rs1,60,000
Though Initial capital is Rs1,00,000 and the trade involves leverage one need to maintain buffer money to manage the Market to Market (MTM) Loss if any. Hence Rs40,000 is used for position sizing to invest in every trade and the remaining Rs60,000 is used to maintain buffer money to manage the MTM loss.
Here is the Backtesting result with 4 times leverage in Infosys on a daily timeframe,
If Leverage = 4
Returns with x4 times leverage = 71.46%
Drawdown (Max Risk incurred) = – Rs 62034
Here is the Back testing result with 1 times leverage(i.e no leverage) in Infosys on a daily timeframe,
If Leverage = 1 (i.e no leverage)
Returns with x4 times leverage = 17.73%
Drawdown (Max Risk incurred) = – Rs 15385
Controlling the Margin Via Backtesting Settings
One can control the leverage from the code itself as shown in the above afl code. Alternatively you can also control the investment capital and leverage from the Backtester settings. However if you are controlling from the code then code will take higher precedence.
Account margin setting defines the percentage margin requirement for the entire account. The default value of the Account margin is 100. This means that you have to provide 100% funds to enter the trade.
When you buy on margin you are simply borrowing money from your broker to buy stock. If your broker provides 4 times leverage then enter the account margin as 25%. If your initial equity is set to 100000 your buying power will be then 400000 (x4 times leverage) and you will be able to enter bigger positions than your initial capital.
In the next tutorial we will be discussing about how to set the margin trading for futures instrument.
TRIN finally shoots above 1
Nifty today(Aug 17,2009) Shoots abvove 1 indicating a strong bearishness for shorter term. Also broken the major supports 4530 levels as indicated in previous posts. Also […]
Copper Breaking Down? Now copper is trading around $2.8626 & as we can see on charts , after spending more than 10 trading session , finally copper providing a downside breakout with aggressive volume. The […]
Introduction to Option Action – Video Tutorial In this video tutorial we will explore the basic features and functionalities of Option Action, How to create option strategies and how to interpret the payoff graph.
The Death of 25 Paisa From June 30 2011, 50 paise will be the minimum coin accepted in the markets as all denominations below it will cease to be legal currency. Also, the entries in books of accounts, pricing […]
O2A – Odin Diet to ASCII Data Downloader O2A - Odin to ASCII extracts Market Watch data from Odin Diet clients, and outputs the data to ASCII files. The program currently captures Equities, Futures & Options scrips of NSE […]
Nifty Smallcap index formed a classical bullish island reversal pattern during the last week of May 2020 since then index rallied from 4000+ levels to 6000 levels.
An island reversal is short-term reversal pattern that forms with two overlapping gaps. Refer Nifty FMCG Bearish Island Reversal charts for similar examples from the past.
Island gap zone in Small Cap comes around 4040-4060 levels. Though monthly structure currently trading above the Mar 2019 crash high i.e above 5810 levels. Going forward it is one of the important pivot levels to watch from the sentimental reference perspective.
More the price stays down below 5810 levels early the warning for a potential downtrend is progress which can bring a possible 30% crash from current levels towards 4000 odds.
So what do you think about this Island gap reversal? How many months do you think it will take time to fill the gap. Enter your comments below.
The SmallCap Meltdown Investor faith in small caps has been shaken as the SmallCap Indices are in absolute panic last Friday. Index closes 6.06% down on last Friday and down by 10.63% on the Union Budget 2018 […]
MCX Gold – Extreme Weekly Sentiment Indicates Bottomed out? MCX Goldon the monthly charts consolidating for the last for the 5 years in the band of Rs25000 - 32200 per 10 gram. Sentiment on the monthly charts suggests the long term sentiment is […]
ICICI Bank Launches Money Transfer through Twitter India’s largest private sector bank, ICICI Bank recently announced the launch of their banking services on Twitter. It is the first of its kind service in India that enables ICICI Bank […]
Long Term Supports Tested
Nifty today tested the long term Support levels near 4800 and trading with a minor bounce back from this levels. The Nifty Failing to close below 4800 on EOD basis could be […]
After a significant momentum in Silver 11.77 to 23.7 silver started correcting in the month of Sep 2020 towards 21.66. Last week silver dropped 14.5% which offers a potential momentum pullback trade setup towards the continuation of the previous uptrend.
Immediate support zones are around 23.05 levels and silver could potentially target 24.5 and 25 levels going forward in a very short term. Extreme downside sentiment is getting digested by the markets and could bring a potential short term trading opportunity here.
MCX Silver Daily Charts
Supports for MCX Silver on the other hand comes around 58275 levels and 62500 and 64000 are the immediate targets to consider for the current pullback trade setups.
Related Readings and Observations
Silver Technical Outlook for August 2017 Silver is firmly trading very close to the previous swing high 16.90 and the daily sentimental RSI continues to be positive for the 15th trading session and currently consolidating around […]
Rally in Silver Rejected Strongly Now silver is trading around $16.36 mark & as we can see on charts, silver rally was strongly rejected by descending trend line & this will be the 4th time when we have a rejection […]
Will 2015 be a Year of Silver Bulls? Fundamental remains very weak for silver from last few months, gold with bad performance in 2014 kept pressure on silver as well as slowdown in leading manufacturing economy china slashes […]
Commodity Investors should watch out! – Secular Bear market Out with the old: Super Commodities such as Gold, Silver,Oil etc are in a so-called secular bear market that may stretch for years.Remember the commodities supercycle, that seemingly […]
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).
Retriving the data from the position book is particularly useful for the Algotraders who want to do the following
1)To set Symbol level stop loss 2)To set Symbol level stop/target exit from portfolio 3)MTM PNL based target exit 4)To retrieve the NetQty from the Position Book to check whether the position exists or not before placing orders.
Login to Algomojo.com with your trading credentials. In case if you are new to algomojo check out the video tutorials here on Introduction to Algomojo
Algomojo Position Book
Enable Amibroker Tracelog
1)Extract the Amibroker Tracelog by going to the Amibroker Menu -> Window -> Log
2)Goto the Trace tab in the Log Window
3)Enable the tracelog by right click over the Log Window and enable Trace Output for both internal and external options as shown below
Sample Amibroker Tracelog
Amibroker AFL Code to Extract from the Position Book
//Algomojo Bridge Position Book Extract Test AFL
_SECTION_BEGIN("Algomojo Bridge Position Book Extract");
PlaceOrder = ParamTrigger("PlaceOrder","PRESS");
PositionBook = ParamTrigger("PositionBook","PRESS");
user_apikey = ParamStr("user_apikey","xxxxxxxxxxxxxx"); //Enter your API key here
api_secret = ParamStr("api_secret","yyyyyyyyyyyyy"); //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);
Pcode = ParamList("Pcode","NRML|BO|CNC|CO|MIS",4);
Price = ParamList("Price","0");
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");
spot_sym = ParamStr("spot symbol","NIFTY");
expiry_dt = ParamStr("expiry date","08OCT20");
opt_type = ParamList("Options Type","CE|PE",0);
strike_int = ParamStr("Strike Interval","20");
offset = ParamStr("Off Set","10");
flag = 0;
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);
_TRACE("Order Response : " +resp);
}
if (PositionBook) {
algomojo=CreateObject("XLAMIBRIDGE.Main");
api_data ="{\"uid\":\""+clnt_id+"\",\"actid\":\""+clnt_id+"\",\"type\":\""+"DAY"+"\",\"s_prdt_ali\":\""+s_prdt_ali+"\"}";
resp=algomojo.AMDispatcher(user_apikey, api_secret,"PositionBook",api_data);
_TRACE("Position Book Response : " +resp);
for( item = -1; ( sym = StrExtract( resp, item,'{' )) != ""; item-- )
{
if(Strfind(sym,Tsym) AND StrFind(sym,Pcode)) //Matches the symbol and //Matches the Order Type
{
flag = 1; //turn on the flag
for( jitem = -1; ( posdetails = StrExtract( sym, jitem,',' )) != ""; jitem-- )
{
if(Strfind(posdetails,"Tsym"))
{
posdetails = StrExtract(posdetails,1,':');
possym = StrTrim(posdetails,"\"");
_TRACE("\nSymbol : "+possym);
}
if(Strfind(posdetails,"Netqty"))
{
posdetails = StrExtract(posdetails,1,':');
posNetqty = StrToNum(StrTrim(posdetails,"\""));
_TRACE("\nNetQty : "+posNetqty);
}
if(Strfind(posdetails,"unrealisedprofitloss"))
{
posdetails = StrExtract(posdetails,1,':');
posupnl = StrTrim(posdetails,"\"");
_TRACE("\nUnRealized PNL : "+posupnl);
}
if(Strfind(posdetails,"realisedprofitloss"))
{
posdetails = StrExtract(posdetails,1,':');
posrpnl = StrToNum(StrTrim(posdetails,"\""));
_TRACE("\n Realized PNL : "+posrpnl);
}
if(Strfind(posdetails,"MtoM"))
{
posdetails = StrExtract(posdetails,1,':');
posmtm = StrToNum(StrTrim(posdetails,"\""));
_TRACE("\nMTM PNL : "+posmtm);
}
} //end of for loop
}
}//end of for loop
if(flag==0)
{
_TRACE("\nTrading Symbol Not Found");
}
}//end of position book loop
_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();
Retrieving the Position Book Logfrom Algomojo
Now Apply the AFL code. Set the correct trading parameters from the parameter option by right-clicking over the charts
Log Window Output
If the symbol that you mentioned in the parameter box is present then automaitcally you will be able to see the position details from the log window as shown below
Position Book Response : [{"unrealisedprofitloss":"0.00","Fillsellqty":"10","PriceNumerator":"1","realisedprofitloss":"0.00","Type":"DAY1","Fillbuyqty":"0","BLQty":1,"s_NetQtyPosConv":"N","Sellavgprc":"28.20","Exchangeseg":"nse_cm","Opttype":"XX","Bqty":"0","Exchange":"NSE","Fillsellamt":"282.00","actid":"TS2499","GeneralDenomenator":"1","discQty":"10","Instname":"NA","Netqty":"-10","sSqrflg":"Y","LTP":"28.20","Tsym":"20MICRONS-EQ","Expdate":"NA","Buyavgprc":"0.00","Netamt":"282.00","Token":"16921","GeneralNumerator":"1","companyname":"20 MICRONS LTD","stat":"Ok","Sqty":"10","PriceDenomenator":"1","MtoM":"0.00","Symbol":"20MICRONS","posflag":"true","Series":"EQ","BEP":"28.20","Stikeprc":"0","Pcode":"MIS","Fillbuyamt":"0.00"},{"unrealisedprofitloss":"0.60","Fillsellqty":"0","PriceNumerator":"1","realisedprofitloss":"0.00","Type":"DAY1","Fillbuyqty":"2","BLQty":1,"s_NetQtyPosConv":"N","Sellavgprc":"0.00","Exchangeseg":"nse_cm","Opttype":"XX","Bqty":"2","Exchange":"NSE","Fillsellamt":"0.00","actid":"TS2499","Gen13:22:29.87
MTM PNL : -0.3 Formulas\Algomojo\Algomojo Position Book.afl 97 33 13:22:29.87
Symbol : YESBANK-EQ Formulas\Algomojo\Algomojo Position Book.afl 71 32 13:22:29.87
NetQty : 6 Formulas\Algomojo\Algomojo Position Book.afl 78 34 13:22:29.87
Realized PNL : 0 Formulas\Algomojo\Algomojo Position Book.afl 90 40 13:22:29.87
UnRealized PNL : -0.30 Formulas\Algomojo\Algomojo Position Book.afl 84 41 13:22:29.87
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) […]
Introduction to QuantZilla QuantZilla is a 75+ hours of immersive coding mentor-ship program on designing trading systems, converting trading ideas into indicators and trading strategies, automating the trading systems.
This tutorial explores how to send automated orders from Tradingview using webhook method to Algomojo Trading Platform.
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 Webhooks allow you to send a POST request to a certain URL every time the alert is triggered. This feature can be enabled when you create or edit an alert
Various Modes One can send Alerts from Tradingview Platform
Both free version and paid version supports Realtime data for NSE Cash, NSE Futures, MCX Futures with Alerts. However Webhook Alerts are available in Tradingview Pro version onwards.
Trading View 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.
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.
Let me know in comments if you find this tutorial useful or incase if you need more details about algomojo integration with tradingview you can comment your inputs 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).
TradersKart offers One-Stop E-commerce Solution for all the traders, where traders will get access to their trading needs. TradersKart is now partnering with Truedata to offer Datafeed & API products in its platform.
TrueData is an Authorized NSE DotEx & MCXIndia Data Vendor currently offers NSE cash, NSE Futures & Options, NSE Currencies & MCX Futures & Options data subscription to multiple Technical analysis tools like Amibroker, Ninjatrader, Multicharts, Excel, Metastock, Python, C#, Advance Get, Motive Wave etc.
Specialty of Truedata
Connects to an Increasing number of Markets
Very Low latency feeds via Direct Exchange Connectivity
Use the Same Login id on Multiple Machines(One at a Time)
1. Easy Importing and Exporting Data (Tick, 1, 5 min, EOD) Facility Directly from Velocity 2.0
2. SQL Cache Engine Enabling Local Data Storage Facility. All data is always stored on your PC
3. Same Data Stored Locally is available for all your TA Applications.
4. Ninja Trader – 3 times Faster due to the data being stored locally
5. Upto 20 Days of Tick Data (All 50,000 + symbols)
6. Multiple Options to Force Backfill Data Directly From Amibroker – 1 Day, 2,5,10 Days and All Day Backfill
7. Backfilling Data Does Not Delete your Older Data Exported or Saved Earlier
8. Work In Offline Mode (No Internet Requited)
9. Indices (Spot) Data available with your F&O Subscription
10. All in one data plugin which merges Amibroker ADK with eSignal emulated plugin, giving you Open Interest in Amibroker & more. View & use data in Amibroker, Ninja Trader7 & Excel simultaneously. Integration with Excel – RTD (For Real time) & Historical data downloads (Tick, 1 , 5, 15, 60 mins, EOD)
11. Carry your entire database (in 1 file only- data2.fdb) on a pen drive & share it or move it to any other PC easily. No need to download the data again everywhere.
12. EOD candle Updates in Real Time also along with the 1 min / Tick charts (unlike Local Database Data Vendors)
13. View both Continuous & Contract Futures Simultaneously – NIFTY-I, NIFTY_I and NIFTY16APRFUT. NIFTY_I has been added to accomodate Ninja Trader 7 requirements.
14. Only Incremental Data Downloaded from the servers saving a lot of internet bandwidth. history once downloaded will not be requested again
Start Amibroker from Scratch – Video Tutorials Here are the bunch of video tutorials which helps you understand the basics of Amibroker Software. These video tutorials focus on Installation, Charting Features, Drawing Tools of […]
NestRTD – Nest/Now to Amibroker Feeder – Open Source (GPL) Amibroker Feeder is a C++ RTD client for Nest/NOW which Feeds realtime data to Amibroker. This utility also included a basic backfill tool to import VWAP statistics / Nest Plus Data table.
How to delete Amibroker Data without Deleting Symbols So this time you got messed up with the Amibroker database? and want to delete the data not the symbols? Then here is a simple hack for you to remove the complete data from your messed about database.
Tradingview Supports stratgegies which contains rules in pinescript language which instructs the system when to Buy/Sell orders, Modify, Cancel Orders.
Strategies allow you to perform backtesting (emulation of a strategy trading on historical data) and forwardtesting (emulation of a strategy trading on real-time data) according to your algorithms.
In order to send market orders from Tradingview to Algomojo in the last tutorial, we seen how to use Tradingview webhook feature to configure Automated orders using the Tradingview Alert Option.
Now this time we are going to use tradingview placeholders in the webhook Alert option to dynamically send Buy Orders when there is a Buy Signal in Supertrend and Sell Signal when there is a Sell Signal in Supertrend
List of Trading Placeholders Supported for AlgotradingAlerts
{{strategy.position_size}} – returns the value of the same keyword in Pine, i.e., the size of the current position.
{{strategy.order.action}} – returns the string “buy” or “sell” for the executed order.
{{strategy.order.contracts}} – returns the number of contracts of the executed order.
{{strategy.order.price}} – returns the price at which the order was executed.
{{strategy.order.id}} – returns the ID of the executed order (the string used as the first parameter in one of the function calls generating orders: strategy.entry, strategy.exit or strategy.order).
{{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.
{{strategy.order.alert_message}} – returns the value of the alert_message parameter which can be used in the strategy’s Pine code when calling one of the functions used to place orders: strategy.entry, strategy.exit or strategy.order. This feature is only supported in Pine v4.
{{strategy.market_position}} – returns the current position of the strategy in string form: “long”, “flat”, or “short”.
{{strategy.market_position_size}} – returns the size of the current position as an absolute value, i.e. a non-negative number.
{{strategy.prev_market_position}} – returns the previous position of the strategy in string form: “long”, “flat”, or “short”.
{{strategy.prev_market_position_size}} – returns the size of the previous position as an absolute value, i.e. a non-negative number.
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
Click on the Alert option to configure alerts
Under the Alert Condition Tab use the drop down and change to Supertrend Algomojo and enable the Webhook URL option as shown below
Under the webhook url configure the relevant Algomojo – Partner Brokers url as shown below to place order
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 100 shares in intraday mode.
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.
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).
Hindalco in Medium Risk Buy Mode on EOD charts Hindalco is in buy mode on the EOD charts with EOD supports coming around Rs131.76. Target can be expected around Rs 160. Medium term investors can place the stop loss around Rs 131.