Quantcast
Channel: Market Calls
Viewing all 2070 articles
Browse latest View live

Discussion: Naked Option Buying Vs Naked Option Selling

$
0
0

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.

Related Readings and Observations

  • Webinar – Introduction to Algomojo PlatformWebinar – 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 SystemHow 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 FollowingPractical 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 WebinarIntroduction 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 WebinarAlgotrading 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[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.

Nifty Metal Index – Sector Outlook

$
0
0

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.

G7g1jbmP (1524×930)

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

Computing Cointegration and Augmented Dickey Fuller test in Amibroker using Python

$
0
0

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

1)Amipy v0.2.0 (64-bit) – Download Amibroker 64 bit Plugin
2)Amibroker (64 Bit) v6.3 or higher
3)Python 3.8 (64-bit) or higher

Python Libraries needs to be installed

1)Numpy
2)Pandas
3)Statmodels

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

ParametersInterpretation
adfThe test statistic.
pvalueMacKinnon”s approximate p-value based on MacKinnon (1994, 2010)
usedlagThe number of lags used.
nobsThe number of observations used for the ADF regression and calculation of the critical values
critical valuesCritical values for the test statistic at the 1 %, 5 %, and 10 % levels. Based on MacKinnon (2010).
icbestThe 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.

References

Statmodels – adfuller

Quantopian – Cointegration notebook

How to interpret adfuller test results?

Related Readings and Observations

K-Lintra – Hourly Positional Trading System for Nifty Futures

$
0
0

What is K-Lintra?

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

ParametersValue
Trading InstrumentNifty Futures
Backtesting TimeframeHourly (Continous Data)
Backtest LengthJan 2011 – May 2020
Strategy TypeVolatility based Trend Following
Position Size1 Lot (Fixed Position Sizing)
Slippage + Commissions0.03%
Trading Capital RS 3,00,000
Trading Leveragemax of 4 times

Backtesting Statistics

Key Backtesting Performance Metrics

Key Performance MetricsValue
Sharp Ratio1.14
Max System Drawdown 1.58L/lot (unhedged risk)
Calmar Ratio (CAR/MDD)1.02
Recovery Factor7.73
Profit Factor1.71
Payoff Ratio1.86
Risk-Reward Ratio2.06

Trading System Parameters

ParametersValues
ATR Value100
Length 1 – Extreme Low Volatility90
Length 2 – Low Volatility50
Length 3 – Extreme High Volatility90
Length 4 – High Volatility200
Is the strategy looks into futureNo
Does the Strategy RepaintsNo
Does the Strategy OptimizedYes
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

YearPoints Made per lot (Net of Slippages/Commissions)
20111299
20121510
20131064
20141621
20152144
2016831
2017509
20181805
20193200
20202079 (upto May 2020)

Related Readings and Observations

How to Read Traders Emotions using Market Profile

$
0
0

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

Scale-In Positions Explained – Amibroker AFL Code

$
0
0

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.

pyramidposition = IIf(Buy == sigScaleIn , 10000, 20000);

SetPositionSize( pyramidposition, spsValue);

Here is the complete Amibroker AFL Code

_SECTION_BEGIN("Scalein Positions at Hooked 39-EMA Reversals");

//Candle and Axis Plot

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() ); 

//Buy and Sell without pyramiding

Buy = Cross(EMA(Close,20), EMA(Close,50));
Sell = Cross(EMA(Close,50), EMA(Close,20));

buycontinue = Flip(Buy,Sell);

//Scalein Conditions
pyramid = buycontinue AND Ref(C,-1) < EMA(Close,39) AND Close > EMA(Close,39);


Plot(EMA(Close,20),"EMA20",colorRed,styleLine);
Plot(EMA(Close,50),"EMA50",colorblue,styleLine);
Plot(EMA(Close,39),"EMA39",coloryellow,styleLine);


/* 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);


PlotShapes(IIf(pyramid, shapeCircle, shapeNone),colorGreen, 0, L, Offset=-40);


SetTradeDelays(0,0,0,0);

//Modified Buy Rules with ScaleIn at 39-EMA Hook Reversals

Buy = Buy + pyramid*sigScaleIn;


BuyPrice = Close;
SellPrice = Close;


pyramidposition = IIf(Buy == sigScaleIn , 10000, 20000);

SetPositionSize( pyramidposition, spsValue);


_SECTION_END();

References

Pyramiding (scaling in/out) and multiple currencies in the portfolio backtester

Related Readings and Observations

Bernoulli Process – Binary Entropy Function Amibroker AFL Code

$
0
0

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

Hurst Exponent – Checking for Trend Persistance – Python Notebook

$
0
0

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

More Readings on Hurst Exponent

  1. H.E. Hurst, 1951, “Long-term storage of reservoirs: an experimental study,” Transactions of the American Society of Civil Engineers, Vol. 116, pp. 770-799.
  2. Bo Qian, Khaled Rasheed, 2004, “Hurst Exponent and financial market predictability,” IASTED conference on “Financial Engineering and Applications”(FEA 2004), pp. 203-209,
  3. Mandelbrot, Benoit B., 2004, “The (Mis)Behavior of Markets, A Fractal View of Risk, Ruin and Reward,” Basic Books, 2004.
  4. Miguel Ángel Sánchez1, Juan E. Trinidad2, José García2, Manuel Fernández, 2015, “The Effect of the Underlying Distribution in Hurst Exponent Estimation

Related Readings and Observations


Get Access to NSE Futures and MCX Futures Charts in TradingView

$
0
0

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

Related Readings and Observations

Webinar: Introduction to Orderflow and Trading Nuances.

$
0
0

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

Related Readings and Observations

Tijori Finance – Better Fundamental Data Analysis using Alternative Data

$
0
0

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?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 EMANifty 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?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 5180Next 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 – InfographicYear 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 […]
  • Nifty and Bank Nifty 90 min Volume profile charts for 27th July 2012 TradingNifty and Bank Nifty 90 min Volume profile charts for 27th July 2012 Trading Nifty and Bank Nifty 90 min volume profile charts are shown. Nifty and Bank Nifty 90 min charts are in sell mode since last friday and currently the 90min cloud resistance are near 5180 […]

Market Profile Intraday Trading Strategies – Webinar

$
0
0

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

Related Readings and Observations

Nifty IT Sector – Quarterly Charts Overview

$
0
0

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

How to Set Leverage in Amibroker While Backtesting a Trading System?

$
0
0

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.

In case if you are new to backtesting in Amibroker then check out this tutorial.

Amibroker AFL code with Leverage Settings

EMA1 = EMA( C,20);
EMA2 = EMA( C,50);

/*Buy and Sell Condition */
Buy = Cross(EMA1,EMA2);
Sell = Cross(EMA2,EMA1);

leverage = 4;  //4 times leverage


SetOption("InitialEquity",100000);
SetOption("accountmargin",100/leverage);
SetOption("FuturesMode", False); 
SetPositionSize(40000*leverage,spsValue);

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.

Related Readings and Observations

  • Nifty Futures – State of the Market Before the Election Results WeekNifty Futures – State of the Market Before the Election Results Week The big week filled with events is about to start and its good time to have a check up what happened so far in this week and what is the current state of the market and what is the context going on.
  • TRIN finally shoots above 1TRIN 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?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 TutorialIntroduction 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 PaisaThe 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 DownloaderO2A – 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 Will it declines 30% from the current levels?

$
0
0

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.

Related Readings and Observations


Silver Momentum Pullback Trade Setup

$
0
0

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

How to Retrieve the Position Book Details from Algomojo

$
0
0

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 Log from 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

Related Readings and Observations

How to Send Automated Orders from Tradingview to Algomojo Platform

$
0
0

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.

If you are very new to the Algomojo Platform then kickstart with this tutorial

How to Send Automated Option Orders Tutorial

TradingView Webhook

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

1)Horizontal Line Trigger Alerts
2)Price Crossover Alerts
3)Trendline/Channel Alerts
4)Custom Indicator/Strategy Alerts
5)Tradingview Screener Alerts

Free Version or Paid Version in Tradingview?

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.

Webhook URL for placing orders (MKT, LMT, SL, SL-LMT, CO,AMO orders)

Broker - Aliceblue 
https://abapi.algomojo.com/1.0/PlaceOrder 

Broker - Tradejini
https://tjapi.algomojo.com/1.0/PlaceOrder 

Broker - Zebu
https://zbapi.algomojo.com/1.0/PlaceOrder

Webhook Message FormatSample Placeorder Example

{
    "api_key":"c1997d92a3bb556a67dxxxx1446b7087",
    "api_secret":"5306433329e81ba4dfsdfs653417063c71",
    "data":
      {
        "strg_name":"Tradingview Alerts",
        "s_prdt_ali":"BO:BO||CNC:CNC||CO:CO||MIS:MIS||NRML:NRML",
        "Tsym":"RELIANCE-EQ",
        "exch":"NSE",
        "Ttranstype":"B",
        "Ret":"DAY",
        "prctyp":"MKT",
        "qty":"1",
        "discqty":"0",
        "MktPro":"NA",
        "Price":"0",
        "TrigPrice":"0",
        "Pcode":"MIS",
        "AMO":"NO"
      }
}

Webhook URL for placing Bracket Orders

Broker - Aliceblue
https://abapi.algomojo.com/1.0/PlaceBOOrder 

Broker - Tradejini
https://tjapi.algomojo.com/1.0/PlaceBOOrder 

Broker - Zebu
https://zbapi.algomojo.com/1.0/PlaceBOOrder

Webhook Message FormatSample Bracketorder Example

Request example :

{
  "api_key":"c1997d92a3bb556a67dca7d1446b70",
  "api_secret":"5306433329e81ba41203653417063c",
  "data":
    {
      "strg_name": "Bracket Order Strategy",
      "s_prdt_ali":"BO:BO||CNC:CNC||CO:CO||MIS:MIS||NRML:NRML",
      "TokenNo":"317",
      "exch":"NSE",
      "Ttranstype":"B",
      "Ret":"DAY",
      "qty":"0",
      "discqty":"0",
      "Price":"0",
      "ltpOratp":"NA",
      "SqrOffAbsOrticks":"Ticks",
      "SqrOffvalue":"1",
      "SLAbsOrticks":"Ticks",
      "SLvalue":"1",
      "trailingSL":"0",
      "tSLticks":"1"
    }
}

Webhook URL for placing Multi Client/Basket orders

Broker - Aliceblue
https://abapi.algomojo.com/1.0/PlaceMultiOrder 

Broker - Tradejini
https://tjapi.algomojo.com/1.0/PlaceMultiOrder 

Broker - Zebu
https://zbapi.algomojo.com/1.0/PlaceMultiOrder

Webhook Message FormatSample Multiorder Example

{
    "api_key":"c1997d92a3bb556a67dca7d1446b70",
    "api_secret":"5306433329e81ba41203653417063c",
    "data":
      {
          "orders" : 
            [
                {
                "order_refno":"1",
                "user_apikey":"c1997d92a3bb556a67dca7d1446b70",
                "api_secret":"5306433329e81ba41203653417063c",
                "strg_name": "Test Strategy",
                "s_prdt_ali":"BO:BO||CNC:CNC||CO:CO||MIS:MIS||NRML:NRML",
                "Tsym":"RELIANCE-EQ",
                "exch":"NSE",
                "Ttranstype":"B",
                "Ret":"DAY",
                "prctyp":"MKT",
                "qty":"1",
                "discqty":"0",
                "MktPro":"NA",
                "Price":"0",
                "TrigPrice":"0",
                "Pcode":"CNC",
                "AMO":"NO"
                },
                {
                "order_refno":"2",
                "strg_name": "Test Strategy",
                "user_apikey":"c1997d92a3bb556a67dca7d1446b70",
                "api_secret":"5306433329e81ba41203653417063c",
                "s_prdt_ali":"BO:BO||CNC:CNC||CO:CO||MIS:MIS||NRML:NRML",
                "Tsym":"INFY-EQ",
                "exch":"NSE",
                "Ttranstype":"B",
                "Ret":"DAY",
                "prctyp":"MKT",
                "qty":"0",
                "discqty":"0",
                "MktPro":"NA",
                "Price":"0",
                "TrigPrice":"0",
                "Pcode":"CNC",
                "AMO":"NO"
                }
            ]
      }
}

Webhook URL for placing Option Orders (ITM/OTM/ATM)

Broker - AliceBlue
https://abapi.algomojo.com/1.0/PlaceFOOptionsOrder 

Broker - Tradejini
https://tjapi.algomojo.com/1.0/PlaceFOOptionsOrder 

Broker - Zebu
https://zbapi.algomojo.com/1.0/PlaceFOOptionsOrder

Webhook Message FormatSample Option Order Example (4 strike wide OTM call option from the At the money strike price)

{
  "api_key":"c1997d92a3bb556a67dca7d1446b7087",
  "api_secret":"5306433329e81ba41203653417063c71",
  "data":
    {
      "strg_name":"Options",
      "spot_sym":"NIFTY",
      "expiry_dt":"20OCT20",
      "opt_type":"CE",
      "Ttranstype":"B",
      "prctyp":"MKT",
      "qty":"75",
      "Price":"0",
      "TrigPrice":"0",
      "Pcode":"NRML",
      "strike_int":"50",
      "offset":"4"
    }
}

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.

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

TradersKart – Partnering with Truedata for Providing Datafeed & API Products

$
0
0

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)
  • Run Multiple TA applications at the same time
  • Work With All Time Frames Including Tick

Features of Truedata

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

Related Readings and Observations

How to Send Automated Orders from TradingView Buy/Sell Strategy to Algomojo Platform

$
0
0

This tutorial explains how to send Automated orders from Trading view strategies to Algomojo Trading Platform.

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.

If you are very new to the Algomojo Platform then kickstart with this tutorial

How to Send Automated Option Orders Tutorial

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 Algotrading Alerts

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

Broker - Aliceblue 
https://abapi.algomojo.com/1.0/PlaceOrder 

Broker - Tradejini
https://tjapi.algomojo.com/1.0/PlaceOrder 

Broker - Zebu
https://zbapi.algomojo.com/1.0/PlaceOrder

Configure the Webhook Message with Placeholders

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.

{
    "api_key":"8f8cb9504bb91bd5472b68483cbda8bb",
    "api_secret":"845802a70c8881a66cccfde02d83934d",
    "data":
      {
        "strg_name":"Supertrend Strategy",
        "s_prdt_ali":"BO:BO||CNC:CNC||CO:CO||MIS:MIS||NRML:NRML",
        "Tsym":"RELIANCE-EQ",
        "exch":"NSE",
        "Ttranstype":"{{strategy.order.comment}}",
        "Ret":"DAY",
        "prctyp":"MKT",
        "qty":"100",
        "discqty":"0",
        "MktPro":"NA",
        "Price":"0",
        "TrigPrice":"0",
        "Pcode":"MIS",
        "AMO":"NO"
      }
}

Copy the anove code modify according to your need and paste in the Alert Webhook comments block as shown below

Here is the Complete Pinescript Strategy and to place automated orders ensure one configures the Alert Settings as mentioned above.

TradingView Pinescript Strategy


// Algomojo Trading Strategy


//@version=4
strategy("SuperTrend Algomojo Trading Strategy", overlay=true)



//inputs
Periods = input(title="ATR Period", type=input.integer, defval=10)
src = input(hl2, title="Source")
Multiplier = input(title="ATR Multiplier", type=input.float, step=0.1, defval=3.0)
changeATR= input(title="Change ATR Calculation Method ?", type=input.bool, defval=true)
showsignals = input(title="Show Buy/Sell Signals ?", type=input.bool, defval=true)
highlighting = input(title="Highlighter On/Off ?", type=input.bool, defval=true)
barcoloring = input(title="Bar Coloring On/Off ?", type=input.bool, defval=true)

atr2 = sma(tr, Periods)
atr= changeATR ? atr(Periods) : atr2
up=src-(Multiplier*atr)
up1 = nz(up[1],up)
up := close[1] > up1 ? max(up,up1) : up
dn=src+(Multiplier*atr)
dn1 = nz(dn[1], dn)
dn := close[1] < dn1 ? min(dn, dn1) : dn
trend = 1
trend := nz(trend[1], trend)
trend := trend == -1 and close > dn1 ? 1 : trend == 1 and close < up1 ? -1 : trend
upPlot = plot(trend == 1 ? up : na, title="Up Trend", style=plot.style_linebr, linewidth=2, color=color.green)
buySignal = trend == 1 and trend[1] == -1
plotshape(buySignal ? up : na, title="UpTrend Begins", location=location.absolute, style=shape.circle, size=size.tiny, color=color.green, transp=0)
plotshape(buySignal and showsignals ? up : na, title="Buy", text="Buy", location=location.absolute, style=shape.labelup, size=size.tiny, color=color.green, textcolor=color.white, transp=0)
dnPlot = plot(trend == 1 ? na : dn, title="Down Trend", style=plot.style_linebr, linewidth=2, color=color.red)
sellSignal = trend == -1 and trend[1] == 1
plotshape(sellSignal ? dn : na, title="DownTrend Begins", location=location.absolute, style=shape.circle, size=size.tiny, color=color.red, transp=0)
plotshape(sellSignal and showsignals ? dn : na, title="Sell", text="Sell", location=location.absolute, style=shape.labeldown, size=size.tiny, color=color.red, textcolor=color.white, transp=0)
mPlot = plot(ohlc4, title="", style=plot.style_circles, linewidth=0)
longFillColor = highlighting ? (trend == 1 ? color.green : color.white) : color.white
shortFillColor = highlighting ? (trend == -1 ? color.red : color.white) : color.white
fill(mPlot, upPlot, title="UpTrend Highligter", color=longFillColor)
fill(mPlot, dnPlot, title="DownTrend Highligter", color=shortFillColor)
FromMonth = input(defval = 9, title = "From Month", minval = 1, maxval = 12)
FromDay   = input(defval = 1, title = "From Day", minval = 1, maxval = 31)
FromYear  = input(defval = 2018, title = "From Year", minval = 999)
ToMonth   = input(defval = 1, title = "To Month", minval = 1, maxval = 12)
ToDay     = input(defval = 1, title = "To Day", minval = 1, maxval = 31)
ToYear    = input(defval = 9999, title = "To Year", minval = 999)
start     = timestamp(FromYear, FromMonth, FromDay, 00, 00)  
finish    = timestamp(ToYear, ToMonth, ToDay, 23, 59)       
window()  => time >= start and time <= finish ? true : false


//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")
buy1= barssince(buySignal)
sell1 = barssince(sellSignal)
color1 = buy1[1] < sell1[1] ? color.green : buy1[1] > sell1[1] ? color.red : na
barcolor(barcoloring ? color1 : na)

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.

Related Readings and Observations

Viewing all 2070 articles
Browse latest View live