Code your Technical Analysis strategy

April 23, 2013

Traders,

This is where we will be getting help from our programmers to code your technical analysis strategy. It could be as simple as moving average crossovers to anything intermediate. Mention your strategy, we will explain how to code it. Coding your technical analysis strategy is critical because only then will you be able to backtest it and take it live.

So go ahead and post you technical analysis strategy here, we will reply as soon as possible with the code and an explanation of the code itself. The idea behind doing this is that eventually as and when you see various examples on how to code strategies with an explanation, you will stop needing the help and become a strategy coder on your own.

Time to Write, Backtest and Go live on trading the smart way.

Disclaimer:

The formulas or codes that we are helping you write is our view on your query. Zerodha is not liable for the correctness of it or for any trades that you take based on it. algoZ/Nest Pulse is provided as a tool to help you trade better, make sure that you double check before taking any trade based on the signals being generated.

India's largest broker trusted by 1.3+ crore investors.


Post a comment




1,292 comments
  1. Dhaval Kumar Solanki says:

    I want screener of those stocks of which price touches 200,50 Day EMA line & pattern finder also.

    Regards,
    Solanki Dhavalkumar K.

  2. Required instigator SSL HYBRID & QQE MOD says:

    sir,

    I need to access “ssl hybrid & QQE mod” indicator’ in zerodha. it is not shown in ChartIQ and as well as TradingView. pls help me

  3. Ambrish Kumar Pandey says:

    Add SSL hybrid indicator in zerodha app. immediately.

  4. Joe Vishal says:

    i have the source code how to apply and automate the trade in Zerodha?

  5. Mahesh Hegde says:

    sir,

    I need to access “ssl hybrid indicator’ in zerodha. it is not shown in ChartIQ and as well as TradingView. pls help me

  6. Rupesh ogale says:

    How do I get the current price of VWAP (the price of y axis share) and Moving Average and the current price of the stock

  7. Kuwar says:

    on 5 min chart
    candle close price >vwap
    supertrend buy signal
    volume > 2x (20days SMA volume)
    rsi > 60
    OI < (20 days SMA OI)

  8. Gandham Rajesh says:

    I want coding for
    ENTRY: 12 EMA Crosses 26 EMA
    EXIT: 26 EMA Crosses 12 EMA in 5 Minute Chart.

    I am fully confused with Streak how to create my strategy. Please help me

    • Harsh Deepak Dalvi says:

      Bro, try 8 & 20 EMA Cross and use trendline bakeout for confirmation
      If you want 12 & 24 ema entry and exit strategy same here use trendline bakeout and if you don’t know how to draw trendline use Super Trend of 10,2 OR 3,2
      Bro before using these strategies plz back test it

  9. sudarshan says:

    1. the code should be able to run on pre defined watch list, or on available ATM or ATM-1, (cmp*lot size sma(RSI 14,10) and rsi around 30-40.
    3 exit SLM peak-10%, updated every minute.

  10. Kalyan says:

    Sir , I want code for
    Long based on following conditions.
    1.bullish engulfing or morning star pattern.
    2.super trend should be in uptrend.
    Shorting based on following conditions:
    1. Bearish engulfing or evening star.
    2. Supertrend should be in downtrend

    I want codes for both 15min and 5min time frame
    Thanks you 😊

  11. Suriya says:

    SIR I NEED CODE FOR MY STRATIGIES
    2 MOVING AVERAGE CONCEPT
    20 MOVING AVERAGE AND 200 MOVING AVERAGE
    BUY SCRIPT
    20 MOVING AVERAGE CROSS ABOVE 200 MOVING AVERAGE
    SELL SCRIPT
    200 MOVING AVERAGE CROSS BELOW 20 MOVING AVERAGE
    ..
    .
    .

  12. Deepak Nader says:

    Can you tell me the conditions required for making high fractals and low fractals in William alligator indicator and what type of moving averages we should use to make the alligator?

  13. Prafulla says:

    need pi script for if:
    my condition met and I buy at that price P, now I want to fix my SL at P-10 and target at P+20…??
    or
    I want to place my SL at 5% and TGT at 10%.
    please create pi code for it.

  14. Fighter79 says:

    Hi, Can we code in order to filter options and get alerts based on RSI? For example, I would like to get the list of ATM options based on
    1. RSI crossing a Threshold for the ATM option
    2. RSI crossing a threshold for the corresponding stock future.

    Thanks,

  15. Ranganath Shirur says:

    Buy shares or option when the RSI goes above 60 and sell when the RSI downtrends..

  16. Rupali karle says:

    i want to generate buy signal for nifty futures when RSI crosses 40 from below on 15 min charts. and sell signal when rsi crosses 60 from above.
    thank you

  17. Prakash Kranthi says:

    Hello,

    I am on day 1 of using trade script, and was wondering if you can help me with something I am stuck on:
    The query primarily uses BB (plus ADX RSI), and tries to identify buy point using BBM and sell point using BBT. I do have a flaw with the code where it can trigger losses for events such as what we saw in March.
    I think having a global variable which I can set in my Buy script and use it in Sell script can get rid of the problem.
    Is it possible to set Global variables for this? or can I use my holding avg price as ref point in my sell script.

    Something like this

    Buy Script

    SET Bottom = BBB(CLOSE, 20, 1, EXPONENTIAL)
    SET Top = BBT(CLOSE, 20, 1, EXPONENTIAL)
    SET Mid = BBM(CLOSE, 20, 1, EXPONENTIAL)
    SET GLOBALVARIABLE = BBT(CLOSE, 20, 2, EXPONENTIAL) #this is my Global variable I want to use in Sell Script.

    REF(LOW, 1) Mid
    AND ADX(20) > 20
    AND DIP(20) > DIN(20)
    AND RSI(CLOSE, 20) > 40

    Sell

    SET Top14 = BBT(CLOSE, 14, 2, EXPONENTIAL)
    SET Top = BBT(CLOSE, 20, 2, EXPONENTIAL)

    Top14 > Top
    GLOBALVARIABLE < Top #Global Variable set in Buy script OR
    AVGHOLDINGPRICE = REF(Top, 1)
    AND CLOSE 20
    AND DIP(20) > DIN(20)
    AND RSI(CLOSE, 20) > 40

  18. ARJUN SINGH BISHT says:

    Its my great pleasure that I’m writing you..
    sir I want a spript that can able to place stopploss and target at specific price level..
    eg: we scripted a strategy and according that if our buy order executed at 1000 and we want exit at 1050 ( wherever it will go beyond doesn’t matter).
    01. I want to place my exit order at specific point after execution.
    02. is threre any script which will work like BO order (Trailing SL)

  19. Maniyar says:

    example code in python when candle(close) crosses 20 SMA moving average

  20. Kumar says:

    Dear Sir,

    Can you please help me to pine coding the following strategies?
    Multi Time Frame
    Long:
    SMA Crosses 9 & 21
    Candle close above 50 EMA
    RSI Divergence 0 – 30
    RSI below 50
    Candle close above Super Trend
    Can you add support or pivot?

    Short:
    SMA Crosses 9 & 21
    Candle close below 50 EMA
    RSI Divergence 70 – 100
    RSI above 50
    Candle close below Super Trend
    Can you add resistant or pivot?
    many thanks for your help

  21. Khushbu says:

    Sir i want to sell on high of 15 min candle once 14 period RSI crosses over 70 with TSL of past 3rd 15 min candle high or 20 SMA… please guide

  22. Khushbu says:

    Sir i want to sell over 70 , RSI 14, with TSL of past 3rd 15 min candle high… please guide

  23. Algo trading says:

    Hi matti

    Is it possible to perform the below mentioned strategy & can it be coded if yes, then can we use KITE API or Streak to perform the same strategy?

    Need a code for the following action:

    For any particular EQ script entered by the user is it possible that the system everyday should automatically place an buy or sell order for one qty or any numbers of qtys entered by the user for which it should place an buy or sell order at 10.16 AM everyday on that day’s trading session at one rupee less/more or any number of rupees entered by the user below the LOW price or (any OHLC) which was at 10.15 AM on that day’s trading session.

    Please revert ASAP.

  24. Hrishi says:

    i want a supertrend + macd + rsi

  25. bharat says:

    Searches related to GfxTextOut( (“Current P/L : ” + WriteVal(IIf(sig == “BUY”,(C-entry),(entry-C)),2.2)), 13, y-20);; this afl what is wrong and how to repair

  26. Fidelis Mgbodim says:

    Please can you write a code for an alert on the crossing of sma 20 and 50.
    And an alert for the crossing of the fast and slow lines of MACD . The parameters are, 12, 26, 1 and 5, 15, 1.

  27. Divye says:

    I need the code for,

    Ehler Fisher (10) crosses Ehler Fisher Trigger (10), on a monthly time frame

  28. Pratik Uday says:

    Hi Nitin,

    I looking for a strategy to backtest. It is basically for Index.

    We have to see the 5 mins candle for 30 Mins i.e 6 Candles and will mark high point and low pint in this 30 min. If the Next 5 min candle closes above the high mark then will buy and if the candle closes below the low point will sell the candle.

  29. Deepak Nigam says:

    Hi Team,

    I am trying to use stocastics oscillator for the scanner in pi but it is generating error on below code

    SOPK(4,1,1, SIMPLE) > 80

    Please suggest

  30. Jinesh Jain says:

    Hi team,

    Need a code for the following action:

    Buy – When RSI crosses above 20 and square off when RSI crosses below 80
    Sell – When RSI crosses below 80 and square off when RSI crosses above 20

  31. prafulla bhople says:

    Dear Sir,
    I need Kligner Vol Oscillator script for zerodha backtest
    please help

    Prafulla Bhople

  32. Antony says:

    Hai…
    I done Script for SMA cross over…for Buy and Sell Signal. But i have to set Buy Target (0.3% from SMA Crossover Candle High Price) and Buy Stoploss (SMA Crossover Candle Low Price) and simillarly for Sell side….Is it possible…?

  33. SAURABH SHARMA says:

    Dear,
    I want to backtest Nifty 50 Stocks,
    for that i need your help in coding for First 15 minutes Candle’s high low breakout (e.i 9:15AM to 9:30 AM),

    Please help me .

  34. Namrata Tawade says:

    Can I use scanner for more than 1 line conditions?

  35. Sudhakara says:

    Hi

    Could you help me for below strategy coding

    1.Latest Low Greater than 1 day ago Low
    2. Latest Close Greater than 1 day ago Close
    3. Latest Parabolic Sar(0.02,0.02,0.2) Less than Latest Close
    4. 1 day ago Parabolic Sar(0.02,0.02,0.2)Greater than 1 day ago Close

    I tried below code but, not getting proper results
    OPEN > REF(LOW,1) and CLOSE> REF(CLOSE,1) AND
    PSAR( 0.02,0.2) REF(CLOSE,1)

    Thanks in advance

  36. Shikher Kanwar says:

    Hi can you please provide AFL code for Ehler fisher + tigger working in Kite with Henkin anshi candle.
    it will be great help.

    Kind regards
    Shikher

  37. Aaron says:

    Hi Anyone?
    How to code offset moving average?

  38. yaswanth says:

    i want coding for ichimoku trading system i use buy when candle breaks the cloud and tekansen and kijun sen cross ,future cloud should green in colour, lagging span should far away from cloud and price action. when these conditions met i will open my buy position in 15 min chart and exat the same opposite to sell side can you code this strategy.

  39. BHAGYARAJ says:

    HI

    FOR BUYING RSI NEED TO BE MORE THEN 65 AND VOLUME MORE THEN 1000000(IN DAY)
    FOR SELLING RSI NEED TO BE LESS THEN 35 AND VOLUME MORE THAN 1000000(IN DAY)
    HOW TO BACK TEST THIS IN PI.
    TIME FRAME–15 MINUTE CHART.
    KINDLY PROVIDE CODE FOR BACK TESTING?

  40. PRAMOD UPASANI says:

    I have a .ex4 and .tpl file, this code is developed by one of my friend which I want to use in kite or PI. Please let me know how to do this.

    Thanks in advance.

  41. shubham says:

    Could you provide code for hammer and inverted hammer candlestick?

  42. sulthan IS says:

    Dear Sir/madam,

    i am seeking and requesting a algos code for PI Zerodha Live Scanner regarding. in this cbelow conditions i requesting codes plz.
    1. MACD signal crossesbelow from the macd diveg. ( basically buy call generates)
    addition to
    2. Intraday MTM 20-25in btwn range trending (basically oversold)
    addition to
    3. EMA 9 crossesabove 26 EMA for Intraday.

    all above should be on 5 minutes candle chart requirents. 1st signal candle need to generate buy signal. 2nd candle Low has to be Buy order generates required.

    Kindly do support to better experince thru PI zerodha!

    Awaiting you support.

    thnx by
    Sulthan.IS
    8248999618
    9566933666

    • Zerodha Social says:

      Hey Sulthan,

      We recommend that you go through this user manual on Tradescript in order to be able to build your own back-tests and expert advisors as per your needs and requirements.

  43. Varun Joshi says:

    Hi! Sir, If i have to make strategy based on cande vidya crossover on Nifty can i make ?

  44. RAM says:

    how to transfer amount equity to commodity accounts

  45. rajveer says:

    Hi,

    The strategy is “Bollinger bands squeeze” you might have heard made by john Bollinger it uses indicator such as Bollinger bands width ,Bollinger %b and volume.
    OBJECTIVES:
    STEP ONE – IDENTIFY THE SQUEEZE
    the entry criteria for this is Bollinger bands should squeeze you can identify the squeeze from indicator Bollinger bands width you might have to alter it a bit to identify the squeeze (on timetotrade web based platform they had a indicator name “minimum in range” and they combined it with bollinger bands width thats how they identified the squeeze )
    STEP TWO – THE BREAK OF THE UPPER BANDS
    The break of the upper bands could be seen in bollinger bands %b
    STEP THREE – HIGHER VOLUME THEN PREVIOUS BARS EITHER ON THE BREAK OF THE UPPER/LOWER BAND OR IMMEDIATELY FOLLOWING THE BARS OF THE BREAK
    The volume should be highest of the session or at least should be highest from previous few bars and above average in general in any given time frame this should be either on the break of the upper/lower band or immediately following the upper/lower bands breaks in 2 to 3 bars

    THE EXIT WILL BE THE BREAK OF LOWER/UPPER BANDS AFTER THE SETUP ENTRY OR PARABOLIC SAR EXIT STRATEGY

    Please let me know as soon as possible if it can be done on tradescript
    thanks

  46. JAYESH PRAJAPATI says:

    i would like to backtest vwap in bank nifty for 15 min chart so pls code me in this testing

  47. MANISH says:

    how sell of 1% above the purchase value can be scripted please help me for this

  48. Hrishikesh PAtel says:

    Hi Team,

    I am looking forward to get the codes for McGinley Dynamic.

    Regards

    Hrishikesh

  49. Ketan Khopkar says:

    In need below strategy code.
    If green candle’s high is greater and low is smaller than previous red candle then buy at high price of the same candle
    If red candle’s high is greater and low is smaller that previous green candle the sell at low price of the same candle

  50. sankar singh says:

    Hi,

    I am new to programming, it would be great if you give me a code for the below strategy, also please let me know where do i need to execute the code in PI.

    Whenever a buy/sell signal is given by a supertrend over the 5 min candle, there will be a target T1,T2 & T3, once it reaches to the T3 i should sell incase if it’s in buy signal mode and vice versa.

    once the order is executed, the target should be automatically set it to the sell stoploss incase if it’s in buy mode, should set it to the buy stop loss incase if it’s in a sell mode.

    please note that the stoploss would be changing frequently as the market goes on.

    i need this code to be automatically check the conditions for at least 7 scripts.

  51. Pankaj says:

    Alert when 5 period EMA crosses 20 period EMA and Supertrend is on uptrend and vice a versa for sell order.

  52. Nishith says:

    Scan 14 periods RSI on 15 minute time period chart for 1 day. Select only those stocks where RSI is stuck between 70 and 30.

  53. Alok says:

    HI,
    Need a code for “scanner” to enlist me the stocks from nifty50 that have been in a range for last fifteen 1 min candles.
    Alok

  54. Yash Joshi says:

    Hi, I need a code for the following:

    Buy signal Shall be generated when:
    -on a 30 min chart bullish engulfing pattern is formed & RSI is below 35 (on closing basis of red candle) & volume of green candle is above simple moving average of last 30 days.

    Sell singal shall be generated when:
    – on a 30 mins chart bearish engulfing pattern in formed & RSI is above 65 (on closing basis of Green candle) & Volume of red candle is above simple moving average of last 30 days

    Thanks in advance

  55. Abdul says:

    Hi ,

    I need a coding with combination of supertrend and SMA. can some help me please?

  56. ananya says:

    You are given 1 minute data of 5 stocks. There are 6 columns in each file, and each column represents this:
    Column 1: Date and time
    Column 2: “Open” for that particular minute
    Column 3: “High” for that particular minute
    Column 4: “Low” for that particular minute
    Column 5: “Close” for that particular minute
    Column 6: Traded volume for that particular minute

    The aim of the backtest is to find the stock which gives the best result based on a trading algorithm. The data is from 22nd Feb, but you can assume the trades will begin from 23rd Feb. The algorithm is as follows:

    At 9:20 am, EMA 50 should be less than VWAP
    To enter a trade: EMA 50 should become greater than VWAP
    The entry price is the “close” of the particular minute where EMA 50 crosses VWAP (as in point 2)
    Do not enter a trade after 1:30 pm. If the conditions are not met, there can be no trades for that day
    Hold the position as long as EMA 50 is greater than VWAP
    To exit a trade: EMA 50 should again cross VWAP. Thus EMA 50 < VWAP. Similarly the exit price will the the "close" of that particular minute
    If the condition in point 4 does not occur during the day, exit the trade at 3:15 pm. We do not carry any trades on to next day
    The best stock would be the one, where the sum of profit/ loss of all trades is maximum

  57. PRITISH HALDER says:

    Is it possible to give supertrend indicator with fields Open/High/Low/Close etc?

    • Raju says:

      Hi,

      I have raised a doubt in the forum as informed by support desk in the month of June,2018. So far no response.
      The issue about using supertrend in the charting and for coding. Can the support team update on this?

      Thank you,
      Raju

  58. swapnil arvind kshirsagar says:

    I want a code when price is above 100 sma. stochastics is below 20, macd positive cross over and macd line above zero
    And vice versa for selling
    please help me with the code

  59. Paras Dutta says:

    Can someone help in making this script?

    On Heikin Ashi chart:-
    Buy script:- 1/2 green Heikin Ashi candle + StochRSI = 0.75

    Thanks in advance. Or if there is any material on how the code scripts are made, it would be wonderful as I can try to build it myself from the code library.

  60. hilesh says:

    sir,
    i have written algo script which works well and yield good result same as my trading plan when back testing but when i use same script in scanner in order to get signal during trading hours it shows “your script generated error.”
    here is my script:
    “EMA(CLOSE,200) >EMA(EMA(CLOSE,200),50) AND

    CROSSOVER(SOPK(12,7,7,WEIGHTED) , SOPD(12,7,7,WEIGHTED) AND

    SOPK(12,7,7,WEIGHTED)< 30 AND
    SOPD(12,7,7,WEIGHTED)<30

    what should i do to resolve this problem?
    thasks regards

  61. NARESH MEHTA says:

    Sir,

    i required donchian channel buy/sell code , buy msg show if crosses above 20 channels & sell if crosses below channel , will help please..

  62. Kamal Bhola says:

    Hello Sir,

    I like to build a code in Zerodha PI where it auto detects the supertrend signal on 1 minute candle if it is buy (green) or it is sell (red). Now if buy signal is generated I like to put a buy order and wait for next sell signal and as soon as sell signal is generated I like to put a sell order with the double the quantity I buy. for example if super trend signal is buy then purchase buy order of 100 then now when supertrend show the sell signal then sell 200 quantity now wait for next buy signal then buy 200 quantity like this.
    Important note is I like to specify the script/commodity for which I like to run this code.
    Looking for your positive reply.
    Thanks & Regards,
    Kamal Bhola

  63. SATRUGHAN says:

    Hi sir,
    please help me tried to doing code but it’s not working, below is my requirement.
    For buy
    I have set my RSI indicator to Periods 14, OB 70 and OS 30, I need if my RSI go higher than the last candle position(RSI) and in my candle chart, last candle goes down to previous last candle and last 10 candles is showing down trends, then buy signal generate.
    For Sell
    Same opposite to buy signal,
    If RSI goes down and then the last candle and last candle goes up comparing to previous last candle and last 10 candles is showing up trend the sell signal generates.

  64. omkar katkar says:

    I want following 2 types of alert
    1. When last traded price is near(5-to 6 points below) to yesterdays high of hourly candle begining from 14.15 minutes. and

    2When last traded price is near (5 to 6 points above) to yesterdays low of hourly candle begining from 14.15 minutes.

  65. srikanta says:

    How PI scanner generate alert…only color highlighting?
    or SOUND/ MAIL/ SMS ?

  66. Maddy says:

    Hi, did you stop Pi Backtesting facility??
    It’s continuously giving error.

    Is it like, now backtesting should be done only on streak??

  67. Anit says:

    Hi,

    My Strategy: Buy Signal – Closing Price > SMA(200), RSI(2) coming from 11 (RSI2 value less than 11,waiting for it to be more than 11)
    Entry – As per Pivot Point Calculator.
    Trailing SL – Initial SL will be Entry Price – 3*ATR(22). For every single point move in higher direction SL will move twice. For Example. Entry Price – Rs.100, High – 110, ATR(22) – 10. So initial SL – 100 – 30 = 70. Now if the new high is 120 which is a movement of 10 points, SL will 70 + 20 = 90. Once SL exceeds high it will automatically exit at that price.

    Sell Signal – Just a opposite with RSI (2) value will be 89.

    Please suggest whether backtesting is possible or not.

    Regards,
    Anit Bose

  68. praveens says:

    Hi Sir,

    Required Script to trade in 5 mint chart at Twiggs money flow TODAY HIGH and Trade volume index TODAY HIGH.

    Please do the greatfull sir.

    Regards
    Praveen.S

  69. Varun Ramesh Gidh says:

    Hi,
    Is it possible to have the mid-value i.e., {[(high – low)/2] + low} of the available time frames in Pi be represented as a horizontal line such that a bar is simply represented as a cross with only the high, low and mid value being displayed discarding the open and the close completely.

  70. Prakhar says:

    I want to get alerted whenever volume becomes twice the simple average volume of last 50 candles.

  71. Ganesh says:

    I want test a strategy.
    EMA5 to EMA26 positive crossover – Go Long
    Exit long if last close is below 15% of buy price
    EMA5 to EMA26 negative crossover – Go Short
    Exit short if last close is above 15% of buy price

    Based on above can I take position in options?

    Regards,
    Ganesh

  72. SHAKTI KUMAR JINDAL says:

    HI
    HOW TO BACKTEST IN PI USING SUPER TREND STRATEGY?

  73. Latha George says:

    Could you give a Code for AI where the logic is as follows;

    Buy when CCI positive and PSAR is upward

    STCH MTM Cross Over Supertrend

  74. Rajat says:

    Hi,

    I would like to code the following strategy.

    If a stock closes up 20% compared to previous close than buy at close and exit at 50% profit or 10%loss.

    Thank you.

  75. Sakthi says:

    Hi,

    I would like to find out the high and low of first 30 mins, if the price crosses high then generate buy and if it crosses low generate sell.

    Also exit should be some particular % of my entry price.

    Can anyone help me to get the this for this?

    Thank you.

  76. PRAVEEN VERMA says:

    I wish to buy one lot of future at a particular price say X. I want to remain long until the price rolls back by 0.50 paisa at any particular time. But want it to be bought again when it starts going up by .50 paisa again. Similarly when it goes down by .50 paisa I want it to be sold. What should be the coding for this in Buy Script, Sell script, Exit long script and Exit short script. My humble request to respond please. I am new to this auto trading.

    Regards

  77. Amit Bakshi says:

    Pl help me in back test my following Strategy for intra day futures trading:
    Chart Setting:3 Minutes
    Studies:
    1)VWAP
    2)Time series forecast(period-14,Field-Close)

    Strategy1:To go long
    Buy when Two Green candle sticks Start & finish in succession above the Vwap line
    Exit Long Position
    Exit when two Red candles finish within Time Series forecast line Downward Cusp in succession.

    Strategy2:To go Short
    Sell when Two Red candle sticks Start & finish in succession below the Vwap line
    Exit Short Position
    Exit when two Green candles finish within Time Series forecast line Upward Cusp in succession.

  78. Nazir Hussain says:

    I want the Opening Range Breakout ( 15 minutes) Expert Advisor ,so kindly help in this.

  79. zv0721 says:

    I am using 15 min bar for banknifty
    Buy
    CROSSOVER(EMA((high+Low)/2,75),EMA((high+Low)/2,200))
    Exit Long
    CROSSOVER(EMA((high+Low)/2,75),EMA((high+Low)/2,50))

    Sell
    CROSSOVER(EMA((high+Low)/2,200),EMA((high+Low)/2,75))
    Exit short
    CROSSOVER(EMA((high+Low)/2,50),EMA((high+Low)/2,75))

    In back test no of trades are showing low
    but in chart i can see the trades

    Can you please help me

  80. Prashant Jain says:

    Hi,

    My Strategy based on MACD & RSI value on 10 minutes candlestick chart.

    MACD – 13,26,10
    RSI – 28 period Over Bought = 70 Over Sold = 30

    BUY Rules
    (30 mins after market opens)
    Whenever RSI value is above 65 & MACD black line crosses red line from bottom to top & Exit whenever RSI value goes below 65.10

    SELL Rules
    (30 mins after market opens)
    Whenever RSI value is below 35 & MACD red line crosses black line from bottom to top & Exit whenever RSI value goes above 34.90

  81. Harshal Desai says:

    I want to create a code to meet following condition;
    When the Moving average crosses over, based on candle indicator either buy or short. Once executed exit long with +10 points and stop loss -10 points.
    Can this be done?

  82. krishna says:

    Hi nithin,
    I’m new to zerodha. Can you please provide me the tradescript for the below mentioned strategy:
    BUY:
    1) MACD ( Macd line crossing above the signal line ( 30, 15, 9))
    2) RSI ( RSI 14 increasing and above 30 )
    3) CCI ( CCI 31 crossing above 0 line )

    SELL:
    1) MACD ( Macd line crossing the below signal line ( 30, 15, 9))
    2) RSI ( RSI 14 idecreasing )
    3) CCI ( CCI 31 crossing below 0 line )

  83. Jeeva says:

    hi friends i need pie scanner script for below conditions
    help me please .thanks in advance

    buy when
    rsi(14) crossed above 65
    macd line(12,26,9) crossed above macd signal line (12,26,9)
    fast stochastic (14) crossed above slow stochastic(14)
    william %R(14) crossed above -30

  84. Mehul Faldu says:

    I want to do this strategy, can you give me code of this strategy

    Hybrid Strategy

    Buy one lot of ESCORTS DEC 740 CE at 23
    Sell one lot of ESCORTS DEC 800 CE @ 8

  85. Jitendra Rathore says:

    Please code the following strategy
    Time Frame 15min
    BUY: If 3 candles make higher high and RSI > 50
    Exit at 3.15pm or for 20 points

    SELL : If 3 candles make lower low and RSI <50
    EXIT at 3.15pm or 20 points.

    Thank you 🙂

  86. abcd says:

    what if i want first 15 minute high and first 15 minute low ?? I would want a pi code for the same.please help

  87. Abu says:

    Hi Nithin,
    How to write code for this.

    When RSI 14 crosses EMA 13.. BUY only if RSI is less than 25 and cross
    Vice versa for SELL.
    EMA 13 should cross RSI 14 and it should be above 65

  88. Chengappa says:

    Zerodha,

    I am interested in learning automating the buying and selling in Pi. I have two questions. Can you kindly answer them ?

    1. I am familiar with programming but I needed a little handholding on executing simple buy/sell scripts. I had a look at tradescript.pdf but it doesn’t seem to have examples and instructions on how to use Pi to automate. Can you please point me to any tutorial ? Just for example, if I want to sell Infosys when it touches Rs.1000, how do I do it ?
    2. Can I automate Pi to buy or sell based on the values of two or more stocks ? (e.g: If the difference between future and spot is > 50, sell future and buy spot)

  89. Kalpesh says:

    Hi,

    want code for Pi:

    Buy: when SuperTrend + Heiken ashi = both are bullish (green)
    Sell: when SupreTrend + HeiKen ashi = both are bearish (red)

  90. Vettanu Pawar says:

    Need a code for stochastic going above 80 & below 20 with the settings of %K period 28, %K slowing 3, %D period 3, MA type exponential. If possible separate codes for going above & going below 80 & 20 respectively.

  91. venkat nagam says:

    Hi All,
    I new to zerodha API,
    Can any body give the code for the below cover order logic.
    If today open price is more than the yesterday close, then SELL with trigger price (+10 point of today open price)
    else today open price is lesser than the yesterday close, then BUY with trigger price (-10 point of today open price).
    and this below code should be execute first minute of the market opens.
    Eg:
    If
    Prev Close [100] Open Price [110] = SELL
    Else
    Prev Close [100] Open Price [90] = BUY
    I have written code by seeing some web pages but missing in trigger price.

    Code:
    kite.order_place(tradingsymbol=‘RELIANCE’, exchange=‘NSE’, quantity=1, trigger_price=900, variety=‘CO’, transaction_type=‘BUY’, order_type=‘MARKET’, product=‘MIS’, validity=‘DAY’)

  92. yashpal says:

    Dear sir,
    I am Yashpal here I am new to algo trading I want a code for my strategy please help me
    My strategy is
    I want to buy or sell crude oil of current month expiry when DEMA 30, 60 crossover on four hourly chart or vice versa this is my trend I always want to stay in this trend

    My stoploss is on 15 minute chart of next month expiry crude oil when DEMA 30,60 crossover and vice versa I want to hedge my position when 15 minute chart goes opposite

    Sir it’s very difficult to do manual trading whole day please help me or tell me someone who can help me to write this code

  93. SANDEEP says:

    While back testing, I want to know in Sell script at what price last buy took place so if I am making profit I would like to sell off else I would like to keep stocks on hold.

    Also in buy script I want to know if stocks are already on hold, if on hold I don’t want to buy additional. If not on hold then I would like to buy.

    I want to execute above strategy when some indicator that could be MACD, Moving average crossover or whatever produces buy and sell signal.

    How I would do this in back testing?

  94. YASH says:

    if i want to use small case only basic version for using screeners and not a pro version which is paid why do i need to give permission for accessing my holdings or placing orders etc

    • Zerodha Social says:

      Yash, these are primarily for buying smallcases. we can only access your Zerodha account when you’re logged in to check if you have sufficient funds to buy a portfolio/smallcase of stocks created from screener & we only place orders on your behalf when you give manual approval for the same. No worries here!

  95. Sathish says:

    I want to get the ratio between Total Buyers Quantity and Total Sellers Quantity which has above 1:5 in Nifty50 stocks. Please let me know the formula for the same

    Ratio (1:5) value should be a configurable .

  96. RAMESH says:

    Is there any way to get end of day technical indicators data for NSE stocks into an excel sheet in zerodha applications(PI or KITE)?

    • Matti says:

      Hey Ramesh,

      You can apply the desired indicator to your chart on Pi, right click on the chart>Save Chart>Save chart data to Excel. This will export the OHLCV and indicator values for each candle to an excel sheet.

  97. fisherman8 says:

    Hi. I like help in coding my Ichimoku Kinko Hyo strategy. This comes with 2 filters to protect immature trade signals.
    Strategy: Use only the cloud ‘s crossing of Senkou span A and Senkou span B. The trade will be placed accordingly either Buy on Bullish or Sell on Bearish ,upon the crossing of the future cloud’s crossing. From Bullish to Bearish and vice versa.
    The filters 1) Price crosses above Tenkan line for Buy and Price crosses Below Tenkan line for Sell.
    2) ADX the position of the +DI and -DI line. 1) +DI line Above the -DI confirms the Price Above Tenkan line and Future Cloud Bullish crosses for a Buy trade. 2)-DI line Below the +DI will confirm the Price Below the Tenkan line and Future Cloud Bearish crosses for a Sell trade.
    Note: There is a chance that the action of a New trade or Closing an Existing trade could also trigger a New Opposite trade based on this strategy.

  98. VIVEK DV4166 says:

    hi zerodha team,
    i want to generate an algo which gives me buy and sell signal using renko charts on my predefined workspace.
    as we all know renko charts move on price action strategy and on predefined sizes of the block …so i want to buy or sell a script after a prevailing downtrend or uptrend i.e. red boxes/blocks or a green boxes/blocks is formed on any time frame as soon as one box/block is formed green in downtrend or one box/block is formed red in uptrend ..I want to execute my trade
    i hope you have understand my query..

    hope to hear from you soon

    regards,
    Vivek Tiwari
    DV4166

  99. GANGARAJU says:

    todays open greater than yesterdays high
    todays open lesser than yesterdays low.
    please code this for scanning the stocks @9.20 am

  100. Niteen says:

    Hey, i want code which can automatically start buying or selling if its comes to my strategy

    my strategy..

    for all charts (scripts) in Commodity.

    Only using super trend indicator.
    Execution on 1 hour super trend but follow supertrend for 1 day.
    if 1 hour create buy single and 1 day signal also buy then Buy
    if 1 hour create sell signal and 1 day signal buy then not automation and should wait until it come to our logic.

    if 1 hour create sell signal and 1 day signal also sell then surely sell.
    if 1 hour create sell and 1 day buy then no trade and wait until it come to our logic.

    Keep stoploss and trailing stoploss.

    I can edit the numbers as of stoploss and trailing stoploss accordingly myself but i want this script anyhow for my bot

    Please advice and get back to me..

    thanks and regards

  101. saurabh says:

    Do u have Gannhilo Studies indicator in zerodha

  102. DIVYESH says:

    Hi,
    Can u pls give me a AFL code for ZERODHA ATR TRAILING STOP.

  103. Ramalingam S says:

    Hello
    My strategy for Nifty is based on the following.
    Bollinger Band buy on the bottom band and sell >=10 points higher on NIFTY futures. This is for intraday and the Band is 20,2.
    I also want an RSI of 20 or below for buy signal and 50 or above for sell signal.

    Can you help with a trade script which I would like to back test and then go live. I am doing paper trading for past few weeks and find this successful.

  104. Devendra Verma says:

    Please help me to write code with my below simple strategy
    1. I want to calculate high and low price of 2nd candle in 15 min chart.
    2. after 2nd candle if it crosses high i will buy and if it cross low i will sell.

    Thanks in Advance
    Devendra Verma

  105. mahadev valekar says:

    please code the strategy given below

    buy trigger-when 5 min nifty index bar break out of the last swing high
    target-when 1 min nifty index bar break out the last swing low
    stop loss-trailing with last swing low of 5 min nifty index bar

    sell trigger-when 5 min nifty index bar break out of the last swing low
    target-when 1 min nifty index bar break out of the last swing high
    stop loss-trailing with last swing high of 5 min nifty index bar

  106. Ankur Gupta says:

    Can I get list of stocks for which positive crossover between 5 EMA and 26 EMA occurs.
    Also if possible same for 5 EMA and 13 EMA.
    Positive crossover – When 5 EMA crosses 13/26 EMA from bottom.

  107. Anuraag Kochhar says:

    I am looking to backtest a strategy as follows;

    Three Supertrend indicators on Index
    1. 11 – 2
    2. 10 – 3
    3. 7 – 3

    Trades, go long on option for the Index above as follows
    1. Sell CE when all three indicators turn Red; Square off when a candle touches one of the indicator above.
    2. Sell PE when all three indicators turn Green; Square off when a candle touches one of the indicator above.

    In general any good tutorials to learn backtest coding?

    Thanks

    • Anuraag, not possible to scrip supertrend using Pi. I’d suggest you to start learning AFL or python, you can then backtest using these languages.

      • Anuraag Kochhar says:

        Thanks for your response Nithin. Could you tell me if you know a quickest way to learn AFL and how can us it to backtest a strategy? Thanks once again

        • AFL, there are many amibroker dedicated communities. I guess you can google for it.

          • Anuraag Kochhar says:

            Thanks. There is a school of thought that Python is preferred language for Algo trading, read backtesting. Even zerodha provides api and libraries to access data. I understand that Ambibroker platforms require license fee and would need a data source. What is your opinion on this?

  108. Abdulla PM says:

    sir
    is there any alerts system or scanner to know the crossover of WMA&TMA crossover(daily/hourly).If its there plz tell me how to use it

  109. Manish says:

    Hello sir,
    Is there super trend scanner available in zerodha pi.

    • Akshay.A says:

      Manish, It is not possible to code Supertrend in Tradescript. If you are using Amibroker you can connect it to Pi and can use Super Trend Indicator AFL, or you can use Supertrend in KITE

  110. ZO2577 says:

    Dear Sir,
    In Zerodha PI, scanner is a very cool feature. I created two scanners for me adding about 100 stocks in each of them and then save them. But to my surprise , when I logged in again and open the list the saved scanner, the list got changed and one of my scanner was missing in the list and few others not created by me got added and this is happening again and again. Every time I logged in, the list of saved scanner got changed and I have to create the scanners again and adding stocks to them which is a very time consuming process.
    Why my scanners and list of saved scanner changed randomly every time logged in though I saved them.
    Can’t I saved my scanner permanently??

    • Akshay.A says:

      Hi The below link should help you saving a scanner.
      check this

    • ZO2577 says:

      Zerodha Team,
      Pls help.
      I think the the scanner saved by any user is visible globally to all the other users in the saved list of scanner and they can even delete it. Hence, every time I logged in, the list of scanner gets changed and even I can delete those saved scanners.
      This might be the case, I guess.

  111. H. R. Shah says:

    Iam completely new to AFL programming

    I would like to write code for signals indicating crossing of 5, 13, and 26 EMAs in “one point”. means all EMAs equal.

    If the EMAs rise upward (all EMA more than confluence value) and MACD (16, 6, 4) positive (macd>0) then buy signal. if EMAs fall downward (all EMA less than confluence value) and MACD (16, 6, 4) negative (macd<0) then sell signal.
    Thank you

  112. Ranjeet Kumar says:

    Hi
    Kindly help me to write trade script code for below mention strategy.

    In 15 minutes chart
    candle closing price is high from last four candle high then give signal for buy and opposite for sell.

    Thanks
    Ranjeet

  113. Stalin Kant says:

    I want a code for supertrend (7,1)setting on intraday 5 min chart. Buy when supertrend signals and sell when supertrend shows sell. Stopploss when supertrend changes either buy to sell or vice versa

  114. aljo says:

    Hi Nithin,

    I want to back test stocks using 5 min bars.
    The strategy is if a stock’s 2:00 – 2:05 PM candle OPEN or CLOSE is with in the range of End of day ie; 3:25 to 3:30 PM candle, buy signal should be given.

    Can you help me to code this in trade script.

    Rgds,
    Aljo

  115. ravindrakumar says:

    Hi Sir,
    I want to make following trading system
    When last price is greater then closed price by 0.5%. The script should get buy. And when the script moves further 0.3% above the buy price, the script should get exit, also stop loss will be below 0.3% of the buy price.

  116. Sahaj Pal Singh says:

    Hii

    Is there any course or anything to learn the programming or how to make formulas as i dont have any knowledge about coding and all

    thanks

  117. jkakbari says:

    Hi Nithin,

    I am trading one system on intraday, 30 min chart, 1st candle will be 9:15to9:30 . on Spot Nifty.

    only if there is gap between 3:30(Pre)(High or Low) and today’s 9:30 (Low or High) conditions will traded.
    Condition Buy = if crosses 9:30 high SL low of 1st candle(9-9:30)
    Sell = if Crosses 9:30 Low SL High of 1st candle(9-9:30)

    up to 3 pm condition will execute trade and trade will be squared off at 3:25.

  118. Piyush Agarwal says:

    Dear Sir,

    I wan to get a sound alert or a scanner for Renko charts when the color of candle is changed.

    Please help me out.

  119. sanjay says:

    dear nithin sir,
    i am a breakout trader. i only trade when any strong resistance or any support break with strong volume. can you pl provide code for above condition in one hourly timeframe?

  120. Sudheer says:

    Nithin Sir,

    I am looking for Script code for Alligator Indicator. Price goes above & below Alligator Indicator with different time frames. if available please provide.

    Thanks for all the support.

    Thanks & Regards, Sudheer

  121. Ganesh Keer says:

    I want to back test following strategy. How we can do it automatically?

    On every positive crossover of 5 EMA & 26 EMA, I take call option of nearest strike price to spot price of near expiry the next day @ market open. Then I check every day at 3:15 if stop loss is trigger for the premium. SL triggered if premium drops below 25 %. If stop loss not triggered till expiry then I exit option @ 3:15 on expiry day.

    On every negative crossover of 5 EMA & 26 EMA, I take put option of nearest strike price to spot price of near expiry the next day @ market open. Then I check every day at 3:15 if stop loss is trigger for the premium. SL triggered if premium drops below 25 %. If stop loss not triggered till expiry then I exit option @ 3:15 on expiry day.

    I want to test this strategy for last 10 years for scripts Nifty, Banknifty, Reliance, LT & ICICIBANK.

    Let me know if it is possible.

    • Ah this will not be possible using tradescript. Maybe you can use a professional charting platform like AMibroker or if you have programming language you can check the API docs on kite.trade

  122. Tanveer says:

    Hi,
    i want a simple strategy of Heikin-Ashi (AND) SMA crossover(5,10)

    Heikin-Ashi
    BUY:
    SET HAC = (OPEN+HIGH+LOW+CLOSE)/4
    HAC > MAXOF(REF(HAC,1), REF(HAC,2), REF(HAC,3), REF(HAC,4)) AND SOPK(14, 7, 3, SIMPLE) > SOPD(14, 7, 3, SIMPLE)

    SELL:
    SET HAC = (OPEN+HIGH+LOW+CLOSE)/4
    HAC < MINOF(REF(HAC,1), REF(HAC,2), REF(HAC,3), REF(HAC,4)) AND SOPK(14, 7, 3, SIMPLE) < SOPD(14, 7, 3, SIMPLE)

    AND

    SMA crossover(5,10)
    BUY:CROSSOVER(SMA(CLOSE, 5), SMA(CLOSE, 10))

    SELL:CROSSOVER(SMA(CLOSE, 10), SMA(CLOSE, 5))

    can you please help me in coding both (Heiken-Ashi) AND (SMA crossover) in a single code

    HA-SMA
    BUY:
    SELL:

    Regards
    Tanveer

  123. manoj kumar pingolia says:

    Hi want to code in Pi-
    Buy : When 15 EMA Crosses Above 50 EMA (buy When crossover above 200 EMA)
    only buy and cover position not new sell above 200 EMA

    Sell : When 15 EMA Crosses Below 50 EMA (sell Crossover when it is below 200 EMA)
    only sell and cover position not new buy below 200 SMA

    can you please help me in coding, I am new and not getting any support form any where.
    Regards
    Manoj Kumar Pingolia

  124. manoj kumar pingolia says:

    Hi want to code in Pi-
    sell below 20 EMA when it is below 200 MA
    only sell and cover possion not new buy
    buy Above 20 EMA when it is above 200 MA
    only buy and cover possion not new sell

    can you please help me in coding
    Regards
    Manoj Kumar Pingolia

  125. rakbot says:

    i wish to know if we can use expert advisor for option trading and if so i am not able to backtest the basic scripts plz advice as i am new to expert advisor

  126. NILESH says:

    Hii ,
    i want buy and sell codes for supertrend crossover for 15 min and 5 min charts , parameters – default (7,3)

  127. VIRAL says:

    Hi

    Need code for

    Buy : When 15 SMA Crosses Above 50 SMA.
    Sell : When 50 SMA Crosses Below 15 SMA.

  128. Puneet says:

    Can you help me code my strategy:

    Buy if open is low than previous day close
    Target: buy_price + 1%
    Stoploss: buy-price – .5%
    Squareoff trade at the end of the day

    Short sell if open is higher than previous day close
    Target: buy_price – 1%
    Stoploss: buy-price + .5%
    Squareoff trade at the end of the day

    The above trades should happen immediately as soon as NSE opens and for all 50 stocks of NIFTY50 index.

  129. Vishwa says:

    Zerodha is providing super trading platform and I love to use Zerodha. I would be very much delighted if you can share me the script for N4 or N7 strategy buy & sell script.

  130. Sandeep Uttam says:

    sir
    piz help mi STR buy&sell coode

  131. MITHILESH SINHA says:

    Can you please insert ZIg in Pi-terminal as you are having many indicators in built.This will help a lot.
    with thanks
    Mksinha

  132. Kinjan Shah says:

    Can I have a code for

    Buy : When 5 EMA Crosses Above 17 EMA. Exit after 1% Profit
    Short Sell : When 17 EMA Crosses Below 5 EMA. Exit after 1% Profit

  133. Rajendra Damor says:

    My Code is in amibroker
    how can i set in pi with scan or filter

    //////////////////////////////////////////////////////
    periods = Param(“Periods”,15,1,200,1);
    Ksmooth = Param(“%K avg”,3,1,200,1);
    Dsmooth = Param(“%D avg”,3,1,200,1);
    myStochD =StochD(periods,Ksmooth,DSmooth);
    myStochK =StochK(periods,Ksmooth);
    myRSI = RSI(15);

    Filter = Cross(EMA(C,5),EMA(C,12)) AND C>=25 AND MACD() > Signal()AND Cross(myStochK, myStochD) AND V>100000;

    AddColumn(O,”Open”,1.2);
    AddColumn(H,”High”,1.2);
    AddColumn(L,”Low”,1.2);
    AddColumn(C,”Close”,1.2);
    AddColumn(V,”Volume”,1);
    AddColumn(EMA(C,5),”EMA-5″,1.2);
    AddColumn(EMA(C,12),”EMA-12″,1.2);
    AddColumn(myStochK,”Stochastic %K”,1.2);
    AddColumn(myStochD,”Stochastic %D”,1.2);
    AddColumn(myRSI,”RSI”,1.2);
    //////////////////////////////////////

  134. RAJU says:

    Dear Sir,

    i need a trade script for super trend . kindly help

  135. Siddhartha says:

    Hi,

    I would like to know whether my code is correct or not.

    1. Buy if Close < Lower Bollinger AND RSI Upper Bollinger and RSI > 70 (two Consecutive Green candles)

    Code:
    Buy: CLOSE < BBB(CLOSE, 20, 2, EXPONENTIAL) AND RSI (CLOSE, 14) CLOSE
    Sell: CLOSE > BBT(CLOSE, 20, 2, EXPONENTIAL) AND RSI (CLOSE, 14) > 70 AND Ref(CLOSE, 1)< CLOSE

  136. chandrajeet says:

    Pls help me with the code of below strategy

    when price is above 200 ema in daily and hourly chart, if price crosses 20 period ema shud generate buy signal at the close of candle above 20 ema, and when price is below 200 ema sell if candle closes below 20 period ema
    also help me to generate AI for pin bar candle

  137. Anshuman sharma says:

    Hi greetings, Pls provide me code for following strategy
    2 continous red bars of Heiken Ashi candle, first HA candle closes below EMA 14. Than the second HA candle crosses the low of first candle. Also EMA 14 must be pointing downwards all this while. Eagerly waiting Code Nithin sir

      • Anshuman sharma says:

        Nithin sir

        Posted whr u asked me to post but they replied can’t be made in zerodha. .kindly help me out for different strategy
        Provide me code for this strategy pls. .
        Strategy to be coded-
        The candle crosses the previous high or low on the chart.
        i.e the candle either moves above the previous high or breaks the previous low made, and the previous high, low than replaced by new high low made, in the algo n cycle keeps happening to give signal everytime a high or low is breached. .
        Seriously need this one sir. .pls

  138. Tej says:

    Hi,

    Can anyone please help me with the code script for the below strategy?

    Indicators used are Bollinger Band (20,2), Stochastic (5,3,3)

    Long Entry condition:
    1. Price should have touched the Lower Bollinger Band and closed inside the band forming a Green candle.
    2. The Stochastic should be in Oversold area (Below or around 20) and starting to move up

    Short Entry condition:
    1. Price should have touched the Upper Bollinger Band and closed inside the band forming a Red candle.
    2. The Stochastic should be in Overbought area (Above or around 80) and starting to move down

    Appreciate your help in this.

  139. YASHPAL says:

    HI,

    buy if rsi goes below 25 in one hour chart and sell if rsi goes above 65 in 15 mins chart(I ll sell only those what i purchased below 25 rsi)
    please suggest me code

  140. siva says:

    hi
    i need the afl for difference between open and close …..
    condition is that value will be in only +value ,
    exm: in crude
    open close differnce (C-O) I need AFL result (C-O)
    day 1 3000 3075 75 75
    day 2 2990 2935 -55 55
    day 3 3100 3060 -40 40
    day 4 3075 3013 -62 62
    day 5 2900 3025 125 125
    i will use that value for add in to my finding b/s value .
    thanks in advance……
    regards,
    [email protected]
    9865220178

  141. Hi,

    Can you please help me for expert adviser script for super trend.

  142. nitin jose says:

    Code for stock goes above R3

  143. jaideep says:

    my strategy …..
    will buy if price is greater than 20 ema?
    please code this

  144. Nilesh says:

    Hi,

    I want to backtest the following strategy for intraday 5 min candle timeframe. please guide me how to go about it.

    Buy: When close price is above 30 SMA
    Close this buy trade when current price above 1% of the buy price.
    Stop loss for buy trade is 30SMA

    Sell: When close price is below 30 SMA.
    Close this Sell trade when current price is below 1% of the sell price.
    Stop loss for sell trade is 30SMA.

    Thanks in advance.

    Nilesh

  145. Akash says:

    Please code my strategy
    If a red candle RSI is more than last candle RSI:Buy signal
    If a green candle RSI is less than last candle RSI: Sell signal

  146. DINESH says:

    Hii SIr ,
    new to trading in pi

    What is simple code for buy if MACD indicatior crossover during intraday live chart.

    Is this code will automatically buy or it will just give a signal to buy.

    Please explain it.

  147. Pawan Kumar Singh says:

    Please code my strategy for backtesting
    1. Buy at 9:30 if day open = day low
    target = 0.75%
    stoploss = 0.5%
    2. Sell at 9:30 if day open = day high
    target = 0.75%
    stoploss = 0.5%

    Thanks in advance

  148. Harshit Chauhan says:

    Can i test this code in backtest tool or i need your scripting language to test that code.if so can you please convert my code into your one’s i’will thankfull if it does.

    study(“Supertrend V1.0 – Buy or Sell Signal”, overlay = true)

    Factor=input(3, minval=1,maxval = 100)
    Pd=input(7, minval=1,maxval = 100)

    Up=hl2-(Factor*atr(Pd))
    Dn=hl2+(Factor*atr(Pd))

    TrendUp=close[1]>TrendUp[1]? max(Up,TrendUp[1]) : Up
    TrendDown=close[1] TrendDown[1] ? 1: closeTsl , “Up Arrow”, shape.triangleup,location.belowbar,green,0,0)
    plotshape(cross(Tsl,close) and close<Tsl , "Down Arrow", shape.triangledown , location.abovebar, red,0,0)
    //plot(Trend==1 and Trend[1]==-1,color = linecolor, style = circles, linewidth = 3,title="Trend")

    plotarrow(Trend == 1 and Trend[1] == -1 ? Trend : na, title="Up Entry Arrow", colorup=lime, maxheight=60, minheight=50, transp=0)
    plotarrow(Trend == -1 and Trend[1] == 1 ? Trend : na, title="Down Entry Arrow", colordown=red, maxheight=60, minheight=50, transp=0)

  149. Shankar Shanmugam says:

    Looking for these charts, may be it is already there and just that I don’t know as I am a newbie.
    1. End of day analysis of delivery. Need a bar chart with each bar representing a day volume with break-up showing the delivered quantity.
    2. Trading hours line chart that shows the MIS volume, one line each for MIS buy and MIS sell.
    3. Trading hours line chart that shows the CASH volume, one line each for CASH buy and CASH sell.
    4. Trading hours chart that shows the total pending volume on y-axis and price on x-axis, one line for each BUY and SELL orders.

  150. Ravi Kumar says:

    I want to SET BUY_PRICE and SELL_PRICE when the following two conditions met simultaneously
    i) SET BUY_PRICE = IF(CLOSE > SMA(CLOSE,50)) – But error in the code
    ii) SET SELL_PRICE = IF(CLOSE < SMA(CLOSE,50)) – May be this will also show error

    What is the error in that code ? How to change it ?

    Thanks in advance.
    Ravi

  151. DT0850 says:

    Buy Script = SMA(CLOSE,200) > CMP
    Sell Script = SMA(CLOSE, 200) < CMP

    I cannot Back Test. It says "both Buy & Sell scripts should be there"

    Can you please correct me if I am doing something wrong here?

  152. S RAJASHEKAR says:

    Sir,
    Please tell me the code for SMA, EMA , WMA crossover SUPPORTED BY (IF POSSIBLE ) MACD 26,13,9

    SMA 26 EMA 13 WMA 9

  153. Kuldeep Mishra says:

    There is always too much difference between “Paper Trading” and “Actual Trading” and that’s why most of the new trader loose their hard earned money.

    So, we use Backtest.

    BUT there are 2 issues with Backtesting.

    1. It’s again like “Paper Trading” but on Automated Way.
    2. Every Trader is not a Programmer, so he can’t backtest his strategy.

    I just have a question. Can you not provide a “DEMO TRADING” on INDIAN LIVE MARKET (Stocks, Commodities and Currency) like “MT4 / MT5” Software provides us for FOREX so that a new trader could test his strategy on LIVE MARKET.

    Although it would again be somehow like “Paper Trading” but it would be more closer to “Actual Trading” psychologically.

    I don’t think, you can’t do it. Each trader that opens his account at zerodha, should have a DEMO TRADING ACCOUNT too, so that he could try his strategy without loosing his capital.

  154. Sheersh Jain says:

    may i know the code forbuy and sell using supertrend indicator to be used in Expert Advice .

  155. Anshuman sharma says:

    Sir
    I have studied all MACD realtef algos and applied but the problem is the the algos gives signals when macd is above signal line. Mostly irrelevant signals cause crossover and share price increase already happened .i need the exact moment when crossover is happening…i applied the macd crossover algo from tradescript but it is generating error.
    Pls sir provide me MACD crossover algo.

  156. Nayan says:

    HI,

    CAN YOU CODE THE FOLLOWING STRATEGY FOR ME.

    THIS IS THE ELLIOTT WAVE OSCILLATOR WHOSE VALUE IS DISPLAYED IN THE FORM OF A HISTOGRAM.

    The Elliott Oscillator, or 5/35 Oscillator, is a 35 period simple moving average of prices subtracted from a 5 period simple moving average of prices displayed as a histogram above and below a zero line.

    EWO (i) = SMA(close, 5) – SMA(close, 35)

    THANKS

  157. Tejas desai says:

    Hi Nithin I have developed a screener in Ambibriker using AFL programming language which gives filter the stick which are going to balst in 2 or 4 days it has given me 60 to 100% return I have backtested it and it works fine in any scenario. It took me 3 years to develop this algo after long struggle i was successful. I want to work as partner with you. We can discuss further and I can show you demo of my algo.

    Please email me at tejas_desai007 at hotmail if interested.

  158. Nimesh says:

    hi,
    Need help in making small change in the following simple breakout strategy:
    Buy above previous candle high & sell vice versa, but signal should be generated as soon as high or low is broken by few points (say 2 points) not at the close of the candle.
    Also once one buy signal is generated then another buy signal should not be generated before any sell signal vice versa for sell.
    So what changes are necessary in following code?

    Buy expression: Close>REF(Close,1)
    Sell expression: Close<REF(Close,1)

  159. Shailendra says:

    Hi Nithin sir,

    Please provide code for :

    Green candle = Price closed above EMA 13
    Red candle = Price closed below EMA 13

    Also guide..how to use it in PI and Kite….

  160. Shrinivas Kamath says:

    Hi,

    I want to know out of Nifty 50 how many stocks went above from opening price and came back to opening price.

    Same way how many stocks went below from opening price and came back to it.

    Can we code something to get summary of these price movements.

  161. Bharat says:

    Hello Nithin,
    I want a code for
    1. In downtrend : at bottom Doji/Hammer and next day open Gap up.
    2. In up trend : at top Doji/Inverted Hammer and next day open Gap down.

    Kindly send me on mail .

  162. Bharath says:

    Hi Nithin,

    How to set Fibonacci setting in Pi.

    Thanks,
    Bharath

  163. Himakar Reddy says:

    Hi,

    I dont have any programming experience. So i need help here.

    I want a code for

    1. When the previous day candle is green and IF today’s candle is red
    2. Today’s candle’s OPEN and CLOSE SHOULD be within the previous day OPEN and CLOSE.
    3. Then SELL. BUY at a spread of ”today’s” and “yesterday’s” candles average range.

    similarly if
    1. previous candle is red and IF today’s candle is green
    2. today’s candle’s OPEN and CLOSE should be within the previous day OPEN and CLOSE.
    3. Then BUY. SELL at a spread of ”today’s” and “yesterday’s” candles average range.

  164. Parshuram Desai says:

    What is the script to find Average True Range? Like I want to write a script to find ATR for 100 candles.

  165. NSikder says:

    Sir,

    Pl suggest code for the following two scenarios.

    1) MFI (money flow index) gives positive divergence and crosses 40

    2) If bar opens below lower bollinger band and manages to close 1% above lower bollinger band

    Thanking you,

    Regards
    NS

  166. bipin gautam says:

    sir what would be the code for 14 d rsi + 5 day sma for both going long and short.

  167. Sunil Patel says:

    I have three requests to make.

    1) please add Supertrend indicator in Pi.

    2) Please add Range bar chart for volatility.

    3) please Add ADX/DMS indicator too…

    please update all this in Pi….

  168. zk120121 says:

    I want to scanner who scan the stock & future stocks who’s Open=High (generating sell signal) and also Open=Low (generating Buy Signal)

    could you plz make this possible

    Thanks in advance

  169. sushil261 says:

    Hi Nitin,

    Required your help to create code for below strategy

    When there is crossover of 10 and 20 EMA there should be buy or sell of the stock
    And it should match with ADX cross over. In simple way it will be like when there is cross over of EMA buy or sell only when there is crossover in ADX.

  170. Rinku Rathod says:

    Dear Sir,
    I want to make custom indicator for my PI, so is that possible???

  171. ushrikant says:

    Hello.
    I recently opened account with Zerodha. How can I use algo referring the Renko chart ? When I tried to backtest all the results are with candlestick chart.
    Thanks with Regards
    Shrikant

  172. Harisha M G says:

    Sorry for asking a seemingly obvious question, but I couldn’t figure it out.

    I recently opened an account in Zerodha. I see lot of documentation about algoZ. But what is missing is, where is this available? Is it an online tool, or do I need to download some software for this?

    Thanks

  173. shoban babu m says:

    pleae make a formula …
    buy when 9 mnt sma cross over to 20 mnt sma+stoch d% cross over k%.this is called golden cross over.
    sell when 20 sma cross down 9 sma and stoch k% cross down d%.this is called dead cross over.
    thanking you.

  174. thulasee says:

    Hi,

    How to code the below strategy:

    Buy and Sell: based on the crossover of ‘Ehlers Fisher transform indicator’?

    Please advise.

    Regards,
    Thulasee

  175. marshal says:

    Hi,
    I need to know, is there any tutorial which explains how to use tradescript to create alerts. And how can we create our own codes.

  176. shirish_78 says:

    Hi,

    Do you provide any sort API which I can use to write my own system to interact with trading applications? Basically what I am trying to achieve is algo trading with bit more complexities like looking at the NIFTY chart and then deciding to create position in Futures.

    Regards

  177. Dear Nithin,
    Currently the bracket order screen takes only limit buy/sell orders. Could you please update to take also the market, SL and SL-M orders (during the first buy/sell)? This will be extremely useful and without this, it is a serious handicap and probably many other Zerodha traders feel the same way.
    Since you already have this in place in the normal buy/sell orders (F1/ F2), it should not be too difficult to activate this feature also for the bracket orders.
    Regards.

    • Venu says:

      You can place a market order by:
      a. Entering a higher price than what it’s trading at if its a Buy BO
      b. Entering a lower price than what it’s trading at if its a Sell BO

      Bracket order is a vendor developed product, so it’d be difficult to make changes to the inherent nature of the order for it to include SL & Sl-M entry types. Nonetheless, we’ll co-ordinate and see what best we can do.

      • I think you got it wrong 🙂

        For a buy order the limit price is the price at which / below which the stock will be bought. So, even if I enter a higher price, the stock will still be bought at the CMP if the CMP is lower than or equal to the limit price.

        Same thing applies for sell order.

        I want to buy only when the price reaches a particular value, at which my “buy-setup conditions” are fulfilled, and not at a lower price / higher price. This is currently not possible with the bracket order of Zerodha. I have to use the normal buy order (F1), but then I lose the advantages offered by the bracket order.

        With all humility, I don’t understand why it is difficult to incorporate this change. Bracket order is an extension of the normal buy / sell order, with additional features added. You already have the M / L / SL / SL-M options in a normal order. That means, the necessary macros / subroutines are already present in the software. You only have to activate that part of the programming loop in the bracket order function. Your software vendor should be able to do it in 1 day max. !!

        Come on Zerodha !! You can do it !! This is an opportunity to add one more feather in your cap.

  178. pawan kumar singh says:

    I want to backtest this strategy

    TimeFrame: 15 min

    15min candle should close above/below the ATP of yesterday.
    Then, initiate the trade on the Low/High of that candle and stop loss is Low/High of the candle.

    After 15mins candle touches ATP, sell/buy as per below:

    SHORT- If the touching candle CLOSES below ATP (RED), then SELL below LOW of the touching candle
    with candle high as SL.

    LONG – If the touching candle CLOSES above ATP (GREEN), then BUY above HIGH of the touching candle
    with candle low as SL

    Please help

  179. Dear Nithin,
    I am a new trader with Zerodha. I request an answer for the following query.
    How are the “buy price” and “sell price” denoted as functions in TradeScript?
    For eg.: I want to back test the following algorithm.
    My buy expression is:
    CLOSE>EMA(CLOSE,7) AND
    EMA(CLOSE,7)>EMA(CLOSE,21)*1.001
    RSI(CLOSE,14)<40
    My sell expression is:
    Buy price + 0.5% of buy price.
    How do I code my sell expression?
    Thanks in advance!

  180. RAJESH J says:

    Hi Nithin
    I Need A ALGO Code For Pi Expert Advisors & ALGO Logic

    Buy Above Putt in our Any % of Recent Low on 5 M Chart

    Sell Below Putt in our Any % of Recent High on 5 M Chart

    Percentage calculation Training From Recent High Low on Live Market Price

    Generate Buy/Sell Signals ON PI ALGO Code Pleas Send Code For This Logic

    By RAJESH J

  181. PR0854 says:

    Sir
    How to get mobile trading app login and pwd

  182. PR0854 says:

    Sir, I want this strategy.
    Intraday Chart
    5 min=1 Candle
    Moveing Avg = 20 ema, 50 ema, 100 ema
    MACD = (11), (50-100)
    Stochastic = 3, (%D), 100(%K)

    Moving Avg
    > When price candle goes above or below 100 EMA is a sure & long term Buy or Sell Signal
    > 20 & 50 EMA can be used as support or resistance level

    MACD
    > Buy or sell potion should be taken nearer or while crossing “0” line, which should be carried for relatively medium term (1-2 days) when MACD goes above or below “0” line for decent profit/
    > Positive crossover in positive zone is 100% buy signal & vice versa.

    Stochastic
    > Above 50 Fresh buy
    > Above 80 Buy hold
    > Below 80 Buy Exit
    > Below 50 fresh short sell
    > Below 230 sell hold
    >Above 20 sell Exit

  183. rahul kumar says:

    to sir mai kaise janunga ki kaunsa signal true hai jaise backtest me show karta hai

  184. rahul kumar says:

    trend buster

    CROSSOVER(CLOSE,REF(HHV(30),1))

    CROSSOVER(REF(LLV(30),1),CLOSE)

    plz tell me what is wronge with me

  185. rahul kumar says:

    see

  186. rahul kumar says:

    in pi backtest result and live result are different in same timeframe. what should i do?

    • Venu says:

      In EA, 2 sell signals can get generated simultaneously but in Backtest, a buy signal is followed by a sell signal and vice versa. So if 2 sell signals get generated on EA, Backtest will show only the first sell signal and hence you see the difference.

  187. DN0680 says:

    HELLO NITIN SIR, GD EVENING
    I WANT TO MAKE SIMPLE SCANNER STRATEGY FOR STOCHASTIC OSCILLATOR FOR PI SOFTWARE.
    BUY = STOCHASTIC OSCILLATOR(%K) CROSSES ABOVE STOCHASTIC OSCILLATOR(%D) BELOW 20 LEVEL.
    SELL= STOCHASTIC OSCILLATOR(%K) CROSSES BELOW STOCHASTIC OSCILLATOR(%D) ABOVE 80 LEVEL.
    FOR 5 MINUTE TIMEFRAME.
    THIS STRATEGY APPLY IN DAILY CHART AND GENERATE A BUY SIGNAL AND IN 5 MINUTE CHART EVERY BUY SIGNAL GENERATE IN SAME STRATEGY , IF IS IT POSSIBLE SCANNER READ THIS TYPE OF STOCK?

  188. Amin says:

    I need a simple strategy to find overnight gaps for past 7 days, up or down where my conditions would be as follows.

    up gaps:

    today Low > Previous day high
    today volume > 1.5 times Previous day volume

    down gaps:
    today high 1.5 times Previous day volume

    Can you make a code for this?

  189. gaurav says:

    sir i wish to create an alert in pi when-a new 10 bar low is made ,when a new 10 bar high is made intraday ,
    timeframe 15 minutes charts plz guide me

    how to code this and create a scanner for this
    thanks

  190. jawaharraj says:

    Hi,
    Greetings, Is it possible to execute SELL/CLOSE option position based on Total price?.

    Example:

    I bought 100 option of CE8000 for Rs.X, if my current position TOTAL AMOUNT(Ex: Rs. Y) reaches certain amount, it need to execute SELL order at market price.

    It would be help full if u send back-testing steps. Thanks for your time.

    Thanks

  191. DV0367 says:

    Hi Nitiin,

    Please help me code this,

    buy only when sma close 10 crosses ema 30 from below and price is trading above sma 200

    sell only when sma 10 dips below ema 30 and price is trading below sma 200

    Thanks

  192. ashirwadmittal says:

    Hello Team Zerodha, I hold account da6251. I wanted a script to be made on my strategy. Crossover of 5-period exponential moving average and 20 period moving average on candle stick chart of 3 minutes. I find it great for trading in crudeoil, I want to backtest my strategy.
    For example, in the picture attached below trader gets into trade sell when 5 period is below 20 period and buy when 5 period is above 20 period. I hope you’ll help me out.

    Thanks!

  193. da5903 says:

    Hi, I’ve been trying the following script:

    Sell Script:
    SET MA1 = ExponentialMovingAverage(CLOSE, 20)
    SET MA2 = ExponentialMovingAverage(CLOSE, 05)
    CROSSOVER(MA1, MA2) = TRUE

    Exit Short:
    SET MA1 = ExponentialMovingAverage(CLOSE, 20)
    SET MA2 = ExponentialMovingAverage(CLOSE, 05)
    CROSSOVER(MA2, MA1) = TRUE

    However, while back testing, it says : “No results. Make sure at least Buy & Sell signals are typed in”
    I’m unable to identify the error in the script. Would appreciate help in this regard.

    Thank you

  194. manish lambat says:

    can i get the coding done for generating buying signal when 20 days ema crosing 20 days sma ?

  195. […] Code your Technical Analysis strategy | Z-Connect by Zerodha – Traders, This is where we will be getting help from our programmers to code your technical analysis strategy. It could be as simple as moving average crossovers to … […]

  196. sreespg says:

    let me know, How to take last four RSI values fr checking >= or <= condition with current RSI value ( 2min interval)
    And also want to take the current value of MACD & EMA values from MACD chart and K, D & J values from KDJ indicator?

  197. msreddy says:

    Dear Nithin,

    I have few queries below.
    1. In all the EA’s opposite signal serves to close the position. But, how to generate signal for closing the Buy position (which is not the correct point to short the script only profit booking point) and sell (to open a new sell trade) separately and vice versa by meeting required criteria. I hope you got my intension.
    2. Can we get different colour of buy, sell signal for different EAs.
    3. Can we get signals from 2 different EAs at a time in live market.

    • 1. You will have to run two EA’s then, a Buy EA and another one Sell EA simultaneously on the same strategy.
      2. hmm.. not possible currently.
      3. Yes, you can get from as many EA’s as possible.

  198. Prashant Mali says:

    Hi Nitin,

    I have just started with intra-day trading. i do trading on basis of total buy quantity vs total sell quantity.
    I want to know if we can generate the signal on basis of quantity i.e. buying is more than selling then buy signal and vice versa.

  199. HARI RAO says:

    I want to do intraday trading in options with a 30 minute Heikin Ashi candle stick chart and RSI raising above 30. So can U please set a Scan and Alert and write the code for the same.If you can mail it to my mail Id ,i will be much obliged

  200. Abhishek Mishra says:

    Sir how can we code for a buy on haikin ashi chart above 36 day EMA and sell below 36 day EMA on HA char while using 5 min.timeframe intrady .I tried using the script provided by Expert adviser ,but it shows HAC error while back-testing.

  201. chintamani says:

    CAN WE CODE MULTITIMEFRAME STRATEGIES IN pi.
    Simple :
    1 hour chart c>sma 200
    and
    5 minute chart c<sma200

    Please inform.Thanks.

  202. chirjeev singh arneja says:

    hi
    can I code bollinger bandwidth in the algos.
    i.e. if bollinger bandwidth is narrow then cross over of 10 & 20 EMA gives me Sell signal and vice-versa.

  203. KANWAL says:

    Hi,
    I have 2 queries.
    1) When are u going to start full automation on pi? Need it on urgent basis
    2) I need to backtest scrips/indices for 3-5 years? How can i do that

    Regards

    • 1. We will be releasing Pi bridge + very soon. If you are a programmer it will be quite simple. You can pull all info from trade updates to funds to third party program, and fire orders from there using sockets.
      2. You will have to buy it from a data vendor. Try asking neotradeanalytics.com. Mention your zerodha client ID, they will give u a discount.

  204. Rabi says:

    Please help me to write my strategy
    I want to get a buy signal only when the price is above 50 sma and the candle close above the 75% of its todays low. for example the price is above 50 sma. Todays low is 95 and high is 102. I want to get a buy signal if the candle close above 100.25
    Similarly I want to get a sell signal only when the price is below 50 sma and the candle close below the 74% of its todays high. For example the price is below 50 sma. Todays low is 95 and high is 102. I want to get a sell signal if the candle close below 96.75

  205. shivasrinivas says:

    Nithinji , friday when i tried to place BO in petronet . order was rejected as client not enabled on product , then called customer care , they activated BO , after that also when placed order was rejected says “margin exceeded ,required margin 3 lakhs something and have only 2 lakhs something” like that, but i had enough margin in my a/c besides my other trades when i calculated in bo calculator it comes around 7000 , but for the same order i put SL and TSl for 95 paise , then only i saw in below 1 rupee SL or TSL cant put order.? does that order rejected becuase of that Sl. tsl?
    does minimum would be 1 re or 1.5 % ? and also one more query say if i place 4 lots at the time of placing BO and can modify in between to sell 2 lots for some gain and hold the remaing for EOD?Thanks in advance

  206. Madhujeet says:

    Nitin Sir can you please let me know code for below given strategy.
    buy when stock breaks high after 10.00 am ( high should be from 9.30 to 10.00am)
    sell when stock breaks low after 10.00am (low should be from 9.30 to 10.00 am)

  207. GANESH says:

    Hello Nitin ,

    I would like to code the following.
    the input to the code will be the prices from cash or spot mkt . like Nifty cash price to be considered to take the trade . but trade to be taken on nifty futures . Is this possible ? Thanks

  208. Nikhil Zelawat says:

    HI,

    I need a code of following stretegy :
    this is to apply in EOD chart

    Buy : buy at todays high if ( ( yesterdays high > todays high) and (yesterday low todays high) and (yesterday low < todays low) )

    sell : EOD (using MIS type)

  209. K.Narayana says:

    Sir,

    I didn’t get any code from these sites
    http://zerodha.com/expert-advisors/
    http://tradingqna.com/algos-strategies-and-code

    Please send code for automatic buy and sell signals for above EMA cross overs.

    Thank you

  210. K.Narayana says:

    Sir
    Thank you for your reply, and

    I need code for automatic buy and sell signals for above EMA cross overs

  211. K.Narayana says:

    Sir

    I need a code for the following condition.

    Buy: whenEMA5 line crosses EMA10 from below.
    Sell: whenEMA10 line crosses EMA5 from below.

    For above code how to generate buy and sell ARROW symbols.

    Thanks in advance.

  212. subhash says:

    Dear Zerodha,
    i got the Amibroker software

    the formulas AFLs

    but as i am a new user i don’t know how to use the AFL files

    plz guide me what i have to do in setting if there is

    i pick the afl files in auto analysis but not working

    plz reply i got afl files but dont know how to use i can not use it

  213. shailendra says:

    its a request to send code code for following:-
    buy signal = when ema 10 crossing ema 20 above side and price candle on five minute time frame close above or at ema 10.
    sell signal = when ema 10 crossing ema 20 down side and price candle on five minute time frame closes at or below ema 10.

  214. Mukul says:

    My strategy is EoD strategy
    When 14 period ADX is above 35.
    BUY:- +DI above -DI and Today Fast STOCK %K must close under 40% (Period for %K is 8) ,We will buy tomorrow one tick above today’s high.

    Sell:–DI above +DI and Today Fast STOC %K is close above 60% We will sell short tomorrow (Day two),one tick below today’s low.

  215. Guru says:

    Hi Team,

    Need your help in coding for a VSTOP indicator, below is the code. Can you please help in converting it to Code that can be used in PI software.

    study(“Volatility Stop”, shorttitle=”VStop”, overlay=true)
    length = input(20)
    mult = input(2)
    atr_ = atr(length)
    max1 = max(nz(max_[1]), close)
    min1 = min(nz(min_[1]), close)
    is_uptrend_prev = nz(is_uptrend[1], true)
    stop = is_uptrend_prev ? max1 – mult * atr_ : min1 + mult * atr_
    vstop_prev = nz(vstop[1])
    vstop1 = is_uptrend_prev ? max(vstop_prev, stop) : min(vstop_prev, stop)
    is_uptrend = close – vstop1 >= 0
    is_trend_changed = is_uptrend != is_uptrend_prev
    max_ = is_trend_changed ? close : max1
    min_ = is_trend_changed ? close : min1
    vstop = is_trend_changed ? is_uptrend ? max_ – mult * atr_ : min_ + mult * atr_ : vstop1
    plot(vstop, color = is_uptrend ? green : red, style=cross, linewidth=2)

  216. trader-001 says:

    Also, could you pls guide what beginners can read to learn the basic strategies, so that building upon them becomes easier. That is besides this very informative blog, which I am slowly reading, and the chapter on Trading System Techniques in Tradescript manual. Thanks.

  217. trader-001 says:

    I am backtesting simple strategies as a beginner, and the biggest problem I face is being whipsawed out in non-trending markets. Trend indicator like ADX are too late to respond and by then moves are over and I am stagnated again into sideways market. Please suggest some strategy/indicator to stay out of sideways market, and yet not lose the beginning of good moves.

  218. renjithppaul says:

    Please help me by coding this strategy

    Buy Level = L+[ 0.5 * (H-L)]
    Buy Stoploss = L+[ 0.1 * (H-L)]
    Buy Target = L+[ 1.0 * (H-L)]

    Sell Level = H-[ 0.5 * (H-L)]
    Sell Stoploss = H-[ 0.1 * (H-L)]
    Sell Target = H-[ 1.0 * (H-L)]

    Where
    H = Highest of Previous Day High and Current Day High
    L = Lowest of Previous Day Low and Current Day Low

    If any filter can be provided reduce the number of trades per day to 2 or 3

    Regards
    Renjith

  219. Amit says:

    what is best stratergy for trading nifty future 1 hour time period

  220. Bose says:

    Hi NIthin,
    This is my stragery, every sell signal and Exit Short works fine, its just that i am not getting any buy Signals although when I checked it on the Chart it should have given many buy signals.
    Please help me, TradingQandA though being a great website is very slow, Whereas your replies are brisk. Please tell me what is wrong with this code here on this page itself. I wrote the strategy myself yet something seems to be wrong with it.

    BUY Signal – WWS(CLOSE,5) > WWS(CLOSE,8) > EMA(CLOSE,40) > SMA(CLOSE,75) AND MACDSIGNAL (13, 26, 9, EXPONENTIAL) > 0 AND AND DIP(14)>25 ADX(14) >28

    SELL Signal – WWS(CLOSE,5) < WWS(CLOSE,8) < EMA(CLOSE,40) < SMA(CLOSE,75) AND MACDSIGNAL (13, 26, 9, EXPONENTIAL) 25 AND ADX(14) >28

    Exit Long – MACD(13, 26, 9, EXPONENTIAL) > MACDSIGNAL (13, 26, 9, EXPONENTIAL) AND CLOSE < EMA(CLOSE,40) OR CLOSE < OPEN AND REF (CLOSE, 1) < REF(OPEN, 1) AND REF(CLOSE, 2) < REF(OPEN, 1)

    Exit Short – MACD(13, 26, 9, EXPONENTIAL) EMA(CLOSE,40) OR CLOSE > OPEN AND REF(CLOSE, 1) > REF(OPEN, 1) AND REF(CLOSE, 2) > REF(OPEN, 2)

    Please help me out, My script is almost done just a bit of correction from your end will do wonders.
    Again, Buy and Exit Long are not giving any signals.

    • Bose says:

      The above one had a few errors, if corrected them still the problem persists.

      Buy – WWS(CLOSE,5) > WWS(CLOSE,8) > EMA(CLOSE,40) > SMA(CLOSE,75) AND MACDSIGNAL (13, 26, 9, EXPONENTIAL) 25 AND ADX(14) >28

      SELL – WWS(CLOSE,5) < WWS(CLOSE,8) < EMA(CLOSE,40) < SMA(CLOSE,75) AND MACDSIGNAL (13, 26, 9, EXPONENTIAL) 25 AND ADX(14) >28

      Exit Long – MACD(13, 26, 9, EXPONENTIAL) > MACDSIGNAL (13, 26, 9, EXPONENTIAL) AND CLOSE < EMA(CLOSE,40) OR CLOSE < OPEN AND REF (CLOSE, 1) < REF(OPEN, 1) AND REF(CLOSE, 2) < REF(OPEN, 1)

      Exit Short – MACD(13, 26, 9, EXPONENTIAL) EMA(CLOSE,40) OR CLOSE > OPEN AND REF(CLOSE, 1) > REF(OPEN, 1) AND REF(CLOSE, 2) > REF(OPEN, 2)

      Please look at this one.

  221. Bose says:

    Hi Nithin, I have posted the requirements on tradingq&a please ask someone to answer it
    http://tradingqna.com/15458/need-buy-sell-script-for-pi-based-on-the-following
    Thank you

    • Will get someone to reply, cheers. I was answering coding queries here, but have stopped now as the length of this post has gone too long, and it is not easy for others with similar queries to refer to.

  222. Bose says:

    Nithin,
    What i mean is i want to backtest the above code i.e Qudara strategy on Pi Backtest.
    I am a newbie and i dont really now anything about backtesting hence, i request you to type in the Buy,Sell,Exit long, Exit Short for the above script so that i can impute your wirtings on the Backtest tab and get it working.
    You can check out this link – http://www.trader-guide.com/quadra-safe-trading-strategy/
    This is what i am hoping to get as a backtesting script.
    Thank You. 😀

    • Bose says:

      Basically I want it to Buy when Wells Moving Avg WWMA – 5,8 and 13 crosses over EMA 50 and all the above crosses EMA 125. Plus MACD crosses 0 Positive.
      and sell when WWMA = 5,8 and 13 crosses below the EMA 50 which crosses the EMA 125 and MACD crosses 0 Negative.
      and if possible,
      Exit Long – if 5th candle closes below 4th Candle Close in conjunction
      Exit Short- if 5th Candle closes above 4th Candle High

      This is my first script pattern, please do share your opinion if i am doing something wrong.

      Thank you so much for your brisk replies.

  223. bose says:

    Hi Nithin can you help me out with this, i need the Pi script for this code,
    /****************************/
    /* */
    /* Quadra Trading System */
    /* Version 1.35 */
    /* (22 December 2012) */
    /* */
    /****************************/

    SetChartOptions(0, chartShowDates | chartWrapTitle);

    /**********************/
    /* */
    /* Define Wilder’s MA */
    /* */
    /**********************/

    function WilderMA(Field, Period)
    {
    X[0] = Field[0];

    for(i = 1; i < BarCount; i++)
    {
    X[i] = Field[i]/Period + X[i – 1] * (Period – 1)/Period;
    }
    return X;
    }

    /**********************/
    /* */
    /* Define EMA */
    /* */
    /**********************/

    function MyEMA(Field, Period)
    {
    Y[0] = Field[0];
    for(i = 1; i O;
    Red = C = C[i – 1]) Green[i] = 1;
    if(Red[i – 1] AND C[i] <= C[i – 1]) Red[i] = 1;
    }
    }

    /********************/
    /* */
    /* COMPUTE SL */
    /* */
    /********************/

    PrevHi = H;
    PrevLo = L;
    SLBuy = Null;
    SLShort = Null;
    GUp = GapUp();
    GDn = GapDown();

    for(i = 2; i = L[i – 1] AND L[i – 1] <= L[i])
    {
    PrevLo[i] = L[i – 1];
    }

    PrevHi[i] = PrevHi[i – 1];
    if(H[i – 2] = H[i])
    {
    PrevHi[i] = H[i – 1];
    }

    }

    /********************/
    /* */
    /* BUY/SELL */
    /* */
    /********************/

    Buy = (A1 > A2 AND A2 > A3);
    Sell =(A1 < A2 AND A2 < A3);

    Buy = ExRem(Buy, Sell);
    Sell = ExRem(Sell, Buy);

    Bought = Flip(Buy, Sell);
    Sold = Flip(Sell, Buy);

    for(i = 1; i
    {
    SLShort[i] = Min(PrevHi[i], PrevHi[i – 1]) + 0.1;
    if(GDn[i]) SLShort[i] = L[i – 1] + 0.1;
    if(Sell[i]) break;
    }
    for(i = 1; i
    {
    SLBuy[i] = Max(PrevLo[i], PrevLo[i – 1]) – 0.1;
    if(GUp[i]) SLBuy[i] = H[i – 1] – 0.1;
    if(Buy[i]) break;
    }

    for(i = 1; i SLShort[i – 1]) SLShort[i] = SLShort[i – 1];
    }

    Marker1 = Buy * shapeUpArrow + Sell * shapeDownArrow;
    MarkerColor = IIf(Buy, colorBrightGreen, colorYellow);
    Marker1Dist = IIf(Buy, 0.995 * L, 1.005 * H);

    /***********************/
    /* */
    /* SHOW/HIDE Option */
    /* */
    /***********************/

    Arrows = ParamToggle(“Show Arrows”, “NO|YES”, True);
    ShowTSL= ParamToggle(“Show TSL Line”, “NO|YES”);

    _N(Title = EncodeColor(colorLightGrey) + “QUADRA EOD TRADING SYSTEM Concept by Savant Garde\n”
    + EncodeColor(colorYellow) + “Implementation by Anant Navale; AFL Version 1.35\n\n”
    + EncodeColor(colorPink) + StrFormat(“{{NAME}}({{INTERVAL}}), {{DATE}} : {{OHLCX}}, Vol=%1.0f\n{{VALUES}}\n”, V)
    + EncodeColor(colorBrightGreen) + WriteIf(Green, ” Green Candle”, “”)
    + EncodeColor(colorRed) + WriteIf(Red, ” RedCandle\n\n”, “\n\n”)
    + EncodeColor(colorWhite) + WriteIf(Buy, “Buy Above ” + (H + 0.1), “”)
    + WriteIf(Sell, “Sell Below ” + (L – 0.1), “”)
    + WriteIf(Buy, ” StopLoss = ” + SLBuy, “”) + WriteIf(Sell, ” StopLoss = ” + SLShort, “”));

    if(Status(“action”) == actionIndicator)
    {

    /****************/
    /* */
    /* ALERT OUTPUT */
    /* */
    /****************/

    TxtX = Param(“Text Left”, 800, 0, 1000, 10);
    TxtY = Param(“Text Top”, 50, 1, 650, 10);

    GfxSelectFont(“Tahoma”, 14, 700 );
    GfxSetBkMode(1);

    if(LastValue(Buy) OR SelectedValue(Buy))
    {
    GfxSetTextColor(colorBrightGreen);
    GfxTextOut(“BUY Triggered”, TxtX, TxtY);
    Say(“Buy Triggered”);
    }

    else if(LastValue(Sell) OR SelectedValue(Sell))
    {
    GfxSetTextColor(colorGold);
    GfxTextOut(“SELL Triggered”, TxtX, TxtY);
    Say(“Sell Triggered”);
    }

    else
    {
    GfxSetTextColor(colorBlack);
    GfxTextOut(“”, TxtX, TxtY);
    }

    Plot(A4, “EMA50”, colorLightGrey, styleLine | styleThick);
    Plot(A3, “Wilder MA1”, colorRed, styleLine);
    Plot(A2, “Wilder MA2”, colorLightOrange, styleLine);
    Plot(A1, “Wilder MA3”, colorBrightGreen, styleLine);

    if(ShowTSL)
    {
    Plot(SLBuy, “SL for Buy”, colorLightBlue, styleDots);
    Plot(SLShort, “SL for Short”, colorGold, styleDots);
    }

    Plot(C, “”, IIf(Green, colorGreen, IIf(Red, colorRed, colorGrey50)), styleCandle);

    if(Arrows)
    {
    PlotShapes(Marker1, MarkerColor, 0, MArker1Dist);
    }
    }

    if(Status(“action”) == actionExplore)
    {
    Filter = Buy OR Sell;

    SetOption(“NoDefaultColumns”, True);
    AddTextColumn(Name(), “SYMBOL”);
    AddColumn(DateTime(), “DATE”, formatDateTime);
    AddColumn(IIf(Buy, 66, 83), “TRIGGER”, formatChar, colorWhite, IIf(Buy, colorGreen, colorRed));
    AddColumn(IIf(Buy, H + 0.1, L – 0.1), “TRIG PRICE”, 1.2);
    AddColumn(IIf(Buy, SLBuy, SLShort), “Stop Loss”, 1.2);
    AddColumn(C, “Last Close”, 1.2);
    }

  224. Rahul Shah says:

    I am new to pi but I am not able to code my strategy I want to do intraday in nifty options. My strategy is to buy call/put 4 lots of nifty option in 1 min chart when EMA 5 crosses EMA 15 and sell it when reverse so how to write code in new alerts section in pi. there are four sections buy script,sell script,exit long script,exit short script but I dont know how to code it.

  225. CT says:

    Hi ,

    I have started using PI and it is really Good. I wanted to know if there is any way to generate a alert after nifty makes a upward or a downward movement of more than 10 points from the closing price of the previous candle on a one minute intraday chart. Also is it possible to view two candlestick charts on the same page like the index chart and the stock chart.

  226. manoj says:

    hi i’m new to pi trading platform and my query’s are
    1. i have some afl strategy’s of amibroker and can they be directly used in the pi trading platform by just copy and pasting which are in afl formats.
    2. if i make a strategy in pi software, can that be used in amibroker directly by copy pasting in the formula wizard.

    thank you

    • 1. No Manoj, you will have to recode them using tradescript. If you are using Ami, you can use the Pi bridge to fire alerts directly from Ami using the bridge. Check this.
      2. No, the programming language is different in Pi and Ami.

  227. […] Code your Technical Analysis strategy – Z-Connect by Zerodha – Traders, This is where we will be getting help from our programmers to code your technical analysis strategy. It could be as simple as moving average… […]

  228. Pallavi Deoghare says:

    1. How do I use Pi to place a simple price alert. Like Bhel touched a price of 230.
    2. Similarly how do i create alert for price touching a EMA on particular timeframe. Like Bhel has touched 34 EMA on 60 min chart

  229. kapil says:

    how to view bid/ask lines in ami broker charts or pi charts not the ltp line

  230. AshishM says:

    Hi,

    had posted the query for coding a EA, which can be used to scan scripts in tradingqna.

    Strategy 1 : Give signal when,

    (a) Ehler Fisher transform reverses from top ie Trigger value becomes greater than signal value, AND

    (b) Elder bear power > 0, AND

    (c) Elder bear power > Elder Bull power

    Strategy 2 : Give signal when,

    (a) Ehler Fisher transform reverses from bottom ie Trigger value becomes less than signal value, AND

    (b) Elder Bull power > 0, AND

    (c) Elder Bull power > Elder Bear power

    Also, how to use the above strategies for scanning the selected scripts for a particular timeframe in Pi

    The feedback recd was that, it is not possible to code the following strategy in Pi. Am not able to understand that why cant an EA be created with indicators available in Pi. In fact, I wanted to try the strategy as mentioned above and also a strategy with only elements (a) & (b) in the strategies mentioned above being met and evaluate the results.

    Await feedback pl.

    • Ashish, I think I posted the answer already, preset codes for Elder is not available. If you can give the logic of elder bear power, that can be coded.

      • AshishM says:

        Nithin, am not sure what is being referred to by preset codes not available.
        In the strategy logic, had made reference to “Elder Ray Bull Power” , “Elder Ray Bear Power”, which is amongst the set of TA indicators available in Pi. The strategy is a combination of reversal of Ehler Fisher transform & checking for supporting values of Elder Ray Bear / Bull power indicator.

        • Yes Ashish, this is available as an indicator on Pi, but there is no tradescript code for it as such. For example there is EMA which is a preset code for Exponential moving average, similar to that there is preset code for Elder. You will have to build this code yourself. But I am checking it out with our team, will keep you posted.

  231. Deepak P says:

    Hi Sir,

    I am trying to write a strategy in PI software with following condition.

    1. Buy when Nifty 2 min. candle goes below bollinger band and closes within bollinger band boundary.
    2. Sell when Nifty 2 min. candle goes above bollinger band and closes within bollinger band boundary.

    I am attaching the 2 min. chart highlighting the signal points I am expecting.

    I tried using the example in the book but it does not work properly. Thanks.

  232. prakash says:

    i want a code like this.
    can i get help to code this

    identify the high and low from 9.15 am till 10 am
    whenever the same high is reached from 10.01 am to 3 pm do a SL Long and exit 0.75 paisa above the entry price. Same with low but SL short and exit 0.75 paisa lower than the entry price.

    thanks

  233. prakash says:

    this is good. but which strategies do give good success rate? there are so many strategies out there for intraday stock or intraday stock futures

    thanks!

  234. VNS Kodukula says:

    Hi,
    I need a code for Heikin Ashi Smoothened with a input parameters of 2-2-3-2

    BUY SIGNAL : When body of the colour changes Green (after 1st candle confirmation).
    SELL SIGNAL: When body of the colour changes RED. (after 1st candle confirmation).

    At the same time, Reversal order should takes place by sqaring-off previous positions.

    Thank you,

  235. Karunaithi Thangavel says:

    Hi Nithin,

    I need some sample code for Bank Nifty (Future)

  236. Ravi says:

    I didnt get answer in Q&A for the strategy

    Hi Nitin,

    I have a Strategy to code on buy for Crudeoil
    Buy
    Crossover(EMA(Close,50),EMA(CLOSE,5))
    Sell
    Crossover(EMA(Close,50),EMA(CLOSE,5))
    Buy Exit
    I want it to be above last crossover of the my buy signal
    Sell Exit
    I want it to be above last crossover of the my sell signal

    And also want to avoid Flat cross over any indicatiors to club with RSI or CCI which avoids flat entry or exit.

    Why I want the buy exit & sell exit is due to it opens new sell which is like & buy & sell order closed missed opportunity. This has to be in 5 Min Chart

  237. saravanan says:

    Hi Nitin sir
    How to Create Expert Advisor

  238. Ravi says:

    Hi Nitin,

    I have a Strategy to code on buy for Crudeoil
    Buy
    Crossover(EMA(Close,50),EMA(CLOSE,5))
    Sell
    Crossover(EMA(Close,50),EMA(CLOSE,5))
    Buy Exit
    I want it to be above last crossover of the my buy signal
    Sell Exit
    I want it to be above last crossover of the my sell signal

    And also want to avoid Flat cross over any indicatiors to club with RSI or CCI which avoids flat entry or exit.

    Why I want the buy exit & sell exit is due to it opens new sell which is like & buy & sell order closed missed opportunity. This has to be in 5 Min Chart

  239. Ravi says:

    Hi Nitin,

    In PI Go live to tested strategies are not getting executed even if i say go live it gives just an alert no execution no pop up.

    My client id DR0875.

    Resolve it quickly.

  240. Muthu Shunmugam says:

    Hi Nithin,

    Is it better to use buy exit for buy calls instead of sell in the back test?

    Buy -> Buy exit OR Buy -> Sell

    For a same logic, same script, same time period, I got different back test results, for the above two scenarios, that’s why asking you.

    1. Kindly clarify the difference between these two — How the system treats these two.

    2. How the system evaluate the Trend inbuilt function — clarity is not there. Even the market is in trend, this function didn’t catch it. Since market trend is subjective (few points or few 10s of point etc) and Trend function is inbuilt, I couldn’t understand how it finds whether the market is up/down trend. I referred the user manual in Pi as well the links you shared — They are saying what this function does and they didn’t say how. Kindly clarify.

    Regards
    AMS

    Regards
    AMS

  241. Nitesh sharma says:

    Buy Expression:

    Hi Nithin,

    I have Copy Pasted exactly the Same in PI to back test for Bank Nifty But Does Not Gives me any Result ,

    MACD(26,12,9,EXPONENTIAL)>MACDSIGNAL(26,12,9,EXPONENTIAL) AND RSI(Close,10)>30 AND REF(RSI(Close,10), 1)<30

    Buy exit: 0

    Sell Expression:

    MACD(26,12,9,EXPONENTIAL)<MACDSIGNAL(26,12,9,EXPONENTIAL) AND RSI (CLOSE,10) 70

    Sell exit: 0

  242. DS4666 says:

    what is the code for single candle divergence?

  243. […] programming language used on pi is called tradescript, and this post has around 300+ queries answered and the manual, should help you get […]

  244. jitendra says:

    hi nitin ,
    I just want to compare prices of some script from nifty at 9:30 and want to get alert from the software it self. I need alert about script whose open price is equal to high or low price of that script for the day upto 9:30. Can you pls provide the code for the same.

  245. Prakash says:

    my query is, when we do ema 3,7 cross over coding and run replay of candles, the signals are placed in previous candles, i need at the candle when its conformed.

  246. Shantanu1981 says:

    Need a screener with the following parameters:

    Indicator: Slow Stoch, 39 + EMA 34
    Condition: Screen for stock for which Slow Stoch 39 moving from under to over 50 and from over 50 to under 50. Also plot 34 EMA.

    • Andrewman says:

      Assuming you want a buy for Stoch 3,9- you can use below code-

      Buy- SOPK(9, 3, 9, SIMPLE) > 50
      Sell- SOPK(9, 3, 9, SIMPLE) < 50
      also not clear about second part of your query

  247. Ramkrishna says:

    I wanted to ask a query related to coding, hence tried to register myself on Trading QnA, however it is giving me the attached error…Am i doing anything wrong Sir?

  248. chetan says:

    Hi Nitin,

    Hope you fine.

    Please send a code of below formula for 5 min chart.

    For BUY : 26th Nov close is 8500 and 27th Nov close is 8555 (means two positive candle) and MACD (11,50,100) is crossing over zero line and stochastic (3,100) is greater than 50

    For SELL : 26th Nov close is 8500 and 27th Nov close is 8450 and MACD (11,50,100) is crossing below zero line and stochastic (3,100) is less than 50

    Please send as earliest as possible on [email protected]

    Thanks
    chetan

  249. Nitesh sharma says:

    Hi Nithin

    Can i backtest few strategies on the current trading platform

  250. […] Code your Technical Analysis strategyZ-Connect by Zerodha … – Traders, This is where we will be getting help from our programmers to code your technical analysis strategy. It could be as simple as moving average… […]

  251. radhey says:

    no reply yet ?
    i m waiting sir………..

  252. radhey says:

    I specified it more :-

    Buy = 1. close or touch below bb
    2. rsi above 20 or 30
    3. ema 3/13 crossover
    4. L3 or H4 of advance camrilla
    5. volume above ave of 8 period of time

    Sell = vice versa
    1. above or touch above bb
    2. rsi above 80 or 70
    3. ema 3/13 crossover
    4. H3 or L4 of advance camrilla
    5. volume above ave of 8 period of time

    pls tell how to beck test it in nest trader..

  253. radhey says:

    radhey
    regarding the query on the 20th july 2014

    dear sir,
    I DONT KNOW CODING OF MY STRATEGY IS POSSIBLE OR NOT……….IF POSSIBLE
    pls code my strategy which IS giveN below :

    BUY : – crossover 2 sma and 5 tma((5 days trigular or pivot point average) + rsi line crossed 2nd time 30 toword upside + stoc above 20 line (on 2nd time crossing toward upside just like “hook’ upward) + special candlesticks pattern (higher closing to high of doji , hammer candle OR two bar reversal OR 50 % retracement of benchmark candle ) and…+ L3 OR R4 ……..[addING …ADVANCE CAMARILLA LEVEL ALSO……AS SUPPORT AND RESISTANT RATHER THAN PIVOT POINTS] + INCREASED VOLUME ALSO (IT SHD B ABOVE AVE OF LAST 8 PERIOD OF GIVEN TIME )

    SELL :- JUST VICE VERSA
    crossover 2 sma and 5 tma((5 days trigular or pivot point average) + rsi line BELOW 70 toword DOWNside + stoc BELOW 80 line (on 2nd time crossing toward DOWNside just like “hook’ DOWNward) + special candlesticks pattern (LOWER closing to LOW of doji , hammer candle OR two bar reversal OR 50 % retracement of benchmark candle ) and…+ R3 OR L4 ……..[addING …ADVANCE CAMARILLA LEVEL ALSO……AS SUPPORT AND RESISTANT RATHER THAN PIVOT POINTS] + INCREASED VOLUME ALSO (IT SHD B ABOVE AVE OF LAST 8 PERIOD OF GIVEN TIME )

    I WOULD B VERY OBLIGED TO U IF ABOVE MENTIONED STRATEGY CONVERTED INTO CODES

    THANKS

    YOURS FAITHFULLY

    RADHEY

    R

  254. radhey says:

    21 Jul 2014 at 10:07 AM
    radhey

    if specific candle pattern is not possible right now , pls code rest of strategy of mine…………ma crossover + stch+ rsi+ camrilla

    Reply

    21 Jul 2014 at 10:10 AM
    radhey

    and + vol also

  255. Harcharan Singh says:

    Kindly code this strategy for me : This is strategy to buy/sell based on Camarilla Equation Levels: Buy When the price goes below L3 Level and then closes above it. Keeping L4 as Stop Loss and H1 as Target. SELL when price goes above H3 and closes below it keeping H4 as Stop Loss and L1 as Target. To calculate these levels use the following formula : To calculate Camarilla Pivot points all you need is previous trading day’s high low and close value. Below are the equations for calculation various levels.

    C = Previous day close

    H = Previous day high

    L = Previous day low

    H4 = [0.55*(H-L)] + C

    H3 = [0.275*(H-L)] + C

    H2 = [0.183*(H-L)] + C

    H1 = [0.0916*(H-L)] + C

    L1 = C – [0.0916*(H-L)]

    L2 = C – [0.183*(H-L)]

    L3 = C – [0.275*(H-L)]

    L4 = C – [0.55*(H-L)]

    • Hanan says:

      We’ve just gotten word from our strategy coders and they’ve said that unfortunately this cannot be coded on algoZ.

      • Anshuman Sharma says:

        Hanan
        kindly code this
        BUY When-
        CLOSE C – (0.275*(H-L)

        WHERE C, H, and L are PREVIOUS DAY CLOSE, HIGH AND LOW RESPECTIVELY.
        I tried using DHIGH(2) for the previous day high but keeps giving error in code

  256. tvsreelatha says:

    pl help me to code

    1)buy when ema 5 cross ema 14 and move up and

    when directional index (ADX) 30 above and RSI above 59

    2))exit when price goes up and reach value equal to (plus of) muliple 4 of true range or minus of multiple 2 of true range or rsi reach 80 or adx reach 20 or ema 5 cross ema 14 and goes down

    3) 1)sell when ema 5 cross ema 14 and move down and

    when directional index (ADX) 30 above and RSI below 41

    4) )exit when price goes down and reach value equal to ( minus of) multiple 4 of true range or plus of multiple 2 of true range or rsi reach 20 or adx reach 20 or ema 5 cross ema 14 and goes up

    • Hanan says:

      We’ve just managed to get some answers from our strategy coders so here they are:

      1. EMA, ADX, RSI:
      Buy:
      (Ema(close, 5) > Ema(Close, 14)) and (Ref(Ema(Close, 5)), 1) > (Ref(Ema(Close, 14)), 1) and (ADX(14) > 30) and (RSI(Close, 14) >59)

      Exit:
      TR = Current High less the current Low – please relate this and define your logic.
      Modify the code of rsi, adx and ema for rest of your logic.

      You would have to use the Nest Pulse guide to get more detailed instructions on coding your strategy.

  257. Saurabbh says:

    Hi,

    Can you tell me the code for Buying when Full Stochastic (15,5,5) %k >%D and MACD (12,26,9)> MACD Signal.

    I tried using this(SOPK(15, 5, 5, SIMPLE) > SOPD(15, 5, 5, SIMPLE) and (MACDSignal(12, 26, 9, EXPONENTIAL)) > (MACD(12, 26, 9, EXPONENTIAL)))

    But it did not work and similarly for sell (SOPK(15, 5, 5, SIMPLE) < SOPD(15, 5, 5, SIMPLE) and (MACDSignal(12, 26, 9, EXPONENTIAL)) < (MACD(12, 26, 9, EXPONENTIAL)))

    • ((SOPK(15, 5, 5, SIMPLE)) > (SOPD(15, 5, 5, SIMPLE))) and (MACDSignal(12, 26, 9, EXPONENTIAL) > MACD(12, 26, 9, EXPONENTIAL))

      Please reverse the code for sell, please send the screenshot if generates errors.

  258. D.omprakash says:

    Hi Nitin I have commented twice to you about zerodha q not working. But no reply from u and u r customer care told me that problem resolved but as of now not yet. Even the site is not getting opened. REally frustrating for me. My ticket no #443569. KIndly resolve this issue….

  259. saranya says:

    hi Nitin,

    There is a strategy which works superbly in 1 min Chart. It would be grateful if I can get the code.

    Stochastic momentum Index :

    Default Values:

    %K periods=13
    %K smooth=25
    %K Dbl smooth=2
    %D periods=9
    MA type=Exponential
    %D MA type=Exponential

    Strategy:
    Buy: When %K cuts %D upwards
    Sell: Vice versa

    even if it is little bit difficult to code, it is really worth to spend time on this.

    Regards
    Saranya.

  260. sujay1803 says:

    Hi Nitin
    I need code for back testing in Pi one upon SLOW-stochastic and FIRST-Stochastic when %k goes up and crosses 35 I want buy to BUY and when %d come down and breach 79 i want to sell and vice versa
    another about
    CAMARILLA i will enter the OHLC of my desired stock for any time frame and i need camarilla for both backtesting aswell as exper advice
    Thanks in advance

  261. Prabhakar says:

    Is it possible to code strategy based on Heiken Ashi calculations, HAOpen, HAHigh, HALow and HAClose and their moving average?

  262. tirumal says:

    Hello.

    Nithin sir.

    i wanted to code wen close first candle on any time fram for example 5min
    first candle close at 6000 and second close above then its buy signel and if close below then sell
    and it reapet when ever crossing above and below the price

    thanx
    br
    tirumal

  263. praviny says:

    Dear Nitin,
    what would be the code to get the high of the first three bars of the day, note these should be the first three bars of the day starting at 9:15 only, not any previous three bars incase time has elasped.

  264. SiddharthG says:

    Hello Nithin,
    I want to be able to identify stocks based on the below criteria:
    1. EMA crossover: 5EMA > 10EMA > 20EMA
    2. 20-period Bollinger bands expansion where: current day’s(Upper band – Lower Band) > previous day’s(Upper band – Lower Band)
    3. 12-26-9 MACD Histoogram where: current MACD > 0 and previous MACD <= 0

    Also, I want only alerts to be generated, not actual trades.

    Can you please let me know how to do these?
    Thanks,
    Siddharth

  265. Dear Nitin,
    what would be the code to get the high of the first three bars of the day, note these should be the first three bars of the day starting at 9:15 only not the previous three bars for any given time frame.

  266. agsuresh says:

    Nithin,

    Where can I get a complete reference documentation of the Scripting language used?

    Are you using the same in the new platform ?

    There is a problem with the script entry form – The text boxes should be provided with Horizontal and vertical scrollbars (2) pressing “enter” button should actually go to the next line. Now it is doing something else.

    Hope you can take care of the above.

  267. agsuresh says:

    Hi Nithin,

    I tried coding a few strategy.

    Here is the code

    SET BLOW1 = BBB(CLOSE, 14, 2, SIMPLE)
    SET BLOW2 = BLOW1 * 0.15 / 100
    SET BLOW3 = BLOW2 * 1
    SET BLOW4 = BLOW1 – BLOW3
    SET M1 = MACD(13, 26, 9, SIMPLE)
    SET MS1= MACDSIGNAL(13, 26, 9, SIMPLE)

    (CLOSE MS1)
    AND RSI(CLOSE,14) <30)

    The problem is It just ignores the conditions 2nd and 3rd and executes the code on the first condition only ( in this case close MS1)
    AND CLOSE<=BLOW4
    AND RSI(CLOSE,14) ms1) ignoring the other 2

    what could be the issue and how can this resolved?

    suresh

  268. Guilherme says:

    Hello Mr. Nithin, How can I add to my strategy a code that is associate with the average volume of the first four candles, of the last five days??
    Like, BUY if the volume is above the (average of the first 04 candles) of the (last five days)??
    Thank you very much

  269. Satya Dani says:

    I WROTE MY STRATEGY AND DOING THE BACKTEST. WHILE DOING SO, THE NEST SYSTEM GOES DOWN AND IT HAPPENS AGAIN AND AGAIN. I AM ALSO WRITING DOWN MY ALGO TO MAKE SURE THERE IS NOTHING WRONG IN WRITING. ————BUY EXPRESSION———-CLOSE>SMA(CLOSE,20) AND
    (MAXOF(REF (HIGH, 4), REF (HIGH, 1))) CLOSE AND
    CLOSE<SMA(CLOSE,20)
    CROSSOVER ((SMA (SOPD (14, 3, 3, SIMPLE), 9)), (SOPD (14, 3, 3, SIMPLE)))————————PLEASE HELP….. SATYA

  270. santoshpadhy says:

    COULD YOU PLEASE POST HERE SOME SAMPLE CODES USING MACD HISTOGRAM–SO THAT I CAN USE IT IN MY STATERGY– I DID NOT GET ANY THING ON MACD HISTOGRAM CODING ANY WHERE. BASICALLY I WANT THE CODING FOR:

    AT THE CLOSE OF THE CURRENT MACD HISTOGRAM BAR, IF IT IS INCREASED/DECREASED BY CERTAIN % IN COMPARISION TO ITS PREVIOUS BAR.

  271. santoshpadhy says:

    can we code to get alert at certain angles of the upper or lower bolinger band. for example i want alerts at 45 degree of upper bolinger band——————if yes, then please give one sample codde.

  272. santoshpadhy says:

    HI

    CAN ANY BODY JUST REPLY ME QUICKLY ON THE FOLLOWING POINTS.

    1. IN THE SCRIPTING LANGUAGE USED IN PI , I THINK IT IS NOT CASE AND SPACE SESITIVE—IS IT TRUE?

    2. (crossover(EMA(CLOSE,3),EMA(CLOSE,5)) AND (crossover(EMA(CLOSE,5),EMA(CLOSE,3))————-IS THERE ANY LOGICAL DIFFERENCE BETWEEN THE TWO EXPRESSION AND IF YES—WHAT IS THAT?


    Thanks & Regards

    Santosh Padhy

  273. Ashish says:

    Hello Nithin, I have question based on following scenario which i have practically tested. After introducing the bracket order, trades are automatically getting (target)square off or stopped out (stop-loss) but signals are not getting generated properly. I have Buy and Sell expression in script but Buy Exit and Sell exit is 0. So once Buy alert is generated (Assuming I acted on it as Bracket order and that order completed with target Sell) on next script is waiting to generate the ONLY Sell signal and so on . In short ideally, If script sees consecutive BUY or SELL signals, it should be acted upon.

  274. currencyandnifty.com says:

    Buy EITHER when price and small ema 25,OR ema,2,and ema,25 (both) make a crossover above 200 sma
    Sell EITHER when price and small ema,25 OR ema2,and ema,25(both) make a crossover below 200 sma.
    Pls code this 4 me………..

  • currencyandnifty.com says:

    How can we code the following ,PLS GIVE ME CORRECT CODE.
    BUY WHEN PRICE OR EMA 2 AND EMA,25 (both).CROSSOVER SMA 200
    SELL WHEN PRICE OR EMA 2 AND EMA 25(both) CROSSOVER SMA200–The question is sometimes the EMA ,25 make a crossover above 200 sma,the price and 5EMA will be below 200SMA and viceversa,pls clarify.

  • RAJESH J says:

    Hallo Nithin

    For NEST PULSE ALGOS CODE SMA EMA MACD STOCHASTICE INDICATORS
    ON CROSS OVER BUY SELL SIGNAL IMMEDIATE CANDILE WITH OUT ON CANDLE COMLPETION How To Convert

  • RAJESH J says:

    Hallo Nithin How To Convert This Stochastics

    periods = Param( “Periods”, 10, 1, 200, 1 );

    Ksmooth = Param( “%K avg”, 3, 1, 200, 1 );

    Dsmooth = Param( “%D avg”, 3, 1, 200, 1 );

    Ks = StochK( periods , Ksmooth);

    KsDs = StochD( periods , Ksmooth, DSmooth );

    Buy = Cross(Ks,KsDs);

    Sell = Cross(KsDs,Ks);

    Short = Sell;
    Cover = Buy;

    For NEST PULSE ALGOS CODE
    ON CROSS OVER IMMEDIATE CANDILE WITH OUT ON CANDLE COMLPETION

    • periods = Param( “Periods”, 10, 1, 200, 1 );

      Ksmooth = Param( “%K avg”, 3, 1, 200, 1 );

      Dsmooth = Param( “%D avg”, 3, 1, 200, 1 );

      Ks = StochK( periods , Ksmooth);

      KsDs = StochD( periods , Ksmooth, DSmooth );

      Buy = Cross(Ks,KsDs);

      Sell = Cross(KsDs,Ks);

      Short = Sell;
      Cover = Buy;

      For NEST PULSE ALGOS CODE
      ON CROSS OVER IMMEDIATE CANDILE WITH OUT ON CANDLE COMLPETION

  • Satya Dani says:

    I have BB(2 SD) , MACD (26,12,9), SSTO(14,3) formula. I need to code the following idea into AlgoZ. Please guide.

    BB(2 SD) , MACD (26,12,9), SSTO(14,3) formula

    BUY ALERT:
    if Lower BB(CLOSE,50) > any CLOSE in last 9 periods
    AND MACD(26,12,9) histogram > 0
    AND D%*1.05CLOSE
    OR D%*1.05>K%
    OR MACD(26,12,9) histogram < 0

    • Few logics need more information:

      BB(2 SD)
      SSTO

      (BBB(CLOSE, 20, 2, EXPONENTIAL) > Close)
      Considered current close/ ltp.

      MACD Histogram: (((MACD(12, 26, 9, SIMPLE)) – (MACDSignal(12, 26, 9, SIMPLE))) > 0)

      (SOPK(9, 3, 9, SIMPLE) > ((SOPD(9, 3, 9, SIMPLE)) * 1.05))

      D%*1.05CLOSE – Modified this a bit
      (SOPK(9, 3, 9, SIMPLE) < ((SOPD(9, 3, 9, SIMPLE)) * 1.05)) MACD Histogram: (((MACD(12, 26, 9, SIMPLE)) – (MACDSignal(12, 26, 9, SIMPLE))) < 0) Please use AND, OR to club indicators.

      • Satya Dani says:

        Thank you Mr. Nithin for reply.

        I want to calculate BB(with 2 standard deviations) and Slow Stoch with 14 periods and smoothing of 3 periods. My idea is when BBB gets penetrated in any of the preceding 9 periods (can be modified a bit) and then when MACD histogram gets above zero, a buy signal shall be generated. For sell signal it will be the opposite.

        • Satya Dani says:

          Mr. Nithin;
          While back testing above Algoz,I am getting “undefined function” error. In second Algo with Ref function, I am getting “Argument of function “REF” not optional” error. How can I address this??

      • Satya Dani says:

        Mr. Nithin,

        I have applied the formula in the engine to run. I have encountered an issue of invalid “REF” argument, I am re-writing the formula for your review. —— buy alert —BBB(CLOSE,50,2,SIMPLE)*0.98>CLOSE AND (((MACD(12,26,9,SIMPLE))-(MACDSIGNAL(12,26,9,SIMPLE))>0 AND SOPK(14,3,4,SIMPLE)>SOPD(14,3,4,SIMPLE) AND REF(SOPK(14,3,4,SIMPLE),2)>30 —–Sell Exit —–CLOSE*0.98>BBT(CLOSE,50,2,SIMPLE) OR CLOSE<SMA(CLOSE,50) AND SOPK(14,3,4,SIMPLE)REF(SOPD(14,3,4,SIMPLE),2) AND SOPD(14,3,4,SIMPLE)<70 ———-buy exit and sell alert will be "0"——– please guide.

  • APM says:

    Dear Nitin

    I am using PSAR. Once the PSAR signal is there, it should check next 5 candles and if the close is max of the 5 candles after PSAR signals , it should give a buy signal. Please help me to write the code

  • J.R.Julius says:

    @Nitin Ji,
    Thank You.

  • J.R.Julius says:

    My previous Messages having type err
    If possible please give me the coding to backtest this

    BUY Rule : 1 Point > Highest Price of Last 20 Candles
    SELL Rule : 1 Point < Lowest Price of Last 20 Candles
    Buy Exit : 1 Point Highest Price of Last 10 candles

  • Aquif says:

    Already saw the Video of Pi. Eagerly waiting for same. However about the current issue, I do have snapshot of Tata Motors where is largest loss is shown as 7757.7. And if you examine the backtest results, latest long signal is given on 6th Sep (Saturday) at 8306.2. I can share the same if needed.

  • Aquif says:

    Hello Nithin, Am facing problems with backtesting of my Strategies. It gives pretty inaccurate results more probably because it considers closing/opening value of the Stock/ Futures as 0. I often get results where in largest Profit/Loss in Nifty is 8000+ which we know is not possible. I tried applying different strategies and on different stocks. But the results are same not always but more then often. This is making me wonder about the accuracy of the backtest results. Is it technical error only on my end or is known issue with Nest Trader? How accurate are the backtest results as per your knowledge?

  • J.R.Julius says:

    BUY Rule : Close > Highest Price of Last 20 Candles
    SELL Rule : Close < Lowest Price of Last 20 Candles
    Buy Exit : Close < Lowest Price of Last 10 candles
    Sell Exit : Close < Highest Price of Last 10 candles

    If possible Provide Script for this conditions.

    Thanks in Advance.

  • J.R.Julius says:

    Sir, Can I get code to backtest donchian channel/Turtle system?
    BUY Rule : Close > Highest Price of Last 20 Candles
    SELL Rule : Close < Lowest Price of Last 20 Candles
    Buy Exit : Close Highest Price of Last 10 candles

  • mani says:

    Dear Sir can U Suggest Low Whipsaw Positional Stragedy?

  • RAJESH J says:

    Hello Nithin Sir _ZigZag

    BUY
    PivotLow = Ref(IIf(Ref(ROC(ZZ,1),-1) 0, 1, Null),1);

    SELL
    PivotHigh = Ref(IIf(Ref(ROC(ZZ,1),-1) > 0 AND ROC(ZZ,1) < 0, 1, Null),1);

    How To code my strategy:

  • Deepak says:

    Hello Nithin,What is the code for creating a backtesting based on RSI,Suppose for Reliance I want to do backtesting based on RSI such that It should give buy signal when RSI is less than 30 and Sell Signal when RSI is >70. Can you please suggest me the coding for this strategy

  • DM0121 says:

    Please Help to code my strategy:
    Buy Signal:
    Condition 1: Previous Candle Close > 34 Ema
    Condition 2: Previous Candle Close > PSAR
    Condition 3: Initiate buy 2 points higher than highest high of last 7 candles

    Buy Exit Signal : MACD (12,9,26) Negative crossover at close (Avg Period 12 EMA, Short Period 9 EMA, Long Period 26 EMA)

    For Sale: Exact opposite of buy

  • m.rajendra says:

    Hi Coding team,

    Could you please help me out to code the below?
    Thank you in advance.

    Rajendra
    Zerodha Client

    Generate sell signal if all the below conditions are met.

    1. When RSI (14) is at 80
    2. When 15 min candle is above top bollinger band (20,2) EMA
    3. When Fast MACD line is far above the slow/Signal MACD line (26,12,9)

    • m.rajendra says:

      Hi Nithin/Coding team

      Could you please help me out to code the below?
      Thank you in advance.

      Rajendra
      Zerodha Client

      Generate sell signal if all the below conditions are met.

      1. When RSI (14) is at 80
      2. When 15 min candle is above top bollinger band (20,2) EMA
      3. When Fast MACD line is far above the slow/Signal MACD line (26,12,9)

      Exit Sell

      1. When RSI (14) is at 75
      2. When 15 min candle is below top bollinger band (20,2) EMA

  • Guilherme says:

    Hello Nithin, I need a strategy that don’t buy if the target is beyond the max of the day, like I have a target of 100 points but i avoid the entrance if the maximum of the day is less than 100 points of the entrance, at 5 minutes.

    • You have to be a little more clear about this, Can you clearly define when you want to enter and when you want to exit?

      • Guilherme says:

        Sure Nithin sorry about that. I already have a strategy… and I just need only to add in my strategy a condition to prevent entry if the target is above the high of the day (IF BUY) or below the minimum of the day (IF SELL). My strategy is at 5 minutes candles.

        • Guilherme says:

          HighestHighValue(Periods). HHV(Periods)
          HIGH = HHV(21)
          LOW = LLV(21)
          How can I change the 21 periods to all the periods of the intraday 5 minutes candle?

          • HHV:

            ((MAXOF(REF(HIGH, 2), REF(HIGH, 3))) > CLOSE)

            To find out hhv or llv, Maxof and Minof can be used. To consider the candles, use Ref 1, ref 2 and so on ……

            · How can I change the 21: Ref 1 … Ref 21 needs to be used, current candle will be ignored.

  • tvsreelatha says:

    tv sreelatha rs 3414

    helo sir,

    i wish to have if you develop a algo base system based on the following details,

    1) period (variable)

    2) when the 5 EMA line goes up a certain value (variable, which i must be able to change) units from the crossing of 5 and 14 ema, BUY immediately AND EXIT AT THE END OF THE PERIOD.)(close of the candle)

    3) when the 5 EMA line goes down a certain value (variable)from the crossing of 5 and 14 EMA line, SELL immediately AND EXIT AT THE END OF THE PERIOD.(close of the candle)

  • Devendra says:

    Dear Nithin,

    I use EMA 15 and EMA 25.

    I have written Strategy 1/ Script 1 as follows :
    Buy Expression : CROSSOVER(EMA(CLOSE, 15), EMA(CLOSE, 25))
    Sell Expression : CROSSOVER(EMA(CLOSE, 25), EMA(CLOSE, 15))

    Strategy 2 / Script 2 is as follows :
    Buy Expression : EMA(CLOSE,15) > EMA(CLOSE,25)
    Sell Expression : EMA(CLOSE,15) < EMA(CLOSE,25)

    I was surprised to see both giving different results
    when backetsted (on any Symbol / Instrument).

    IF Both Code means same and are correct
    why it gives different results ?

    Pl. Help

    Thanks in Advance

    ———————————-
    Also suggest Buy and Sell Expression
    for following :

    Buy When Green Candle Breaks / Crosses EMA 20 and PSAR is below EMA20
    Sell When Red Candle Breaks / Crosses EMA 20 and PSAR is above EMA20

    Thanks in Advance

    • 1. Both shoul work in the same way. Can you send an email to [email protected], he will try reinstalling the pulse dll.

      2. Buy When Green Candle Breaks / Crosses EMA 20 and PSAR is below EMA20
      Sell When Red Candle Breaks / Crosses EMA 20 and PSAR is above EMA20

      – (Close > open) and (close > ema(Close, 20)) and (Ema(close, 20) > (PSAR(CLOSE, 0.02, 0.2)))

      – (Close < open) and (close > ema(Close, 20)) and (Ema(close, 20) < (PSAR(CLOSE, 0.02, 0.2)))

  • Kamlesh B. Lokhande says:

    Dear Zerodha / Nithin,
    I have recently opened account with zerodha.
    ID : RK0827
    Can u pl. add SuperTrend Indicator ?
    How can I save Layout in ZTrader.

  • GOPI says:

    i have idea
    in zerodha ADX IN 15 MIN AND AVERAGE PERIOD IS 1 THEN HOW TO PLACE BUY NAD SELL IN ALGOZ

  • m.rajendra says:

    Can someone please share successfull back tested strategies for Equity day trading?

  • m.rajendra says:

    ok thanks Nithin

  • m.rajendra says:

    Hi,

    Is it possible to write a code in Nest pulse to check if there is any stock/s trading above 200 dma?

    Regards
    Rajendra

    • There are no scanners presently on NEST

      • buchi says:

        You are doin a nice work.thanks.please can you help me code this:
        CCi(20,close) crosses above zero line,open buy and when cci(14,close) crosses below zero line,open sell.
        when cci(20,typical price) crosses above zero line,close sell.when cci(20,typical price) opens below zero line,close buy.

  • Sibi Chakravarthy says:

    Hi Nithin,
    Sorry for the long read. Please read carefully 🙂
    My algo is like this..

    Buy:some expression
    Buy exit:0
    Sell:some expression
    Sell exit:0

    So the algo generates alternate buy and sell signals

    alone.

    Once a buy signal occurs, and pressing “act on call”,
    a buy order would be placed right.

    After some time, a sell signal occurs.
    Now, as per algo logic, two sell orders should be

    placed.
    1)A sell order which closes the current position.
    2)A second sell order to initiate a short position.

    Here are my questions:
    1)Will two such sell orders be placed if I take my

    algo live?
    2)On backtesting, I get results mentioning total no.

    of trades etc etc…does this include the 2 orders

    being placed for every successive signal/call?

  • radhey says:

    if specific candle pattern is not possible right now , pls code rest of strategy of mine…………ma crossover + stch+ rsi+ camrilla

  • radhey says:

    dear sir,
    I DONT KNOW CODING OF MY STRATEGY IS POSSIBLE OR NOT……….IF POSSIBLE
    pls code my strategy which IS giveN below :

    BUY : – crossover 2 sma and 5 tma((5 days trigular or pivot point average) + rsi line crossed 2nd time 30 toword upside + stoc above 20 line (on 2nd time crossing toward upside just like “hook’ upward) + special candlesticks pattern (higher closing to high of doji , hammer candle OR two bar reversal OR 50 % retracement of benchmark candle ) and…+ L3 OR R4 ……..[addING …ADVANCE CAMARILLA LEVEL ALSO……AS SUPPORT AND RESISTANT RATHER THAN PIVOT POINTS] + INCREASED VOLUME ALSO (IT SHD B ABOVE AVE OF LAST 8 PERIOD OF GIVEN TIME )

    SELL :- JUST VICE VERSA
    crossover 2 sma and 5 tma((5 days trigular or pivot point average) + rsi line BELOW 70 toword DOWNside + stoc BELOW 80 line (on 2nd time crossing toward DOWNside just like “hook’ DOWNward) + special candlesticks pattern (LOWER closing to LOW of doji , hammer candle OR two bar reversal OR 50 % retracement of benchmark candle ) and…+ R3 OR L4 ……..[addING …ADVANCE CAMARILLA LEVEL ALSO……AS SUPPORT AND RESISTANT RATHER THAN PIVOT POINTS] + INCREASED VOLUME ALSO (IT SHD B ABOVE AVE OF LAST 8 PERIOD OF GIVEN TIME )

    I WOULD B VERY OBLIGED TO U IF ABOVE MENTIONED STRATEGY CONVERTED INTO CODES

    THANKS

    YOURS FAITHFULLY

    RADHEY

    • Don’t think it is possible in the way u have written, will need a lot more specifics for this. What I’d suggest is to run through basic codes and examples in this page, and then give it a shot yourself. If you are having trouble then, you can post your queries here.

  • m.rajendra says:

    Nithin,

    Error message is “BackTest Script Error:Error:Scripts generated no trades” and it occurs when I backtested.

  • m.rajendra says:

    Hi Nithin,

    Could you please code the below strategy?
    Please let me know in case of additional information is required.
    Thank you in advance.

    Buy strategy

    When RSI (14) is at 28 coming from lower levels and candle rising from lower levels of the bottom bollinger band (20,2)

    Buy exit

    When the RSI (14) is at 33 and close of the candle at above the bottom bollinger band (20,2)

    Regards
    Rajendra

  • newbie says:

    dear Nithin, kindly help me with this to put in algoz :- UPTREND RULES:
    Stochastic %D (14,3) > 50

    RSI (7) > 50

    MACD > Zero Line > Signal Line (9 period)

    DOWNTREND RULES:
    Stochastic D (14, 3) < 50

    RSI (7) < 50

    MACD < Zero Line < Signal Line (9 period)
    Also if u can suggest a great for buy exit and sell exit

    and when going live there is an option call stoploss in % , the stoploss % is suppose buy stock of rs 545 and keep stop of 1% then the stop loss will get triggered at 539.60? irrespective of the quantity i have bought? or stop loss is based on 1 % total value of holdings?

    • newbie says:

      sorry typing errors correction -this simple strategy can u code for me, I am also zerodha client
      BUY-when RSI(14) goes below 30 and rises above 35 then buy with stoploss of RSI(14) 60
      SELL-when RSI(14) goes above 70 and then comes to 65
      SELL STOPLOSS- RSI(14)>75
      SELL EXIT-RSI(14)<40

  • praneet says:

    hi,
    I have a strategy ready with me. What do I put in my code so that NEST plugin catches my buy/sell and short/cover orders and how do i put it in my code?

  • Manas says:

    Can u please forward my mail to stratagy coder of your team:

    I have 2 strategies, both are very simple but as a novoice, I can’t code it:

    1) Based on 5SMA System:

    SAR = Mean value of Previous 4 Days Close

    Buy if 5 Min Candle Close Price goes above SAR value from below (Entry with 5 Lots)

    Sell if 5 Min Candle Close Price goes Below SAR Value from above (Entry with 5 Lots)

    Target : 50 Points from SAR value (for 2 Lots)
    75 Points from SAR value (for 1 Lot)
    100 Points from SAR value (for 1 Lot)
    Till Sell Signal Arise (Fore 1 Lot)

    SL @ 25 Points from SAR Value in Opposite direction

    2) Based on 3 day High Low Strategy (Breakout Strategy)

    Buy if 5 Min Candle Close Price goes above High of Previous 3 Days, SL @ Lowest of the low of 2 Days

    Sell if 5 Min Candle Close Price goes below low of Previous 3 Days, SL @ Highestt of the High of 2 Days

    Targets: 50 Points from Entry

  • rohits8829 says:

    Hi Nitin,
    Saw ur video on young turks..which brought me to this website.. theres some awesome stuff on ur website..I am a active trader can you tell us few algos that gives consistent results?

    • Thanks Rohit, hmm.. presently we are just helping people code if there is any strategy, we are soon launching an initiative that will also including sharing backtested strategies.

  • Pradip says:

    Hi Nithin,
    great effort by you and your team.
    want to code a strategy for bollinger bands volatility breakout in conjunction with MACD Crossover.

    Settings:
    Bollinger Bands : 20, 2
    MACD : 12, 26,9 EMA period

    The upper band and lower band tighten around the price.

    When the bands expand and break up on the upper band with MACD signal line crossing up then BUY.

    Similarly when the bands breakdown on the lower band with MACD signal line crossing below then Sell.

    Stop Loss : low of the previous candle.

    Exit : when the price falls when long and rises when short by 5 points of the last close.

    Thanks.

    • (CLOSE > BBT(CLOSE, 20, 2, EXPONENTIAL))

      (CLOSE > BBB(CLOSE, 20, 2, EXPONENTIAL))

      (MACDSignal(13, 26, 9, EXPONENTIAL))

      (MACD(13, 26, 9, EXPONENTIAL))

      The upper band and lower band tighten around the price.

      · Please define this more.

      Buy:

      (BBT(CLOSE, 20, 2, EXPONENTIAL)) > (BBB(CLOSE, 20, 2, EXPONENTIAL)) and (MACDSignal(13, 26, 9, EXPONENTIAL)) > (MACD(13, 26, 9, EXPONENTIAL))

      Sell:

      (BBT(CLOSE, 20, 2, EXPONENTIAL)) < (BBB(CLOSE, 20, 2, EXPONENTIAL)) and (MACDSignal(13, 26, 9, EXPONENTIAL)) < (MACD(13, 26, 9, EXPONENTIAL)) Sl: (Close = Ref(Low, 1)) Exit: (Close + 5) > (Ref(Close, 1))

      · The stop loss cannot be exactly define in expression window, instead, cover order can be used when going live.

      · Sell logic is not clear to code. Please elaborate more.

  • sruthi says:

    hi sir,
    how to fully automate my trades and what are the required approvals ?

  • ksjoseph says:

    Hello Nithin,

    Would like to know how to set up the Greek Market Watch settings in Nest Trader?

    • Hanan says:

      The Market Watch Greek settings can be setup by the following method:
      1. Press Ctrl + P and go to Preferences > Market Watch. Select the tick box which says “Greeks in Market Watch”
      2. Right click on any Option scrip and choose Option Greeks > Make Greek Settings.
      3. Set it up and choose Reflect to All.

      This works inconsistently and I’d rather you use the Option Calculator to calculate Greeks.

  • nath says:

    Hi.

    There is something terribly wrong with the backtesting engine.
    I have the following rule for buy

    set T = close-open
    set solid = if(T>0,T,-T)
    set shadow = high – low
    set color = if(T>0,1,-1)
    shadow>5*solid AND REf(color,1)=-1 AND REF(SOLID,1)>3*SOLID AND RSI(CLOSE,9)50

    Please suggest some solution urgently as it is impossible to trade based on such faulty system.

  • nath says:

    Hi,
    For backtesting purpose , I am not sure when exactly the buy signal gets triggered based on a condition.
    to elaborate lets say I have a strategy buy when ‘close>open’. This signal will be true at any day end. So will the buy signal come at next day’s open.

    I ask this becoz I can see a backtest result where long positions are being made at close price of a day

    on the same line,

    lets say I have a strategy where I buy if previous day is doji, the day before that is not a doji and a red bar

    set T = close-open
    set solid = if(T>0,T,-T)
    set shadow = high – low
    set color = if(T>0,1,-1)
    shadow>5*solid AND REf(color,1)=-1 AND REF(SOLID,1)>3*SOLID

    Does the code above serves the purpose?

  • Guilherme says:

    Hello Nithin,
    I know that my question will be general, but which strategy in your opnion are good for DAYTRADE, and which are the best signs for entree and exit.

  • Charles says:

    Hi, When i write a code having 2 conditions, trade gets executed only by the 1st condition.
    Eg. Buy : Crossover (SMA(Close,5),(Close,20)) AND Crossover (SOPK(14,3,3),SOPD(14,3,3))

    Backtest results show trade done only for the 1st condition. whatever code i use for the 2nd part, it just gets ignored.

    Plz help. I simply need SMA Crossover with Stochastic confirmations. Thanks

  • ksjoseph says:

    Hello Nithin,

    Just one query..Why can’t Zerodha provide simulated trading for Equity/ Futures & Options. This facility is not provided by none of the broking firms in India, but its provided by most of the foreign broking firms. I would like to bring to your notice to introduce this facility so that it will be of great use for all the traders both beginners and experts to practice their trading skills in real time markets. This will enable them to learn from their errs and thus leading them to professional traders.Even though the NSE has come up with NSE pathshala with its simulated environment but its has a junk of errs which i don’t recommend to anybody at all. Just would love to get an ans from Nithin.

  • sohil says:

    Is it possible to code this one?
    Enter Long when 3 EMA goes above 15 High EMA
    Enter Short when 3 EMA goes below 15 low EMA

  • sohil says:

    LONG RULE: CANDLE CLOSING BASIS 12 EMA SHOULD CROSSOVER ABOVE 34 EMA, RSI > 50, STOCHA > 50
    SHORT RULE: CANDLE CLOSING BASIS 12 EMA SHOULD CROSSOVER BELOW 34 EMA, RSI < 50, STOCHA < 50

    • Long:

      (Ema(Close, 12)) > (Ema(Close, 34)) and ((RSI(Close, 14)) > (50))

      Short: (Ema(Close, 12)) < (Ema(Close, 34)) and ((RSI(Close, 14)) < (50)) Stochastic Oscillator: to the above you can use an "AND" to add SOPK(9, 3, 9, SIMPLE) > 80 OR SOPD(9, 3, 9, SIMPLE) > 80

  • Hi, how do I code for the following strategy for Bank Nifty? (or for that matter Nifty or any equity / future)

    – Buy if it crosses high of the previous day.
    – Sell if it goes below low of the previous day.
    – Assume an average range of 2% daily, have a stop loss of 0.16*2% around 40 points for both buy and sell.
    – Target of 150 points for intra day for square off or at stop loss or at rate at closing for the day.

  • chintamani says:

    Hi

    Range charts are very popular in the west.
    We do not seem to be focussing on it.
    Request you to put some views on the same for the benefit of all from the point of coding and testing and other benefits if any in comparison to other chart types.
    Can we code our strategies here in range ?
    Thanks
    Chintamani

  • rajesh says:

    Hi Nithin,

    I am trying to code this strategy, but i don’t know what part of it is wrong. Can you please find the mistake,
    It is for Bullish markets:-
    Buy- The price must be greater than 50 EMA, new crossover of 3 EMA over 5 EMA.
    Buy Exit- Crossover of 3 EMA under 5 EMA.

    Code:-
    Buy-CLOSE>EMA(Close,50) AND CROSSOVER(EMA(CLOSE, 3),EMA(CLOSE, 5))
    Buy Exit-CROSSOVER(EMA(CLOSE, 5), EMA(CLOSE, 3))
    Sell-0
    Sell Exit-0

    Thanks

  • Saeed Rahman says:

    Hello Nithin,
    I have developed strategies as Expert Advisors in MT4(meta trader) for forex markets .Will zerodha in the future support multiple terminals like other international brokers provide and if so will you consider metatrader 4. Zerodha’s platform is great when compared with other Indian terminals, but I am not getting the flexibility as I get in MT4.

  • Shiva Kumar says:

    hi nitin

    could you program my strategy

    Buy=EMA(C,13)>EMA(EMA(C,13),9) AND Cross (C,Peak(C,2,1));

  • Ramickey says:

    BuyHi Could you help me code this strategy for intra stock trade?
    1) 5 Min EMA slopes upwards
    2) MACD gives a bullish crossover
    3) 5 EMA should be abve 20 EMA line
    4) 5 min candle closes above 20 EMA line
    5) Stochastics between 20 and 80 [%K Period 5, %K Slowing 3, %D Period 3]
    6) Stochastics %K Crosses above %D
    7) Target 20 points, SL 10 points , TSL 10 points
    8) Close Trade if Stochastics %K Crosses below %D

    Sell
    1) 5 Min EMA slopes downwards
    2) MACD gives a bearish crossover
    3) 5 EMA should be below 20 EMA line
    4) 5 min candle closes below 20 EMA line
    5) Stochastics between 20 and 80 [%K Period 5, %K Slowing 3, %D Period 3]
    6) Stochastics %K Crosses below %D
    7) Target 20 points, SL 10 points , TSL 10 points
    8) Close Trade if Stochastics %K Crosses above %D

    • Can you define what is slopes upwards/downwards? can you also tell how many candle MACD?

      • Ramickey says:

        all 5 minute candles.

        I don’t have the technical knowledge to explain slope. What I meant was if the slope is +ve it is upwards and -ve for downwards.
        If my query is still not clear, then modify it such that 5 min candle > 20 min EMA instead of Slope upward
        And where i mentioned downward, put 5 min EMA<20 min EMA

        • Buy:

          1) 5 Min EMA slopes upwards

          (Trend(Ema(close, 14))) = up

          2) MACD gives a bullish crossover

          ((Trend(MACDSignal(13, 26, 9, SIMPLE))) = up) and ((Trend(MACD(13, 26, 9, SIMPLE))) = Up)

          3) 5 EMA should be abve 20 EMA line

          Ema(close, 5) > Ema(Close, 20)

          4) 5 min candle closes above 20 EMA line

          Close > Ema(Close, 20)

          5) Stochastics between 20 and 80 [%K Period 5, %K Slowing 3, %D Period 3]

          SOPK(9, 3, 9, SIMPLE) > 80 OR SOPD(9, 3, 9, SIMPLE) > 80

          – Please modify accordingly.

          6) Stochastics %K Crosses above %D

          (SOPK(9, 3, 9, SIMPLE)) > (SOPD(9, 3, 9, SIMPLE))

          7) Target 20 points, SL 10 points , TSL 10 points

          – Please check If you have bracket order feature.

          8) Close Trade if Stochastics %K Crosses below %D

          (SOPK(9, 3, 9, SIMPLE)) < (SOPD(9, 3, 9, SIMPLE)) Sell: Please modify the above one based on the sell logic. Backtest and analyze before going live

  • Ramickey says:

    I want a code for Trading NF in BO
    Buy
    1) 5 Min EMA slopes upwards
    2) MACD gives a bullish crossover
    3) 5 EMA should be abve 20 EMA line
    4) 5 min candle closes above 20 EMA line
    5) Stochastics between 20 and 80 [%K Period 5, %K Slowing 3, %D Period 3]
    6) Stochastics %K Crosses above %D
    7) Target 20 points, SL 10 points , TSL 10 points
    8) Close Trade if Stochastics %K Crosses below %D

    Sell
    1) 5 Min EMA slopes downwards
    2) MACD gives a bearish crossover
    3) 5 EMA should be below 20 EMA line
    4) 5 min candle closes below 20 EMA line
    5) Stochastics between 20 and 80 [%K Period 5, %K Slowing 3, %D Period 3]
    6) Stochastics %K Crosses below %D
    7) Target 20 points, SL 10 points , TSL 10 points
    8) Close Trade if Stochastics %K Crosses above %D

  • Ramickey says:

    Can we use algoZ for trading NF in Bracket order?

  • radhey says:

    I m desirous to code my strategy……how to do that pls help

  • David says:

    I understand pivot as the center point, for coding pivot high is: the previous candle(n-1) is higher than the present candle(n) then we check if (n-2)candle is higher than (n-1)candle, likewise we keep on checking until we get a condition where the (n-3) is higher than (n-4) candle then the high of the n-3 candles high is considered as our pivot high.

  • chirag007 says:

    can you publish function signature of all the indicators available in algoz?

  • David says:

    Hi Nithin,

    How should I write the code to generate a buy signal when previous pivot high is taken out by present price.(not previous candle, I want for previous pivot high).

  • kars says:

    Hello Zerodha,

    I have problems with the backtesting. My buy expression and buy exit expression both have two conditions.
    When backtesting I see only the first condition is satisfied in the triggered orders.

    My Buy expression is:

    SET SMA25 = SMA(CLOSE, 25)
    SET SMA50 = SMA(CLOSE, 50)

    SET C1 = CLOSE > SMA25
    SET C2 = SMA25 < SMA50

    C1 AND C2

    My Buy-Exit expression is:

    SET SMA25 = SMA(CLOSE, 25)
    SET SMA50 = SMA(CLOSE, 50)

    SET C1 = CLOSE SMA50
    C1 AND C2

    If I interchange the conditions (i.e. C2 AND C1) then only C2 is satisfied in the resulted orders.

    I tried with other conditions (OR, XOR). The second condition is not at all used.

    Is the backtesting broken? I have not tested in LIVE. Will LIVE also have the same problems?

    BTW; I am running ZT 3.11 and Nest plugin 2.8.

    Thanks,
    Kars.

    • kars says:

      Correction:

      My Buy expression is:

      SET SMA25 = SMA(CLOSE, 25)
      SET SMA50 = SMA(CLOSE, 50)

      SET C1 = CLOSE > SMA50
      SET C2 = SMA25 < SMA50

      C1 AND C2

      My Buy-Exit expression is:

      SET SMA25 = SMA(CLOSE, 25)
      SET SMA50 = SMA(CLOSE, 50)

      SET C1 = CLOSE SMA50
      C1 AND C2

    • kars says:

      CRAP!!!

      I removed zt and nest-plus installs completly. Then installed only the 3.11 zerodha trader and not the plugin. Now the backtest is fine.

      If the backtest had time limits, square off at 3.20, and if it tested both shorting and buy exiting at the same candle, I will be really, really happy.

      The software we (retail traders) got stuck with in india seems to be deliberately designed to play psychological games and push us to lose money. 🙁 Good thing is, with Zerodha, we are getting much better… 🙂

      Thanks,
      Kars.

      • subhojit says:

        Hi,
        I am also facing similar issues with backtesting. It is omitting certain conditions.
        I read your suggestions and need some clarification.

        If i uninstall both ZT and the Nest Pulse plugin and the reinstall ZT will I get the plugin options . If not , then how will we write the strategies.

  • ksjoseph says:

    Thank You Nithin will do so.

  • ksjoseph says:

    Hello Nithin,

    Do you help coding for the Amibroker? In that case i have some idea which need to be coded.

    With Regards,
    K.S.Joseph.
    94972-82865

  • Rohit says:

    Hi Nitin,
    Can we code this thing for Buy condition.

    Buy if cloe is > Close at 9:45am

    i will be very greatful if i can get the code for this.

    thanking u in advance.

  • ksjoseph says:

    Hello Nithin,

    I have been using your NestTrader trading platform for over 3 months. Since I’m not able to open 3 ID’s live account at the same time in the NestTrader only one of the account i open through your Z5 web trading portal. While using the Z5 i have noticed the following big errors which i would kindly like to share with you all.

    1. Live spot rate of Nifty and Sensex are totally incorrect.
    2. Not able to save the Market Watch Settings.
    3. A facility should be added to increase the font size of the market watch. Right now the alphabets are very small which keep strain on the eyes.

    I hope you will look to the above issue and get it solved at the earliest.

    Thanking You,

    With Regards,

    K.S.Joseph
    94972-82865.

  • Akshay says:

    Varun

    Try this:

    BUY:rsi(close,14)>80 AND (MACD(13, 26, 9,EXPONENTIAL) > MACDSignal(13,26, 9, EXPONENTIAL))
    Buy exit alert : (MACD(13, 26, 9,EXPONENTIAL) < MACDSignal(13,26, 9, EXPONENTIAL))

    I have tested it , and it works.

  • akshay says:

    Hi milind

    In algoz to access previous bars we use ref(vector,period) and the periods are positive unlike amibroker.
    For cci you also have to mention type of moving average cci(periods,MAtype)

    So your code will be
    buy : CLOSE>REF(SMA(HIGH,6),4) AND CCI(35,simple)>35
    sell : CLOSE<REF(SMA(LOW,6),4) AND CCI(35,simple)<35

  • Varun says:

    I have backtested the strategy and my observation is that AND operation is not happening (intentionally taken high RSI to check the backtest) :

    Buy alert : (MACD(13, 26, 9,EXPONENTIAL) > MACDSignal(13,26, 9, EXPONENTIAL)) AND (Rsi(Close, 14) > 80)

    Buy exit alert : (MACD(13, 26, 9,EXPONENTIAL) < MACDSignal(13,26, 9, EXPONENTIAL))

    Please let me know, if anything wrong with expression ???

  • milind2754 says:

    displaced moving average indicator is there in nesttrader ?

  • milind2754 says:

    I have written code for buy and sell
    buy : CLOSE>REF(SMA(HIGH,6),-4) AND CCI(35)>35
    sell : CLOSE<REF(SMA(LOW,6),-4) AND CCI(35)<35

    is this code correct in nesttrader language ?

  • milind2754 says:

    I have written code for buy and sell
    buy : CLOSE>REF(SMA(HIGH,6),-4) AND CCI(35)>35
    sell : CLOSE35

    is this code correct in nesttrader language ?

  • varunsingh1234 says:

    I have backtested the strategy and my observation is that AND operation is not happening (intentionally taken high RSI to check the backtest) :

    Buy alert : (MACD(13, 26, 9,EXPONENTIAL) > MACDSignal(13,26, 9, EXPONENTIAL)) AND (Rsi(Close, 14) > 80)

    Buy exit alert : (MACD(13, 26, 9,EXPONENTIAL) < MACDSignal(13,26, 9, EXPONENTIAL))

    Please let me know, if anything wrong with expression ???

  • Akshay says:

    hi soumyajit

    You need to confirm whether you want crossover or greater, because both functions work differently. I think you want to use crossover. To understand this further you can go to the following link:
    http://tradingqna.com/293/difference-between-crossover-functions-automated-trading

    So using crossover this is how your strategy will be:
    BUY: crossover(EMA(CLOSE,5),SMA(CLOSE,10))
    SELL: crossover(SMA(CLOSE,10),EMA(CLOSE,5))

  • Soumyajit says:

    Hi Nithin,

    I have been facing some problems in the ZT alogz.

    I have coded a strategy

    BUY: EMA(CLOSE,5)>SMA(CLOSE,10)
    SELL: EMA(CLOSE,5)<SMA(CLOSE,10)
    I have back tested it and it works fine. But while running it live today i found false calls generated. I have set the interval at 5 mins and i was following the chart, i found that there was no crossover but still a call was generated. And in another case there was a crossover and no calls have been generated.

  • velappan periasamy says:

    Nithin ,

    I need the back test result for nifty fut i min data for the code given below.
    pls provide the software for backtesting my code.

    ### PDC=PREVIOUS DAY’S CLOSE

    SET PDC=REF(CLOSE,-1)
    BUY CLOSE>PDC
    SET BP=CLOSE
    SELL EXIT CLOSE-BP>30
    SELL CLOSE<BP
    SELL CLOSE 30
    BUY EXIT 0
    SELL EXIT 0

    thanks
    v.periasamy

  • Nithinji,

    greetings for the day.

    Could you pls provide the coding for the 2 simple strategies stated below on a one minute candle.
    I intend to use it in calls/puts intraday trades.
    Would also be very grateful if you could advice – of course without any risk and responsibility at your end – for any suitable modification(s)/addition to this strategy:

    Strategy-1:
    Buy: if the upward trending RSI has crossed the 50 level AND the upward trending price-ROC is above zero
    level
    Sell: RSI is reversing OR the price-ROC is reversing.

    Strategy-2:
    Buy: when the upward trending 5 period EMA crosses the 15 period EMA.
    Sell : when the downward trending 5 period EMA crosses the 15 period EMA.

    thanks in advance,

    Shailender .

    • Buy signal:

      Trend(RSI(close,14))=up and crossover(rsi(close,14),50) and
      Trend(PROC(close,14))=UP and PROC(close,14)>0

      Sell Signal:
      # Assuming that by reversing the user means trend is down.

      Trend(RSI(close,14))=Down or Trend(PROC(close,14))=Down

      Strategy 2
      Buy:
      Trend(ema(close,5))=up and crossover(ema(close,5),ema(close,15))
      Sell:
      Trend(ema(close,5))=Down and crossover(ema(close,15),ema(close,5))

  • Arti Mittal says:

    arti
    Nithin ,
    i have new account user id- DA1727, activated on 27-mar-14,i am subscribed to omnesys
    for NEST Pulse,with different id. i want to login as DA1727 but when i try to login as DA1727 with my ZT password for nest plus in ZT, it refuses by saying that invalid login or password.
    1 i need to write some custom script in NEST Pulse, how to get in.
    2 i have some code in VB.net , can i subscribe for pulse API from somewhere
    thanks

    • Arti,

      The cost of automating through API is pretty restrictive, check this

      I’d suggest you to see if it is possible on Pulse, will get someone on our tech team to call you up regarding the login issue. Check this section

      Our new trading platform that we are working on, has advance coding/backtesting capability.

  • Ravikumar says:

    Hello Nithin can you get this for me

    Entry for Long:

    Note down previous day’s High price and after market opens today, wait for the price to breakout yesterday’s high and when broken check if Today’s Open = Today’s Low at that time, if Yes go long with Stop loss as today’s Low price.

    Entry for Short

    Note down previous day’s Low price and after market opens today, wait for the price to breakdown yesterday’s low and when broken check if Today’s Open = Today’s High at that time, if Yes go Short with Stop loss as today’s High price.

  • ksjoseph says:

    Dear Nithin Kamath,

    I’m a new client (RS:2849) who have been trying to learn the features in the Nest Trader for about three weeks. But during the process of my study I found lot’s of features which are provided by some international brokers are not there in the Nest Trader software which is provided by Omnesys. If this features can be included in the new trading software then I can really assure this is going to be the fantastic software which we can get in India. The following are the features which I’m just listing below:-

    1. Click based market execution order. This helps the trader in entering into the trade more faster at the price foreseen by him. Order placing using the keyboard takes more time and has now become outdated.
    2. Java based charting software which contains tick by tick, 1M, 15M, 1H, 4H & Day, Weekly & Monthly charts ( M-> Minutes & H-> Hour)
    3. Tools such as Cursor, Crosshair, Vertical Line, Horizontal Line & Trend Line can be included.
    4. Various types of charts such as Line, OHLC, Candle sticks etc can be put in the tools list so that the user can view the graph as per his requirement within a milli second.
    5. Including a concept called Expert Advisors and Strategy Tester. This is the same concept like Algo Z in the Nest Trader. This facility is now there in the Metatrader software .

    The thing which is coming to my mind is why can’t Zerodha have a tie up with the Metatrader or Amibroker. Since now most of the international brokers are giving this Meta Trader software free for their clients so that they can take better decisions when it comes to live trading. If the trading software is professional its generally a win win situation for the Broking institutions like Zerodha and even for the client too since you get high volume trading with better accuracy.

    Right now the trading software which is provided but the Omnesys people are not up to the mark. It’s not a professional software for the trading community as a whole. Even there is a problem the Omnesys guys are very slow in responding its seems like they are running a government institution.
    Anyway there is still scope for huge improvement. I hope Nithin Kamath and his team of professionals will take this note and bring in with a new professional trading software which will be the benchmark trading software so that everyone can lookup to you guys thus bringing in a new young class of professionals into trading.

    So all the best to you and to your team.

    With Regards,

    K.S.JOSEPH
    94972-82865.

  • currencyandnifty.com says:

    when will you launch your new platform for trading,?

  • sharan says:

    HI nithin,

    my ac is activated but installation is in progress. Can i run algoz in MCX market.? what is the best moving averg script in Nifty F&O.? can you please tell me the best 3 code for algos trading i will work on back test results. can you please help me out.

    Regrads
    Sharan

    • Sharan,

      Presently, this doesn’t work on MCX. There are a bunch of strategies on this blog post, you can backtest and see how it works. The thing about strategies is, it has to constantly evolve, so it is best if you learn it yourself.

  • kam.tngr says:

    Hi Nithin,
    By when will the next version be released that will allow 10 months data for intraday and historical for backtest?

    Until it is released is there a way that we can get the backtesting done for larger period?

    Apart from 10 months data for intraday, do you plan to introduce any paid feature wherein users of AlgoZ can access the entire data without any limitation?

    • Yes Kam,

      The new platform will come with advanced backtesting features, and an ability to be able to backtest on intraday data for upto 4 years. This will be all available for free. 🙂

      Cheers,

  • Chandranath Jain says:

    Hi,

    can we set the open intrest of call as C1,c2,c3….and OI of Put as P1,P2… for a series of Strike Price and do the math for C and P Series of values…? Please suggest

    Need this in ALGOS

    Thanks.
    Jain

  • amitagsk says:

    hi
    can we use supertrend indicator !

  • niftytrader says:

    hi zerodha
    I want to fully automate my trading using nest pulse dealer for that i need dealer id can you please tell me what are the requirements to get dealer id and is there any requirement of funds in trading account please help me
    thank you

  • amthangamani says:

    Hi Nithin,

    I just want to know whether the following strategy can be coded or not

    I want to place SL buy above the high of 11:00 AM 30-Min bar and SL sell below the low of 11:00 AM 30-Min bar, when Long or Short entered the pending SL order should become Stop Loss for the executed order. Take profit is optional if no take profit mentioned the order should get closed at 3:29 PM.

    Please let me know whether the above strategy can be coded and if yes, please guide me on coding it since I do not possess sound coding knolwedge

  • sharan says:

    Hi Nithin, I need one help i have Amibroker software and signaling code. the same code i would like to add to Zerodha ZT is it possible.? and also i dont know the code what is it. but it giving good signals as well as Stop Loss.

    2. What is the difference between Amibroker and Zerodha ZT software, both are giving signals na..?

    • Sharan,

      1. Depends on the complexity of the code, algoZ on ZT can’t presently handle complex codes. But you will have to tell us what it is to be able to code.

      2. Yes in terms of signals ami and ZT are similar, but ami is much more advanced. We should be launching our new platform in the next 2 months, which along with being able to trade, would also be able to match ami in terms of charting and coding.

  • Aditya says:

    Hi, Just wanted to verify – What data does the chart show as 1 year historical data for any future contract ?
    For NIFTY14MARFUT contract I can see historical data starting from Feb2013, time at which this contract did not exist.
    Does it pull out data from all near term contracts for any given month to show this data ?

    • Aditya,

      Historical charts for futures are usually smoothed to make it look like a continuous chart. So for example at the end of Nifty FEB futures, it will automatically merge into Nifty Mar Futures. Hopefully I didn’t confuse you too much.

      • Aditya says:

        Hi Nithin, Thanks for the reply. No that’s how one would expect it to be.
        Just wanted to be sure as I have just started testing the waters in the world of algo trading 🙂

  • ksjoseph says:

    Hello Nithin Kamath,

    Based of the 5 min chart I want to

    Buy: When LAST>EMA(CLOSE,14) AND MACD > -3.60 and SELL: When LAST<EMA(CLOSE,14) AND MACD < 14.48

    Please do help me in figuring the correct code.

    With Regards,

    K.S.Joseph

  • Devis says:

    Hi Nithin Kamathji,

    my zerodha id is DD0566

    crossBuy=Cross(StochK(17,9),StochD(17,9,3));
    crossSell=Cross(StochD(17,9,3),StochK(17,9));

    Best regards,
    DEVIS MODI

  • devis says:

    _SECTION_BEGIN(“GUPPY’S G M M A”);

    SetBarsRequired(100000,0);

    SetChartOptions(0,chartShowArrows|chartShowDates);

    MaxGraph = 12;

    //==========Bar count= ==CNBONDRE=========================================================

    PlotText(” C= “+LastValue(C),BarCount,LastValue(C),42);
    numBars = BarsSince(DateNum()!=Ref(DateNum(),-1))+1;
    PlotText(“\n BARS = “+LastValue(numBars),BarCount,LastValue(C),16);

    //numBars = BarsSince(DateNum()!=Ref(DateNum(),-1))+1;

    //PlotText(“\n VOL=”+LastValue(Volume),BarCount,LastValue(Volume),37);

    StyleList= ParamList(“Chart Style”, “Candle,Bar”);
    style =IIf(StyleList== “Candle”,styleCandle, styleBar);

    GreenBar = IIf(C > O, True, False);
    RedBar = IIf(C < O, True, False);
    BarColor = IIf(GreenBar, colorGreen, IIf(RedBar, colorRed, colorGrey50));

    PlotOHLC(O, H, L, C, "", BarColor, style );

    //TimeFrameSet( inWeekly );// weekly // Daily

    Q = Param( "% Change", 2, 0.1, 10, 0.1 );

    Z = Zig( C , q ) ;

    HH = (( Z Ref(Z, -2)) AND (Peak(Z, Q, 1) > Peak(Z, Q, 2)));
    LH = ((Z Ref(Z, -2)) AND (Peak(Z, Q, 1) Ref(Z, -1) AND Ref(Z, -1) Trough(Z, Q, 2)));
    LL = ((Z > Ref(Z, -1) AND Ref(Z, -1) < Ref(Z, -2)) AND (Trough(Z, Q, 1) < Trough(Z, Q, 2)));

    GraphXSpace = 10;
    dist = 0.5 * ATR(20);

    for ( i = 0; i EMA(C,30) AND EMA(C,3)>EMA(C,15) AND StochK()>Ref(StochK(),-1) AND StochK()>StochD() AND StochD()<80);
    Sell= HH OR LH OR (Cross(EMA(C,60),EMA(C,15) )AND StochD()<30)OR(Cross( EMA(a,3), C ) AND EMA(a,15)< EMA(C,30) AND EMA(C,3)<EMA(C,15) AND StochK()<Ref(StochK(),-1) AND StochK()<StochD() AND StochD()C,colorDarkRed, colorBrightGreen ) );
    Plot( C, “Price”, IIf( O>C,colorRed, colorGreen ), styleCandle );

    HaClose =EMA((O+H+L+C)/4,3);
    HaOpen = AMA( Ref( HaClose, -1 ), 0.5 );
    HaHigh = Max( H, Max( HaClose, HaOpen ) );
    HaLow = Min( L, Min( HaClose, HaOpen ) );

    _SECTION_BEGIN(“Resistance”);

    supres=ParamToggle(“Sup_Res”,”No|Yes”,1);
    if(supres)
    {

    Prd1=Param(“Res_Period1”,2,0,200,1);

    test = TEMA ( High , Prd1 ) ;

    PK = test > Ref(test,-1) AND Ref(test,1) < High;//Peak
    PKV0 = ValueWhen(PK,haHigh,0);//PeakValue0
    PKV1 = ValueWhen(PK,haHigh,1);//PeakValue1
    PKV2 = ValueWhen(PK,haHigh,2);//PeakValue2

    MPK = PKV2 PKV0 ;//MajorPeak

    MPKV = ValueWhen(Ref(MPK,-1) == 0 AND MPK == 1, PKV1,1); //MajorPeakValue
    MPKD = ValueWhen(Ref(MPK,-1) == 0 AND MPK == 1, DateNum(),1); //MajorPeakDate
    SD = IIf(DateNum() < LastValue(MPKD,lastmode = True ), Null, LastValue(MPKV,Lastmode = True));//SelectedDate
    Plot(SD, "Resist1", colorRed,ParamStyle("ResStyle1",styleLine|styleNoTitle,maskAll));

    MPKV2 = ValueWhen(Ref(MPK,-1) == 0 AND MPK == 1, PKV1,2); //MajorPeakValue
    MPKD2 = ValueWhen(Ref(MPK,-1) == 0 AND MPK == 1, DateNum(),2); //MajorPeakDate
    SD2 = IIf(DateNum() < LastValue(MPKD2,lastmode = True ), Null, LastValue(MPKV2,Lastmode = True));//SelectedDate
    Plot(SD2, "Resist2", colorRed,ParamStyle("ResStyle2",styleLine|styleNoTitle,maskAll));

    MPKV3 = ValueWhen(Ref(MPK,-1) == 0 AND MPK == 1, PKV1,3); //MajorPeakValue
    MPKD3 = ValueWhen(Ref(MPK,-1) == 0 AND MPK == 1, DateNum(),3); //MajorPeakDate
    SD3 = IIf(DateNum() < LastValue(MPKD3,lastmode = True ), Null, LastValue(MPKV3,Lastmode = True));//SelectedDate
    Plot(SD3, "Resist3", colorRed,ParamStyle("ResStyle3",styleLine|styleNoTitle,maskAll));

    MPKV4 = ValueWhen(Ref(MPK,-1) == 0 AND MPK == 1, PKV1,4); //MajorPeakValue
    MPKD4 = ValueWhen(Ref(MPK,-1) == 0 AND MPK == 1, DateNum(),4); //MajorPeakDate
    SD4 = IIf(DateNum() Ref(L,-1) AND Ref(L,1) Low AND test2 SPV1 AND SPV1 < SPV0 ;//MajorPeak

    MSPV = ValueWhen(Ref(MSP,-1) == 0 AND MSP == 1, SPV1,1);
    MSPD = ValueWhen(Ref(MSP,-1) == 0 AND MSP == 1, DateNum(),1);
    SD = IIf(DateNum() < LastValue(MSPD,lastmode = True ), Null, LastValue(MSPV,Lastmode = True));
    Plot(SD,"Support1", colorBlue,ParamStyle("SupportLine1",styleLine|styleNoTitle,maskAll));

    MSPV2 = ValueWhen(Ref(MSP,-1) == 0 AND MSP == 1, SPV1,2);
    MSPD2 = ValueWhen(Ref(MSP,-1) == 0 AND MSP == 1, DateNum(),2);
    SD2 = IIf(DateNum() < LastValue(MSPD2,lastmode = True ), Null, LastValue(MSPV2,Lastmode = True));
    Plot(SD2,"Support2", colorBlue,ParamStyle("SupportLine2",styleLine|styleNoTitle,maskAll));

    MSPV3 = ValueWhen(Ref(MSP,-1) == 0 AND MSP == 1, SPV1,3);
    MSPD3 = ValueWhen(Ref(MSP,-1) == 0 AND MSP == 1, DateNum(),3);
    SD3 = IIf(DateNum() < LastValue(MSPD3,lastmode = True ), Null, LastValue(MSPV3,Lastmode = True));
    Plot(SD3,"Support3", colorBlue,ParamStyle("SupportLine3",styleLine|styleNoTitle,maskAll));

    MSPV4 = ValueWhen(Ref(MSP,-1) == 0 AND MSP == 1, SPV1,4);
    MSPD4 = ValueWhen(Ref(MSP,-1) == 0 AND MSP == 1, DateNum(),4);
    SD4 = IIf(DateNum() < LastValue(MSPD4,lastmode = True ), Null, LastValue(MSPV4,Lastmode = True));
    Plot(SD4,"Support4", colorBlue,ParamStyle("SupportLine4",styleLine|styleNoTitle,maskAll));

    }

    _SECTION_END();

  • ksjoseph says:

    Hello Nitin,

    I am just new to trading and was just trying to learn and create strategies. The idea of my strategy is just
    Buying the scrip when all the conditions are satisfied: When the CMP (Current Market Price) > EMA.(Period 14) + MACD upward cross + RSI should be above 65. Now just check my formula

    BUY = CMP>EMA(CLOSE,14) AND MACD(26,13,9,EXPONENTIAL)>MACDSIGNAL(26,12,9,EXPONENTIAL) AND RSI(CLOSE,14)<35

    SELL = CMP<EMA(CLOSE,14) AND MACD(26,13,9,EXPONENTIAL)65

    BUY EXIT = 0, SELL EXIT = 0

    Just see if this is the right code which i have written or if not please advice me the correct code

  • SAMEER KUTTI says:

    NITIN ,
    KINDLY HELP/PROVIDE ME SURE SHOT STRATIGY FOR INTRADAY TRADING IN NIFTY & BANK NIFTY FUTURES. PLZ OBLIGE ME.
    PRADEEP KUMAR SARIN (AUTPKS) ZERODHA UP

  • PRADEEP says:

    NITIN ,
    KINDLY HELP/PROVIDE ME SURE SHOT STRATIGY FOR INTRADAY TRADING IN NIFTY & BANK NIFTY FUTURES. PLZ OBLIGE ME.
    PRADEEP KUMAR SARIN (AUTPKS) ZERODHA UP

  • SAMEER KUTTI says:

    respected sirji yesterday i got your mail for ema -cci coding srategy thanx for your mail ..but i want to additinal add for some coding ema-cci so please help …below additional add so please make coding thanx in adavace

    WAITING FOR YOUR VALUABLE REPLY …THANX
    Setup

    1). Timeframe : 5min chart
    2). EMA : 110 period
    3). CCI : 14 days

    Why EMA 110? To be frank no idea but when tested proved with results to guage the TREND!

    RULE

    BUY / GO LONG CONDITION

    a). The 5 min candle should be cut and close above 110 EMA.
    b). CCI should be > 100. We consider CCI reading only for ENTRY not for EXIT. This CCI will act as a FILTER to avoid false Traps
    c). A entry at 0.10% of the High price of the candle that cut and closed above 110 EMA

    ADDITIONAL ADD::

    1. increased the filter from 0.1% to 0.15%

    2. trading starts only after the 8th candle for the day

    3. CCI has to be more than 115

    4. last trade should be the 3 o clock candle . No trades after that

    5. Trading decision is taken with 3 candles . First candle is the one which has crossed over the 110 period MA with atleast a diffference of 0.5 from the 110 EMA . Also tail/head shadow should not be more than 2 times the body of the candle . Color doesn’t matter. you place an order which is 0.15% more/less than the high /low of the first candle ( cross over candle ) . If it doesn’t get executed , we wait for the first 3 minutes of the next candle ,if not the order is cancelled .
    6. If the cross over candle is a doji i change the sl to 7.5

    LT gave relatively poor results . All banking stocks and Maruti give good results if he rules are followed

    SELL / GO SHORT CONDITION

    a). The 5 min candle should cut and close below 110 EMA.
    b). CCI should be < -100. We consider CCI reading only for ENTRY and not for EXIT. This CCI will act as a FILTER to avoid false Traps
    c). A entry at 0.10% of the Low price of the candle that cut and closed below 110 EMA.

    ADDITIONAL
    CANDLE CLOSING BELOW SMA(26)
    EXIT : Rs.10/- min

    SL : Rs.10/- (as I want to keep RR as 1:1)

    Recommended Scrips : MARUTI, AXISBANK, LT, TCS, ICICIBANK & SBI

    PLEASE HELP NITIN JI FOR SOME ALTER CODING ADDITIONAL ADD THANX IN ADVANCE

    PLEASE HANAN JI LOOK THIS AND MAKE A CODE THANX IN ADAVANCE

  • vishal says:

    hi ,
    I need to code this strategy
    buy condition
    5ema (close)cross 13ema(close) from below and stoch (8,3,4,exponential) bullish crossover but 20
    sell exit
    stoch bullish crossover

  • vishal says:

    hi ,
    I need to code this strategy
    buy condition
    5ema (close)cross 13ema(close) from below and stoch (8,3,4,exponential) bullish crossover but 20
    sell exit
    stoch bullish crossover

  • SAMEER KUTTI says:

    respected sirji yesterday i got your mail for ema -cci coding srategy thanx for your mail ..but i want to additinal add for some coding ema-cci so please help …below additional add so please make coding thanx in adavace

    WAITING FOR YOUR VALUABLE REPLY …THANX
    Setup

    1). Timeframe : 5min chart
    2). EMA : 110 period
    3). CCI : 14 days

    Why EMA 110? To be frank no idea but when tested proved with results to guage the TREND!

    RULE

    BUY / GO LONG CONDITION

    a). The 5 min candle should be cut and close above 110 EMA.
    b). CCI should be > 100. We consider CCI reading only for ENTRY not for EXIT. This CCI will act as a FILTER to avoid false Traps
    c). A entry at 0.10% of the High price of the candle that cut and closed above 110 EMA

    ADDITIONAL ADD::

    1. increased the filter from 0.1% to 0.15%

    2. trading starts only after the 8th candle for the day

    3. CCI has to be more than 115

    4. last trade should be the 3 o clock candle . No trades after that

    5. Trading decision is taken with 3 candles . First candle is the one which has crossed over the 110 period MA with atleast a diffference of 0.5 from the 110 EMA . Also tail/head shadow should not be more than 2 times the body of the candle . Color doesn’t matter. you place an order which is 0.15% more/less than the high /low of the first candle ( cross over candle ) . If it doesn’t get executed , we wait for the first 3 minutes of the next candle ,if not the order is cancelled .
    6. If the cross over candle is a doji i change the sl to 7.5

    LT gave relatively poor results . All banking stocks and Maruti give good results if he rules are followed

    SELL / GO SHORT CONDITION

    a). The 5 min candle should cut and close below 110 EMA.
    b). CCI should be < -100. We consider CCI reading only for ENTRY and not for EXIT. This CCI will act as a FILTER to avoid false Traps
    c). A entry at 0.10% of the Low price of the candle that cut and closed below 110 EMA.

    ADDITIONAL
    CANDLE CLOSING BELOW SMA(26)
    EXIT : Rs.10/- min

    SL : Rs.10/- (as I want to keep RR as 1:1)

    Recommended Scrips : MARUTI, AXISBANK, LT, TCS, ICICIBANK & SBI

    PLEASE HELP NITIN JI FOR SOME ALTER CODING ADDITIONAL ADD THANX IN ADVANCE

  • SAMEER KUTTI says:

    THANX NITIN JI

  • SAMEER KUTTI says:

    This strategy can be applied to any timeframe and to any security. There are no guarantees implied with this strategy and losses can and may occur. This strategy is presented for educational purposes only. Online Trading Academy, its affiliates and Brandon Wendell cannot be held liable for any losses that you may have while employing this strategy in any markets.
    Long Strategy
    1. Place the 8EMA and 89EMA on your chart
    2. When price and the 8EMA cross above the 89EMA you are establishing an uptrend in your timeframe
    3. This trade will work best if the larger timeframe is also in a bullish trend
    a. Trading on 5 min, use 30 min
    b. Trading on 15 min, use hourly
    c. Trading on 30 or 60 min, use daily
    d. Trading on daily, use weekly
    4. Look to buy when price retests an up-sloping 89EMA for the first time only
    a. Price should also be testing a fresh demand level, trade is less likely to work without demand
    b. The 8EMA cannot cross the 89EMA
    c. Price can cross the 89EMA but cannot break demand
    d. Additional confirmation from an oversold CCI, Stochastic or RSI
    5. Place your stop below demand or 1 x ATR below the 89EMA
    6. Target is the next supply level

    This strategy can be applied to any timeframe and to any security.
    Short Strategy
    1. Place the 8EMA and 89EMA on your chart
    2. When price and the 8EMA cross below the 89EMA you are
    establishing an downtrend in your timeframe
    3. This trade will work best if the larger timeframe is also in a bearish trend
    a. Trading on 5 min, use 30 min
    b. Trading on 15 min, use hourly
    c. Trading on 30 or 60 min, use daily
    d. Trading on daily, use weekly
    4. Look to sell short when price retests an down-sloping 89EMA for the first time only
    a. Price should also be testing a fresh supply level, trade is less likely to work without supply
    b. The 8EMA cannot cross the 89EMA
    c. Price can cross the 89EMA but cannot break supply
    d. Additional confirmation from and overbought CCI, Stochastic or RSI
    5. Place your stop above supply or 1 x ATR above the 89EMA
    6. Target is the next demand level

    DEAR SIRJI PLEASE MAKE ME CODING THANX

  • SAMEER KUTTI says:

    Setup

    1). Timeframe : 5min chart
    2). EMA : 110 period
    3). CCI : 14 days

    Why EMA 110? To be frank no idea but when tested proved with results to guage the TREND!

    RULE

    BUY / GO LONG CONDITION

    a). The 5 min candle should be cut and close above 110 EMA.
    b). CCI should be > 100. We consider CCI reading only for ENTRY not for EXIT. This CCI will act as a FILTER to avoid false Traps
    c). A entry at 0.10% of the High price of the candle that cut and closed above 110 EMA

    SELL / GO SHORT CONDITION

    a). The 5 min candle should cut and close below 110 EMA.
    b). CCI should be < -100. We consider CCI reading only for ENTRY and not for EXIT. This CCI will act as a FILTER to avoid false Traps
    c). A entry at 0.10% of the Low price of the candle that cut and closed below 110 EMA.

    EXIT : Rs.10/- min

    SL : Rs.10/- (as I want to keep RR as 1:1)

    Recommended Scrips : MARUTI, AXISBANK, LT, TCS, ICICIBANK & SBI

    PLEASE NITINJI HELP ABOVE FOR CODING THANX

  • Govindaraju Y says:

    Hello sir i have one strategy please code it.
    interval: daily

    Buy:

    current price > 2 WMA (formula (previous day close + 2 * curret price)/3)

    and cross of Macd(1,30) and Macd Signal (1,30,2)

    Exit Buy:
    current price > 2 WMA (formula (previous day close + 2 * curret price)/3)

    and cross of Macd(1,30) and Macd Signal (1,30,2)

    Sell: current price > 2 WMA (formula (previous day close + 2 * curret price)/3)

    and cross of Macd(1,30) and Macd Signal (1,30,2)

    Exit Sell :

    current price > 2 WMA (formula (previous day close + 2 * curret price)/3)

    and cross of Macd(1,30) and Macd Signal (1,30,2)

  • Dinesh says:

    Hi,
    Could you please let me know if this can be coded.
    Step 1:
    Buy 1 share at current market price (ex: buy 1 at 100.00)
    If 4 points gain then close position if not go to step 2
    Step 2:
    if 2 points loss then buy 2 more shares at 98.00, this step continues whenever there is a 2 points loss and the order quantity doubles for every level it goes down (ex: buy 2 at 98, buy 4 at 96, buy 8 at 94..)
    Exit:
    Close all the positions whenever the point goes up 4 points from the last bought level (let’s say the current price is 96 then it has to close all positions if the point reaches 100), and continue to step 1.
    Thanks,

  • Dharam says:

    Hi Zerodha,

    I am not sure if this query can be put here. But i would find no other place to put it either. 🙁 So here’s the query –

    Whenever i try to see the historical charts i get this Error Msg –

    — Request: nexus_db_vwap, Process: Nexus_VWAP , Error: Request Unknown. Please contact Administrator..

  • chethan icc says:

    Hi,
    Can you code strategy for below
    Resistance(R1) = (2×P)−L
    R2 = P+H−L
    R3 = H+2×(P−L)
    Support(S1) = (2×P)−H
    S2 = P−H+L
    S3 = L−2×(H−P)
    P is pivot and based on this
    Buy: When above R1
    Buy exit: 50% at R2 and rest at R3
    Sell: when below S1
    Sell exit: 50% below S2 and rest at S3
    Thank you.

  • Mareeswaran6 says:

    I have created a new Strategy. But when ever i executed it is giving error message Error: Scripts generated no trades.

    So for testing i have given LAST > OPEN. in buy condition. But still it is giving the same error?

    I have tested in different time frames. Still getting error?

    Also tested other inbuilt strategy also.giving the same issues.

    Please help.

  • DM0969 says:

    Hi Team,

    Can you please help with the

    Buy Expression for:
    When the stock closes above its 3 month high candle

    Thanks,
    Mahesh

  • drmdave says:

    I want to code the following logic for Amibroker:

    Chart 1 min candle chart intraday
    Indicator 21 Simple Moving Average
    Profit target 21 points
    Stop Loss 9 points
    Trailing stop loss Once the position is in profit by 13 points, 9 points trailing stop loss.

    Buy

    When a candle closes above the 21 SMA, buy when the peak price of this candle is breached by 3 points.
    If the successive candles high is less than 3 points, the entry point is when the price breaches the highest of the precedding candles since signal, by 3 points.

    Sell

    At profit target of 21 points or a trailing stop loss of 9 points once the profit is 13 points
    Or exit when the signal is reversed.

    Re entry

    Once position is closed re-enter if the trend continues and the prices breaches the high of a candle when position was closed by 3 points.

    Short

    When a candle closes below the 21 SMA, short when the low of this candle is breached by 3 points.
    If the successive candles low is less than 3 points, the entry point is when the price breaches the lowest of the precedding candles since signal, by 3 points.

    Cover

    At profit target of 21 points or a trailing stop loss of 9 points once the profit is 13 points
    Or exit when the signal is reversed.

    Once position is closed re-enter if the trend continues and the prices breaches the low of a candle when position was closed by 3 points.

  • Mareeswaran6 says:

    Indicators:
    Bollinger Band
    EMA Period

    Buy Condition:

    1. When previous Bar[low]Touches the Lower Bollinger Band
    2. AND Current bar open above the Lower Bollinger Band
    3. AND Current Bar Open above Close of Previous bar
    4. AND Finally Current bar price should be 2 to 3 pips less than EMA

    Exit Long Conditions:
    1. Exit the long position when current bar touches the EMA.

    Stop Loss:
    1. Low of the previous bar + 2 pips (i.e. the previous bar when we bought)

    Can you please create a strategy for me based on these inputs. Let me know if need any more inputs.

  • mohmed says:

    please give me code for this…
    Buy : prime number oscillator 7

    i tried following but its not working
    Buy : PNO(CLOSE)7

  • Dinesh says:

    Hi,

    i need a code for the below AFL, will that be possible?

    _SECTION_BEGIN(“Price”);
    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”, colorBlack ), styleNoTitle | ParamStyle(“Style”) | GetPriceStyle() );
    _SECTION_END();

    _SECTION_BEGIN(“camarilla levels”);
    //—- pivot points
    DayH = TimeFrameGetPrice(“H”, inDaily, -1); // yesterdays high
    DayL = TimeFrameGetPrice(“L”, inDaily, -1); // low
    DayC = TimeFrameGetPrice(“C”, inDaily, -1); // close
    DayO = TimeFrameGetPrice(“O”, inDaily); // current day open

    // camarilla pivots
    if ( True )
    {
    R = DayH – DayL; // range
    PP = (DayH + DayL + DayO + DayO) / 4 ;
    R4 = (R * 1.1/2)+DayC;
    R3 = (R * 1.1/4)+DayC;
    S3 = DayC-(R * 1.1/4);
    S4 = DayC- (R * 1.1/2);
    }

    Plot(R4, “”,colorGreen,styleDots+styleNoLine);
    Plot(S4, “”,colorDarkBlue,styleDots+styleNoLine);
    Plot(R3, “R3”,colorRed,styleDots+styleNoLine);
    Plot(S3, “S3”,colorDarkBlue,styleDots+styleNoLine);
    Plot(PP, “”,colorYellow,styleLine);

    //—-
    Title = Name()+” Camarilla”+Date()+ EncodeColor(colorRed)+ ” R3 “+WriteVal(R3,1.2)+EncodeColor(colorGreen)+ ” S3 “+ WriteVal(S3,1.2)+”\n”+EncodeColor(colorGreen)+” Long Breakout above “+WriteVal(R4,1.2)+”\n”+EncodeColor(colorRed)+” Short breakout below “+WriteVal(S4,1.2)
    +”\n”+EncodeColor(colorGreen)+” If Rangebound buy close to “+ WriteVal(S3,1.2)+
    “\n”+EncodeColor(colorRed)+” If Rangebound short close to “+ WriteVal(R3,1.2);

    Filter=1;
    AddColumn(C,”cmp”,1.2);
    AddColumn(R3,”R3″,1.2);
    AddColumn(R4,”R4″,1.2);
    AddColumn(S3,”S3″,1.2);
    AddColumn(S4,”S4″,1.2);
    _SECTION_END();

    ——————————————————————————————————–
    //—- pivot points
    DayH = TimeFrameGetPrice(“H”, inDaily, -1); // yesterdays high
    DayL = TimeFrameGetPrice(“L”, inDaily, -1); // low
    DayC = TimeFrameGetPrice(“C”, inDaily, -1); // close
    DayO = TimeFrameGetPrice(“O”, inDaily); // current day open

    // camarilla pivots
    if ( True )
    {
    R = DayH – DayL; // range
    PP = (DayH + DayL + DayO + DayO) / 4 ;
    R4 = (R * 1.1/2)+DayC;
    R3 = (R * 1.1/4)+DayC;
    S3 = DayC-(R * 1.1/4);
    S4 = DayC- (R * 1.1/2);
    }

  • sonaimana says:

    OK..
    But what about my code and setting for the given example asked…”For example: Closing price is above 13 ema and cci is greater than 50, buy above the high of this candle with addition to a percentage filter (say 0.5%) and vice versa for sell.”
    Thanks..

  • sonaimana says:

    hi
    as all of the code give signal whenever meet the given criteria , as well as the order also generated on the same candle. I want to get order alert above/below the high/low price of the signal candle with a percentage filter. how can it be coded?
    For example: Closing price is above 13 ema and cci is greater than 50, buy above the high of this candle with addition to a percentage filter (say 0.5%) and vice versa for sell.

  • tirumal says:

    dear team

    please mack a code below given expresoine

    ema highe 20,ema low 20 and with ema 200
    signeal should be come when cross both ema (EMA-H20,EMA-L20) to cross EMA-200

  • Manikandan R says:

    Hi Nithin, I am Manikandan from Chennai …. a client and an AP for Zerodha … I have a simple constant strategy in Bank Nifty Futures, with no If and but logic …

    I have back-tested that for the last 9 years and it gives 70 fold returns on capital, with max negative MTM of 2000 points in bank nifty at any point of time … Accuracy at 70% ….

    I have explained this to Bosco in person in Chennai … He should too inform you about this …
    I want this logic automated so that clients can allocate budget and follow it (The logic is very simple and it should be very very easy to automate) …

    I have explained the back-tested results in a video … If you can spend 10 mins, you can watch it at http://www.youtube.com/watch?v=XaKek5-H2NM

    If you can spend some time, i can explain in detail ….

  • jiroo says:

    How I can add formulas and back test the formula in nest plus. Please describe
    Did you know any successful strategies with 95% accuracy?
    Or how I can collect a successful strategy from the best earning member of zerodha?

    Give me a code for triangular moving average for 5 days with top and bottom with sell buy signal and avoid signals in flat movements

  • kasi says:

    Please give code for MACD HISTOGRAM.

  • Sameer_Trader says:

    what are the charges and procedure to fully automate trading as per new regulations? Please let me kniw.
    Thanks

  • Sameer_Trader says:

    In algoZ trading, Suppose the system puts a long order on exchange along with a stoploss and the stoploss gets triggered for below stratergy .So the long position is closed because of stoploss and not due to buy exit condition. Now when the sell condition becomes true at some point, will the system first execute buy exit and then opens short position? or does the system knows that the long is closed due to stoploss and only opens a short position?

    Buy: EMA(Close,7)>EMA(Close,14) Sell: EMA(Close,7)<EMA(Close,14)

    Buy exit: 0 Sell exit: 0

  • rbtj says:

    Hey,

    First of all thanks a ton for your efforts !! 🙂

    A few queries

    1. Can the variable(s) calculated in the previous condition check be used in the next check.
    Say I use “SET A =” function and the BUY or SELL expression returns FALSE. Can I use this information (that it returned FALSE) in the next check ?

    2. How do you incorporate memory element ?
    Say I use SET B= some function in the BUY expression. After 10 intervals, can I use the value of REF(B,10) ??

    3. Explain LOOP function. Is this similar to array in C++.

    Thanks again !

  • stockmrkking says:

    Hello,

    I would like to know how to call functions.

    Thanks

  • currencyandnifty.com says:

    ZERODHA TRADERS,WHO ARE IN NEED OF PROFITABLE STRATEGIES,CAN CONTACT US-MAIL TO:

    [email protected]

  • SanjeevChavan says:

    Hi Nithin,

    Could you please code the below strategy for me.

    For Long Entry:
    1. EMA(3) crossing EMA(13)
    2. ADX(14) greater than 20
    3. CCI(14) greater than 100

    For Exit
    1. candle closing below SMA(26) or
    2. CCI(14) less than -100

  • niftytrader says:

    HI
    ZERODHA
    can you code this ADX(10)is increasing for eg:- from 20 to 21 to 22……
    I just want a code to catch trades when ADX is increasing.
    THANK YOU

  • Sidharath says:

    Hi Sir,
    can u give me the buy and sell expression for the below strategy:
    # Calculate the x period simple moving average . Use the end-of-minute prices.. Let’s say it as reference_1.
    # Compute a point that is 1% above reference_1. Let’s call it as reference_2. E.g. If X period simple moving average is 6000, then ref_1 = 6000 and ref_2 = 6060.
    # Starting position = FLAT.
    # At the end of any minute, if price > ref_2, go LONG.
    # When position is LONG, at the end of any minute, if price < ref_1, close the long position.
    Anticipating great amount of support in this regard

  • Aquif says:

    Can you please help with expression in the following case

    Buy when previous RSI30. Also Current low< previous candle low. Sell when previous RSI>60 and current RSI Previous candle high
    Basically i would like to have expression to find RSI divergence

  • Das.Fuhrer says:

    Initiate long when the close is above 3day high average ( 3 HMA) and 3 day close average ( 3SMA) crosses above 8 day close average ( 8 SMA). (stop loss 3 day low average)—

  • Varesh says:

    Hi Zerodha,

    Could you please let me know if we have any feature/possibility to real time feed/EOD feed to excel sheet from Zerodha trader ? I need to know this to apply certain criteria and sort out stocks ahead of time before applying strategies into Algoz.

    Thanks.

  • SanjeevChavan says:

    Hi Nithin,

    Could you please code the below strategy for me.

  • chintamani says:

    Kindly advise us code for rsi(14) trendline breakage

    Buy:When RSI(14) DOWNWARD TRENDLINE IS BROKEN

    SELL:When RSI(14) upward trendline is broken .

    Regards.

  • jobin says:

    hi zerodha

    sir
    i dont know much about coding and all.i want o know one thing.
    in a particular scrip the Rsi crosses 70 or above the graph should show a sell signal and if the rsi is bellow the 30 should show a buy signal.how i can write it in a code style.For that what i have to do
    waiting for your replay job

  • abirk says:

    Hi Zerodha,

    Still waiting for the code of the following.

    Buy:
    Condition 1:When stochastics (8,3,4) %K>%D>20 and price crosses above the high of last candle. No buy if % K remains lower than 20 for atleast 5 candles.
    and
    Condition 2:When %K remains above 80 for atleast 5 candles and stochastics (8,3,4) %K>%D (Positive cross over)

    Sell:
    Condition 1:When stochastics (8,3,4) %K<%D<80 and price crosses below the low of last candle. No sale if %k remains abole 80 for atleast 5 candles.
    and
    Condition 2: When % K remains below 20 for atleast 5 candles and stochastics (8,3,4) %K<%D (Negative cross over)

  • jobin says:

    sir

    i dont know much about coding and all.i want o know one thing.

    in a particular scrip (if it is DLF) the Rsi crosses 70 or above the graph should show a sell signal and if the rsi is bellow the 30 should show a buy signal.how i can write it ina code style

    waiting for your replay
    job

  • GIREESHBABU says:

    SIR ,

    I WANT TO CODE THE BELOW SYSTEM :-

    INTRADAY SYSTEM – 1

    TURNING POINT = (Previous Close+Open+ATP)/3

    BUY – IF 5 MINUTE TIME FRAME CANDLE CLOSE ABOVE TURNING POINT , THEN PLACE BUY ORDER JUST ABOVE THE LAST 5 MINUTE CANDLE HIGH .

    EXIT – JUST BELOW LAST 30 MINUTES LOW .

    SELL – IF 5 MINUTE TIME FRAME CANDLE CLOSE BELOW TURNING POINT , THEN PLACE SELL ORDER JUST BELOW THE LAST 5 MINUTE CANDLE LOW.

    EXIT – JUST ABOVE LAST 30 MINUTES HIGH .

    INTRADAY SYSTEM – 2

    BUY – IF 5 MINUTE TIME FRAME CANDLE CLOSE ABOVE PIVOT POINT . THEN PLACE BUY ORDER JUST ABOVE THE LAST 5 MINUTES CANDLE HIGH .

    EXIT – IF 5 MINUTE CANDLE CLOSE BELOW LAST SUPPORT LEVEL.

    SELL – IF 5 MINUTE TIME FRAME CANDLE CLOSE BELOW PIVOT POINT . HEN PLACE SELL ORDER JUST BELOW THE LAST 5 MINUTE CANDLE LOW.

    EXIT – IF 5 MINUTE CANDLE CLOSE ABOVE LAST RESISTANCE LEVEL.

    THANKS IN ADVANCE

  • SASIMENON says:

    Zerodha,

    Why should we take Amibroker,when we have ZT with ALGOZ ? For a Daytrader?
    Can we fully automate your strategies given with Algoz ,in a Dealer terminal with Zerodha,if it is sucessful and backtested ?

  • Roy_Miller says:

    Hi,

    As i dont have enough time to trade so is there any trader who can trade in my account or else they can write script & set the algo z in my account…..

    waiting for your reply.

    [email protected]

  • SASIMENON says:

    Zerodha,

    If I get Trader terminal ,can I trade fully automated,using simple strategies with ALGOZ ?
    How much will be cost of Amibroker software ,plus plug in, Data, monthly for 5 scrips ?

    pls reply

  • abirk says:

    Hi Zerodha,

    Waiting for the code of the following.

    Buy:
    Condition 1:When stochastics (8,3,4) %K>%D>20 and price crosses above the high of last candle. No buy if % K remains lower than 20 for atleast 5 candles.
    and
    Condition 2:When %K remains above 80 for atleast 5 candles and stochastics (8,3,4) %K>%D (Positive cross over)

    Sell:
    Condition 1:When stochastics (8,3,4) %K<%D<80 and price crosses below the low of last candle. No sale if %k remains abole 80 for atleast 5 candles.
    and
    Condition 2: When % K remains below 20 for atleast 5 candles and stochastics (8,3,4) %K<%D (Negative cross over)

  • SASIMENON says:

    Zerodha,

    pls arrange a seminar or demo with your kerala office to clarify all our doubts, who is the right person in Kerala,to get a Demo on Amibroker,Nest pulse,features and advantages?
    OR pls call me on 9495716716-SASIMENON.a ZERODHA trader.

  • SASIMENON says:

    Zerodha,

    1.Where would I get Amibroker,to get fully automated,How much it will cost?and the procedures?
    2.Full automation through Amibroker includes execution of trades through strategies or conditions for the day,or expiry ?
    3.Can I use ALGO strategies with Amibroker

    Pls help me to learn and earn Awaiting for your reply soon.

  • SASIMENON says:

    Pls reply these questions,

    1.Can I use the NISM certificate,of other person as my authorised dealer,to take fully automated Terminal,in my trading a/c
    2.Can I trade on cash,f&O,and currencies,with automated terminal with that certificate,in my trading a/c
    3.Can I trade on different strategies on different scrips and sectors,on fully automated terminal.
    4. How many days it will take,to get it fully automated,if I have already a trading a/c with zerodha.
    5.Should I become an AP/SB,or the Dealer ? to get an automated terminal on my trading a/c.in such a case?

    Awaiting for your reply pls

    with regards,
    sasirammenon.

  • abirk says:

    Hi Zerodha,

    Just to modify the strategy a bit

    Buy:
    Condition 1:When stochastics (8,3,4) %K>%D>20 and price crosses above the high of last candle. No buy if % K remains lower than 20 for atleast 5 candles.
    and
    Condition 2:When %K remains above 80 for atleast 5 candles and stochastics (8,3,4) %K>%D (Positive cross over)

    Sell:
    Condition 1:When stochastics (8,3,4) %K<%D<80 and price crosses below the low of last candle. No sale if %k remains abole 80 for atleast 5 candles.
    and
    Condition 2: When % K remains below 20 for atleast 5 candles and stochastics (8,3,4) %K<%D (Negative cross over)

  • Trade_Upaghupta says:

    Hello,
    I had a previous post without an answer, i guess because i may have not expressed myself very well. Anyway, if you can help me with that i will very much appreciate. I have read previous posts on this blog and found something similar to what i want to do. The i saw here is Close>EMA(HIGH,40) AND EMA(HIGH,40)-CLOSE<2. If i understood it well, in this code, the buy entry will happend when the difference between the EMA (HIGH,40) and the last closing price is no greater than 2 points. I want to do something similar, but im not sure on how to write the code. I want to buy when the price of the last candle touches the EMA (CLOSE,17) and the current candle open with no more than 10 points of difference to the EMA (CLOSE,17). Also, i would like to sell when the price pierces the upper bollinger band. Please, could you kindly help me?

    Thanks

  • vindgatta says:

    Hello NIthin,

    please share me strategy(code) for below script.
    Buy:For RCOM Future ( just example )
    If 14 EMA cross over to 42 EMA with above average daily volume with target of 0.50 praise and stop loss will be cross over of 42 EMA to 14 EMA.

    Regards,
    Vinod

  • KEERTHI.S says:

    HI,

    CAN YOU WRITE A CODE FOR THE FOLLOWING STRATEGY FOR INTRADAY NIFTY FUTURES FOR 1 MIN INTERVAL.

    BUY SIGNAL. WHEN STOCHASTIC OSCILLATOR %K CROSSES %D FROM BELOW AND RSI IS BELOW 40.

    SELL SIGNAL. WHEN STOCHASTIC OSCILLATOR %K CROSSES %D FROM ABOVE AND RSI IS ABOVE 60.

    BUY : SOPK(9,3,9,EXPONENTIAL)<SOPD(9.3.9,EXPONENTIAL) AND RSI(CLOSE,14)<40

    SELL : SOPK(9,3,9,EXPONENTIAL)>SOPD(9,3,9,EXPONENTIAL) AND RSI(CLOSE, 14)>60

    IS THIS CORRECT? OR

    BUY : CROSSOVER(%K,%D) AND RSI(CLOSE,14)<40

    SELL : CROSSOVER(%D,%K) AND RSI(CLOSE,14)>60

    THANK YOU

  • Sameer_Trader says:

    How to get the price at which last signal was generated?
    for example, how to code : exit long when close is below (LONG_PRICE – 50)?

  • Sameer_Trader says:

    Can I run the stratergy on two different scripts simulaneosly?

  • Sameer_Trader says:

    Will the Algo script running, consider the carry over positions? Suppose I carried a long position from previous trading day, then will the script genate exit signal for that carried over long position?

  • Trade_Upaghupta says:

    Hello, i would like to know if the following strategy can be coded:

    Thanks

  • Trader_Junior says:

    Dear Zerodha,

    I would like to know if the following strategy (or something similar) could be coded:

    The idea is to scale-in the trades as price action runs in our favor, to maximize profits due to proper pyramiding, decreasing the impact of unprofitable trading decisions. The script would have to do something like that (Doesnt have to be exactly this but something similar that could be transformed into a code):

    Buy at market price and place 3 further pending orders
    Sell at market price and place 3 further pending orders
    Place a buy stop order at the high of the previous bar and 3 further pending orders
    Place a sell stop order at the low of the previous bar and 3 further pending orders

    Some other facts you should know:

    The first trade has a risk allocation of 2%.
    All further pending orders decrease in lotsize to avoid overbetting.
    All orders have an ATR-based stop-loss. Default is ATR(30)*2 from the opening price.
    All pending orders have an ATR-based distance between them. Default is ATR(30)/2.

    Here are some images:

    Thank you in advance

  • Dk0046 says:

    Hello,
    I am trying to verify some strategies with manually vs alogz.. Here is what I am finding disconnects and need your help to understand the problem. First the expression.. simple one for this e.g.:

    Buy Expression: RSI(CLOSE, 21) <40
    Sell Expression: RSI(CLOSE, 21) >60
    Exit Expression: 0

    Chart Type:
    Historical 1 year data (EOD) for NIFTY Future Sept 13
    The first trade it is showing as:
    01/04/2013 12:00:00 AM SHORT 6048.0000

    While as per the data table the first trade should be much earlier, see the row from data table:
    Date RSI(21)

    NIFTY13SEPFUT 07-11-2012 00:00:00 5760.0500 5818.8000 5742.5000 5793.2500 237543 59.4483
    NIFTY13SEPFUT 08-11-2012 00:00:00 5744.7000 5776.8000 5740.0000 5765.2000 186408 60.8500
    NIFTY13SEPFUT 09-11-2012 00:00:00 5756.2000 5782.1000 5702.6000 5720.6000 211739 58.6069

    So as per the Data table the first short should be on Nov. 6, 2012. I plotted RSI(24) on the chart

    Please help to understand the problem.
    Regards

  • Dk0046 says:

    Hello,
    is there any way I can get alert in email or SMS based on the technical triggers like RSI > 70?
    Thanks

  • Dk0046 says:

    Hello,
    I suspect RSI calculations are not correct by NEST. It seems it shows the RSI value of previous period. For e.g, for NIFTY it is showing RSI(21) – Daily at 57.95 at the end of today (Sept 19), while my own calculations and calculations of another source (investing.com), this value is of Sept 18. Today’s value is 63.23 and I assume it will the value tomorrow (at the end of Sept 20). Please check as it impacts the results of many strategies.
    Thanks

  • Dk0046 says:

    Hello,
    I want to back test my strategy of 5 minutes time interval over 1 year of data. How can I do that?
    Thanks

  • Dk0046 says:

    Hello, How can I write a script that first wait for one signal and then second, for e.g. I want to write a script where I wait for RSI(CLOSE,21) < 30 and then EMA(CLOSE,3) < CLOSE. I can't put AND in between as by the time EMA(CLOSE,3) < CLOSE RSI is probably > 30.
    Thanks

  • abirk says:

    Hi Zerodha,

    I am new in Zerodha and would like to have my Algoz activated.
    Account number DA1153.

    Also would need your help to code the following two strategies

    Strategy1:
    Buy : When 5ema (close) crosses over 13ema (close) from below and in stochastics (8,3,4) %K>%D>20
    Buy Exit: When %K<%D< 80

    Sell: When 5ema (close) crosses below 13ema (close) from above and in stochastics (8,3,4) %K<%D<80
    Sell Exit: When %K>%D>20

    Strategy 2:

    Buy: When stochastics (8,3,4) %K>%D>20 and price crosses above the high of last candle
    Buy exit: When price pierces upper bollinger band (20,2) and price crosses below the low of last candle after touching the higher bollinger brand

    Sell: When stochastics (8,3,4) %K<%D<80 and price crosses below the low of last candle
    Sell Exit: When price pierces lower bollinger band (20,2) and price crosses above the high of last candle after touching lower bollinger band

    Egarly looking forward to your reply. Also, it would be great if you can backtest and suggest about the strategies.

    Regards,

    Abir

  • balu_2903 says:

    Hi
    Hi,

    As per your previous reply

    It would have been great if there was no user confirmation for the placed algoz strategy, because many users will not be able to sit completely in-front of the system.

    please suggest the below changes in software.
    Or (confirmation message can be made as optional in the settings )-
    or Alert messages should be send as SMS to the registered mobile number.

    Thank you

  • Ajit says:

    Hi Zerodha,

    Is there any way in NEST trader, to change the % required in Study lines > Fibonacci retracements tool.?

    Currently 0%,38.2%,61.8%,76.4%,85.4%,91.0%,94.4% & 100% are available. For example; if I don’t want the 85.4%,91% and 94.4% (remove), instead need to add 88.6%, is it possible.?

    Please advise.

    Thanks & Regards,
    Ajit

  • balu_2903 says:

    Hi,

    1. I have written the algoz code in the attached screenshot for
    buy signal when 3 EMA break 15 EMA and RSI(14) > 30
    sell signal when 15 EMA break 3 EMA and RSI(14) < 70. Please let me know if any mistake from below code. CROSSOVER(EMA(CLOSE, 3), EMA(CLOSE, 15)) AND RSI(CLOSE, 14) >30
    CROSSOVER(EMA(CLOSE,15), EMA(CLOSE, 3)) AND RSI(CLOSE, 14) < 70 2. I would like to know how this strategy is executed ? whether this strategy is executed automatically or it just gives alert message ? ( because buy signal already generated long back according to my Time frame 30 min chart) 3. would the strategy be live all the day ?

  • sathishprakash says:

    NSE F&O – 15 Minuts Candel Chart
    ———————————————-

    Get First 15 minutes close price and open price – find whether the close price is above or below open price. If it is below, then consider it as 1st DOWN or if it is above, then consider it as 1st UP
    Get the next 15 mins close price.
    Use the 1st 15 mins close price and compare with the next 15 mins close prices. If the next close price is below the 1st close price, then consider it as 2nd DOWN and use this close price for finding the next DOWN close price. If close price is above the first close price, then consider it as 2nd UP close price.
    Find the next close using the last DOWN close price, till it becomes 3rd DOWN.
    Like point 5, calculate for 3rd UP.
    If any stock becomes 3rd DOWN, then check for next open price, if the DOWN stock goes down, then short the stock or if it goes above buy the stock
    Condition for BUY -> 15 paise up for 100 rupees.
    Condition for SELL -> 15 paise down for 100 rupees.

  • vin says:

    Buy exit will Active only and after BUY Expression satisfied right? If yes then can i pass/set the data or variable of BUY expression to Buy-exit expression?

  • vin says:

    HI..
    How to write buy exit expression after buy-alert (buy price+10)
    i mean how to set buy-alert price which is executed on condition in Buy-exit expression?

    Pl. help me to write this BUY-exit expression?

  • rehman says:

    HELLOW ZERODHA .PLEASE HELP ME TO WRITE THE STRETEGY.

    BUY IF THE NEXT
    CANDLE CROSES ABOVE THE FIRST CANDLE WHICH WAS CLOSED ABOVE 21SMA. EXIT BUY WHEN
    CROSING BELOW THE LOW OF THE FIRST CANDLE (WHICH WAS CLOSED ABOVE 21
    SMA).
    AND SELL WHEN THE NEXT CANDLE CORSING BELOW THE FIRST CANDLE WHICH WAS
    CLOSED BELOW 21SMA. EXIT SELL WHEN CROSING ABOVE THE HIGH OF THE FIRST CANDLE
    (WHICH WAS CLOSED BELOW 21SMA).EXACT AND EARLYH REPLY
    EXPECTED.

    FAZULUR REHMAN

  • SASIMENON says:

    How can we write a strategy on following conditions

    1.Buy above 5500 and sell below 5495
    2.Buy above first minute open price and sell below first minute open price ( First 5 minutes also)
    3.Buy above ATP of a particular time (11.am ) and sell below ATP of a particular time( ATP =Average Traded Price)
    4.Buy above price goes above 100 sma and sell below price goes below 150 sma
    5.Buy above the previous close and sell below the previous close
    6 Buy above the previous high and sell below the previous low

    pls give me the 6 strategies

  • SASIMENON says:

    HI, ZERODHA,

    All the Backtest results are wrong,then what is the use of it,whenever you give backtest result for a period,the result should include all the trades taken place,most of the times the result start in between.
    For eg. if showing Backtested from 08/12/2013 to 08.30.2013,a specific period , software must show all the trades taken place from 12.08.13 to 30.08.13.But software is showing the trades from 20.08.13.does not give you the result of your strategy
    when I enquired your people told me ,the result inclusive of 1 trade even,But I can show you no backtest result is getting even if there are 3-4 trades within your backtested period,this is a very serious problem ,
    As long as this is a free software,we have to be satisfied,what you give,but we are putting the errors and problems,facing daily as zerodha traders.
    If you dont want our suggestions ,we can stop comments.we hope, this to be the best error free,india ‘s No.1 software to trade,and all traders should make use of this.

  • Chenna says:

    Thanks Zerodha for having algo trading. Please help me with the code for below logic.

    This code is based on 1 minute candle and is based on 2 sets of EMA crossover only.
    logic for buy entry :
    one minute EMA(90) crossing over one minute EMA(390) ( meaning the previous minute ema 90 is less than ema 390) and the ema(90) should also be greater than ema(150)
    logic for sell entry :
    one minute EMA(90) cutting down one minute EMA(390) ( meaning the previous minute ema 90 is greater than ema 390) and the ema(90) should also be less than ema(150)

  • SASIMENON says:

    Can we put the previous close value in our strategy ,as you mentioned? OPEN < 5300 * 0.99 ,in 1 minute or 5 minute?
    can we put our value ,if we want to buy if market opens above 5400 like this, OPEN > 5400 * 0.10,IN 1 min. or 5 min.

    pls explain, how can I write my strategy,if I want to sell nifty future opens 5 points below 5400 on monday ?
    And if I want to buy nifty future if opens 5 points above 5400 ? why sma 1 is not working and not getting backtest result?

  • chintamani says:

    Is there anyway to convert Metastock formulas in Algoz format?
    Not manually…
    If there is any…pl advise.
    Regards

  • chintamani says:

    IN ZT-ALGOZ-MY STRATEGY- Edit option is available but live is not .
    What is to be done?
    ZT VERSION IS-3.10.57.97.7 .
    Pl help.This is a frequent happening.
    Regards

  • niftytrader says:

    hi zerodha
    i have a question how to take position based on gap up or gap down at open. if it possible using algo z please give me codes for these two strategies
    1) taking position for long side or short side based on gap up or gap down at open.
    2) avoiding taking any position if there is gap up or gap down at open.
    thank you

  • Das.Fuhrer says:

    Hey!! I want to code the following strategy.
    I use the following indicators when trading for an Intraday.

    – 8SMA and 34EMA
    – STOCHASTIC with 0.15 and 0.85

    BUY
    – When 8SMA crossed above 34EMA and STOCH is above 0.85, Go Long and Exit when the 2 MAS crosses again.

    – When 8SMA crossed below 34EMA and STOCH is below 0.15, Go Short and Exit when the 2 MAS crosses again.

  • subhashlive says:

    Dear Sir,

    i have newly account opened client to zerodha.. and my strategy was that follows……….

    for Buy:
    SMA CROSSOVER(SMA(CLOSE, 5), SMA(CLOSE, 12))

    for Sell:
    SMA CROSSOVER(SMA(CLOSE, 12), SMA(CLOSE, 5))

    for Buy Exit:
    0

    for Sell Exit:
    0

    what my problem was:
    my strategy not shows a proper exit to cut the profit..
    i want a proper exit strategy for exiting our profit..

    and another one is that

    i want to combine one extra strategy is that directional movement index….follows:
    for long:
    DIP (21) > DIN (21) AND ADX (21) > 25
    for short:
    DIP (21) < DIN (21) AND ADX (21) > 25

    how to combine the moving average crossover system with the direction movement index system.

  • iVaibhav says:

    Hi Nithin,

    I would like to know if a Keltner Channel overlay is available? If not then is their a way I can code it (Create the indicator). I prefer readings of 20 and 2 on Keltner channel.

    Calculations:

    There are three steps to calculating Keltner Channels. First, select the length for the exponential moving average. Second, choose the time periods for the Average True Range (ATR). Third, choose the multiplier for the Average True Range.
    Middle Line: 20-day exponential moving average Upper Channel Line: 20-day EMA + (2 x ATR(10)) Lower Channel Line: 20-day EMA – (2 x ATR(10))

    Please suggest how I can chart the above?

  • Nasrudeenh says:

    Dear Sir,

    I use 10 day simple moving average to initiate trades. My strategy is as follows:

    Buy if price moves up from below and crosses 10 SMA of yesterday;
    Sell if price moves down from above and crosses 10 SMA of yesterday

    For example:
    Nifty Futures Contract closed yesterday at 5600 and the 10 day SMA of Nifty Future at market close yesterday was 5500. So, today I would intiate short only if Nifty breaks below 5500.

    However, your system initiates trade by calculating 10 day SMA starting from the live market hours which is not my strategy. The code should look like this:

    CLOSE > SMA(CLOSE OF YESTERDAY,10)

    Kindly help me code the strategy as mentioned above.

    Kind Regards,
    Nasrudeen

  • DD0231 says:

    I am learner of AlgoZ Trading . Can anybody help me regarding this strategy.
    I want to

    1.>Sell 5 Lots of Nifty-5800-29-August-PE within 26th August at some predefined value say Rs.450.

    2.> If (1.) executed within 26th August 3.10 p.m, Sell 6 Lots of Nifty-5500-29-August-PE @ Market price , just after (1.) executed.

    3.> If (1.) and (2.) will not executed within that date @ 3.10 p.m , then SELL bot 5800-PE and 5500-PE ; at the market value of that day after 3.10 p.m

    4.> After any of the (1,2,3) orders are executed then , within that money, I want buy some Lots of Nifty-5700-26-Sep-CE s , investing maximum Rs. 1,00,000 @ market value within 26th August 3.29 p.m.

    Can anybody help me , what will be the script or commands , I will give ?

    My email is [email protected]

    With Regards…………
    D. Pal

  • debjani says:

    Thanks for the code. But the code seems not working. When put to back test, script error displays ” Error: undefined variable ‘HAOPEN”.

    Please help.
    Regards,
    Debjani.

  • deepa says:

    Hi, Firstly I want to congratulate ZEROdha for providing us this platform.
    1. I wanted to add CCI over CCI, like wat we do with Stochastics in different parameters and I have failed to figure out a way to do it.
    2. Is there a way to enter both buy and sell at same point instead of going back and filling the order form again, Say If i want to buy NF @ 5700 and sell the same when it reaches 5710

    and ya congrats on reaching 3rd anniversary 😉
    cheers,

  • debjani says:

    Hi Zerodha,

    Please provide code for the following

    1.PRICE STYLE : HEIKIN ASHI
    2. BUY EXPRESSION:
    Heikin Ashi Close> Heikin Ashi Open and Ref(Heikin Ashi Close,1)>Ref(Heikin Ashi Open,1) And Heikin Ashi Close>SMA(Close,10)
    3. BUY EXIT EXPRESSION
    0
    4.SELL EXPRESSION:
    Heikin Ashi Close< Heikin Ashi Open and Ref(Heikin Ashi Close,1)<Ref(Heikin Ashi Open,1) And Heikin Ashi Close<SMA(Close,10)
    5.SELL EXIT EXPRESSION:
    0
    Regards,
    Debjani

  • accatehr says:

    Hi,
    I wanted to enquire whether it is possible to allow the system to trade entirely by itself once a script is running, rather than it giving prompts and then requiring us to take the action.

  • Banti says:

    Will you please tell me Whether following A & B Expressions are same(Equal) for Algo trading if Not please elaborate each Expression

    A) Buy Expression: EMA(Close,3)>EMA(Close,6) AND EMA(Close,6)>EMA(Close,9) AND EMA(Close,3)>EMA(Close,9) AND MACD(15,8,5,EXPONENTIAL)>MACDSIGNAL(15,8,5,EXPONENTIAL) AND RSI (CLOSE, 14) >54

    Regards,
    Banti

  • accatehr says:

    Hi,
    I wanted to make use of the price at which the script purchases a scrip as an argument for further processing. Is there any possible way that I could get the price at which the script purchases a security ?
    Thanks in Advance. Am sure someone could help me out.

  • SASIMENON says:

    Zerodha,

    If I take fully automated dealer terminal ,can I add my zerodha clients to follow my strategy,with their requests to allow them with sufficient margin ? pls give the reply in detail
    2. The fully automated algo trading terminal is different from Nest Trader without i3 ?

  • appan says:

    applying strategy to 30 symbols every time i login is very time consuming task is there any solution for that,like sve applied strategy and symbol for next time?

  • chella says:

    Dear Sir, Please suggest me some means to tackle situation similar to the one mentioned below?

    Nifty closed @ 5677.9 on 02-08-2013 (Friday). I was having a view that ‘downward momentum is building in the index and it can head lower to 5566 and then 5430’ and also that ‘If there is rebound early next week (i.e this week) the index can move upto 5818 or 5850’.

    On Monday 05-08-2013, Nifty open -5682, High-5721, Low-5661, Hence, when High 5721 was reached I thought there is a rebound and accordingly I took position at that level. But Nifty closed at 5685 on that day. Next day, i.e on 06-08-2013 it declined and reached the target of 5566. Hence, there was a loss for me. (I took positions correspondingly in Index futures).

    In such a scenario what shall I do? Whether short term reversal mentioned as above could be confirmed from the charts? Or there any other means? Or shall I have to wait and see the closing price even if that means an opportunity lost? Kindly enlighten me as I come across this problem many times.

    With regards,
    Chella

  • Banti says:

    1) Still I could not find any reply from Zerodha for the issue which I have raised for streaming value of RSI neither I have received call from technical team nor mail
    2) See attached Screen shot for Strategy tested results
    a) There are seven trades shown by system where in summary it shows only 6 Trades ( No of trades) whether system takes the trades only squared off
    (b)Largest loss 48.2 is shown by system But Why No of losing trades is 0 as there is one losing trade

    3) What is interpretation for EMA(Close,3)>EMA(Close,6)>EMA(Close,9) while back testing & going live option with above strategy it has given results & there is no problem observed, please elaborate

  • Srikant_Srinivasan says:

    Hi
    This is Srikanth (RS 0285). I want you to write my strategy. 20 day moving Average. Buy Above 20 day cross over. Sell below 20 day. Also Stchohastic ocillator K% 12, D% 3. Buy Above 12% / 20%. Sell After 85 to 90%. In ten minute time frame.

    Also I would like to thank you for providing low cost brokerage. Mr Nitin your valuable inputs on various topics. Also I would request you to improve your charting software. One small hitch is it dosent change according to the time frame. For example if you are in 1, 5, 10, 30, Minute time frame. The next candle does not change. Insted one single candle is displayed. I mean every time frame the candle has to change its position. Your support staff have been good. keep the good work going.

    Regards
    Srikanth

  • appan says:

    Is there any simple way to add same strategy for all symbol in my watch list like export from excel?

  • appan says:

    greetings,

    Buy Expression:-
    crossover(MACD(26,12,9,EXPONENTIAL),MACDSIGNAL(26,12,9,EXPONENTIAL))
    Sell Expression:-
    crossover(MACDSIGNAL(26,12,9,EXPONENTIAL),MACD(26,12,9,EXPONENTIAL))

    How can i add buy exit expression for 1% profit or 1% loss from the buy price and same for sell exit expression?

    Buy exit Expression:-?
    Sell exit Expression:-?

  • Bhushan says:

    Hi…
    I want code for this strategy….
    market price> yeasterday high then buy
    Market price< yesterday Low then sell

    Please give me code for this….
    also tell me how can i get the monthly results of at least 36 months for this strategy…..

    Thanks in advance…

  • Banti says:

    I Could able to see there is Error in RSI In my previous blog i have attached Images where RSI is not changing as per streaming value of Quote its getting changed only after interval which is of no use & you should take care of this
    1) see images 1 where there is Large red candle while RSI is not changed it remains 54.91 at 18:30
    2) It gets changed after completion of Candle See image 2 at 18:32 (RSI 33.25)
    3) Image 3 shows there is no streaming of RSI at 18.36 also it shows Same RSI 33.25
    4) Image 4 shows change in RSI when New candle gets generated

    Above Example shows that those who are using RSI will get wrong results & may not Exit if there strategy is based on RSI kindly look into this & resolve it at earliest

    My Strategy is As below
    if EMA3 crossesEMA6 & EMA 6 Crosses EMA9 with MACD Positive crossover &RSI>54 then I will buy
    My Buy Exit will be IF RSI >65 I will Exit

    I have coded as below please check & reply is it correct or not

    Buy Expression
    EMA(Close,3)>EMA(Close,6)>EMA(Close,9) AND MACD(26,13,9,EXPONENTIAL)>MACDSIGNAL(26,13,9,EXPONENTIAL) AND RSI (CLOSE, 14) >54
    Buy Exit
    RSI(CLOSE, 14) > 65

    Sell Expression
    EMA(Close,3)<EMA(Close,6)<EMA(Close,9) AND MACD(26,13,9,EXPONENTIAL)<MACDSIGNAL(26,13,9,EXPONENTIAL) AND RSI (CLOSE, 14) < 45
    Sell Exit
    RSI(CLOSE, 14) <35

    (A)Suppose I get buy signal pop up as per my strategy & I act on it with predefined stop loss & my Stategy is working as soon as RSI goes 65 will system automatically square off the buy position or will it show pop up again to square off & I need to click on it please confirm
    ( B) if I made profit I need to cancel my sell stoploss order Manually or will it get cancelled by system
    (C) In above case will system again shows buy order if RSI gets lower upto 56

    Kindly confirm
    Regards,
    Banti

  • Narendra says:

    Please give me the code for below strategy:

    Buy if 3 min ema is above 13 min ema and 13 min ema is above 34 min ema.

    exit long if 3 ema crosses below 34 ema.

    and vice versa for sell

    Thanking you

  • SameerG says:

    Hi,
    I want to develop a simple strategy on My AlgoZ platform.

    Time Frame – 30 Minute intraday Futures candles.
    – if Last > Open of each candle then Buy
    – if Last < Open of each candle then Sell
    – if Long the exit at closing price of the 30 Min candle
    – if Short then cover short at the closing price of the 30 Min candle

    Note:
    If the Last goes above and below Open price of the 30 min candle 10 times the position should change all 10 times.

    Kindly guide.

    Thanks!

    Sam

  • Nitin999 says:

    Where i can get the data of advances issues and decline issues ?
    or we have charts of the same ?

  • Nitin999 says:

    Please tell the code for :

    ALERT TO BE GENERATED ON 3 MINUTE CHART.

    for Nifty

    Sell condition MACD -ve Crossover

    then semi-auto sell will be 5 points below the closing bar (the bar how satisfied condition of sell ) and SL will be the top the same bar.

    Buy condition MACD +ve Crossover

    then semi-auto buy 5 points above the closing bar (the bar how satisfied condition of Buy ) and SL will be the bottom the same bar.

  • Nitin999 says:

    Please tell the code for :

    ALERT TO BE GENERATED ON 3 MINUTE CHART.

    for Nifty

    Sell condition
    MACD -ve Crossover and CCi below 0 (Zero ) line

    then sell 5 points below the closing bar (the bar how satisfied condition of sell ) and SL will be the top or 5 points above the same bar.

    Buy condition ( for Buying call )
    MACD +ve Crossover and CCi above 0 (Zero ) line

    then buy 5 points above the closing bar (the bar how satisfied condition of Buy ) and SL will be the top or 5 points top of the same bar.

  • Nitin999 says:

    Please tell the code for :

    ALERT TO BE GENERATED ON 15 MINUTE CHART.

    Short Sell

    CCI ( commodity channel index ) Period 14 is crossing +100 downside or CCI value Less than +100 and MACD -Ve Cross over

    for Long

    CCI ( commodity channel index ) Period 14 is crossing -100 upside or CCI value greater than -100 and MACD +Ve Cross over

  • tirumal says:

    Dear sir nithin kamath

    please mack code for this stratagy

    for buy
    if price above 60ema and 42-RSI-40 level above then buy

    and for sell
    if price below 60ema and 42-RSI 60 level below then sell

    br
    tirumal

  • chintamani says:

    Please tell the code for :

    ALERT TO BE GENERATED ON 1 MINUTE CHART.

    RSI-CLOSE-14 PERIOD ON 5 MINUTE CHART IS >60 AND
    RSI -CLOSE-14 PERIOD ON ONE MINUTE CHART IS <30

    WHEN RSI ON ONE MINUTE CHART IS LESS THAN 30-PLEASE GENERATE THE ALERT.

    REGARDS.

  • vijayve says:

    Like DHIGH(2) and DLOW(2) , are there functions for previous day’s OPEN and CLOSE ?

  • SASIMENON says:

    Zerodha,

    Can I give a code for my strategy? like this?

    For example. REF A = EMA(Close,13)>EMA(Close,50).
    REF B = EMA(Close,13)<EMA(Close,50)

    Buy expression REF A

    Sell expression REF B

    OR SOMETHINGELSE ? pls give me an answer at the earliest.

  • Sim says:

    Hi Zerodha,

    Could you please help me code with the following:
    Buy: PSAR crosses above price, MACD above signal line, RSI less than 40, AROON > 70
    Sell: MACD below signal line

    I did try some expressions with the info above, but strangely they do not show signal points where they ought to be as per my criteria.

    Best regards,
    Sim

  • debjani says:

    Zerodha,
    As stated earlier, have you introduced next version of Z Trader in place of present beta version? If not,please mention the expected time when next version will be introduced.
    Regards,
    RD

  • NSK says:

    Sir,
    I have back tested the following strategy:

    Buy : CROSSOVER(CLOSE, PSAR(CLOSE, 0.02, 0.2)) = TRUE (Close > PSAR)
    Sell : CROSSOVER(PSAR(CLOSE, 0.02, 0.2), CLOSE) = TRUE (Close < PSAR)

    The above mentioned strategy generated few buy sell signals. To check I have added PSAR indicator (0.02,0.2) in the chart. The signals generated by the back test results are not matching with the signals generated in chart by indicator. Please clarify.

  • NSK says:

    Please provide code for the following
    A = ((Previous High + Previous Low)/2)+10
    B = ((Previous High + Previous Low)/2)-10
    Buy if close (current) cross above B from bottom
    Sell if Close (current) cross below A from Top

  • currencyandnifty.com says:

    zerodha,

    when we go live ,there is a window,we have to select execution period,product type,

    Can this software keep our strategy , as GTC ( good till cancel) so that we can avoide login everyday , on automated trading.If the margin is sufficient the trades will automatically take place according to the strategy

    Which one , NISM or NCFM is sufficient for your dealer terminal ?

    pls reply at the earliest,delayed replies ,block this blog active———–

  • aj2013 says:

    hi i need help in coding my strategy
    time frame 5 min
    buy / exit short: when two consicutive close above ema of high for period 144

    short / exit long: when two consicutive close below ema of low for period 144 thanks

  • vijayve says:

    Is there any incentive if I share ALGO Z strategies?

  • niftytrader says:

    HI
    ZERODHA
    can you code
    for buy
    after 3 pm price above 10 MA
    in above comments i know that time based strategy is not formed but as in one comment i read using candle close we can do that i use 5 min candle please help in that

  • akh64bit says:

    Hi Zerodha,

    Yesterday I had sent report(contract note and Screenshots) where false signals were generated during live hours from pulse. I had lost 22000 on 24 June because of that. I had also put Nithin in cc. Could you please let me know what went wrong? I also see many people complaining that false signals are generated during live hours. Is the AlgoZ reliable? I am in touch with Omneysys regarding this but could you also look into it? A little effort from your side would be helpful for traders like me.

    Best regards,
    Akhilesh

  • basu says:

    A big thank you and thumbs up for your team’s efforts.
    I have some request for coding my MT4 strategy into AlgoZ, so that i can benefit from that.
    My strategy is as below:
    Buy:
    1.) CLOSE> 5EMA displaced by 5 periods forwars2.) 4EMA -5EMA positive crossover3.)RSI should be above 50 and should be above the signal line (or whatever you can suggest with RSI, MACD, STOCH etc will be most welcome.)
    Buy Exit:
    If close < last 5 bar low.
    Sell:
    1.) Close< 5EMA displaced by 5 periods forward. 2.) 4EMA-5EMA negative crossover3.) RSI should be below 50 and should be below the signal line.
    Sell exit:
    If close> last 5 bar high

    I am attaching a snapshot of my MT4 chart for better understanding.
    I would be highly thankful to you guys if you get it done….

  • currencyandnifty.com says:

    Yes,I agree with Niftytrader,I have some suggestions for the ALGOZ.

    1.Backtest results are not same as live signals,on any timeframes,you can test,I have tested.
    2.Backtest results are not as per your specified period given on result window on any timeframe.
    3.If you specify a period from 03.06.13 ,pls show the result from the next signal onwards,as per strategy and dont show the signal and result in between,will mislead the backtest result
    4.we are not getting backtest results for the same strategy working , if there is 1 or 2 results on higher timeframes.
    5.Occassionally we have lost ,the strategies that we have saved on NESTTRADER.

    pls consider this as the suggestion of a wellwisher,and not as a critic
    we expect the best ,from you ,we know you can do it.

  • niftytrader says:

    hi
    i have coded above strategy using your comments on above query by other folks on this page but i am very disappointed with ALGO Z. I say NAAM BADE AUR DARSHAN CHHOTE which i think suits best for ALGO Z but on expected lines a free product work like that only.
    ALGO Z is working very fine and showing good results in back testing as per my strategy it works well and given signal only when it occurred but when i take it live then what a disaster happens to ALGO Z it started giving false signals it has given almost 20 false signal to me thank god i am using semi automate version other wise i may be bankrupted today and after market close i again back test to see weather it gives this signal again or not and i am surprised it has only given one signal which is as per my strategy so i want to know why ALGO Z has not working good in live mode and giving false signals please rectify this problem in this product and make it more professional so that retail traders can take advantage of that
    thank you
    hope to see some improvement in this product in future
    and one thing i have to only relay on my eyes and brain not on this ALGO Z

  • niftytrader says:

    hi
    ZERODHA

    code this strategy for me
    for buy
    5 minute candle close above 5 MA and 20 MA and in stochastic oscillator %K above %D and ADX above 20
    thank you

  • Rahul123 says:

    Sir,

    I have less knowledge about coding. So please explain in little simple words. Firstly, I want to know which software do I need to run the code?

    Secondly, I want alerts only. When price pierces upper or lower bollinger band on 30 mins or Dly TF, I want an alert.

    Third, to get these alerts, should the chart be open?

    Thanks,

    Rahul

  • currencyandnifty.com says:

    Here i am sending the chart of Colgate.of-17-06-13. There are 4 trades on red line but, the back test results are not found so please check out-

  • currencyandnifty.com says:

    Zerodha,

    Your backtest results are not getting properly,

    How many trades should be there minimum to get the results ? 4 or 5 ?
    Today showing the results from 27-05-13, but not getting the results as you see on the charts
    pls clear my doubts

  • vin says:

    HI Zerodha,

    I want to write code for Nifty Fut. Buy@ open with 10 points SL?

  • Mitch says:

    Hello,
    I need to code the strategy where
    buy when william % is lesser than -80 and heikin ashi candles is green
    and sameway
    sell when william % is greater than -20 and heikin ashi candles is red
    Also how do i write code for
    buy when william % is <-80 and sell when its value is 5 points lesser than previous one. (say if its current value is 60 and than i want to sell it if it comes to 65)
    Do we have ichimoku kinko hyo?
    Thanks

  • Deepakambawata says:

    Hi Zerodha,

    I wanted to know more about Algoz and wanted your help in building a strategy. Please help me out with the same

    1. buy – when 13 ema crosses 50 ema with the 20 paisa price filter
    2. sell – when 50 ema crosses 13 ema with 20 paisa price filter

    required in 5 min time frame…

  • Shaan says:

    Kindly code this strategy for me…

    Strategy 1:

    Enter at the 50 points above or below the open price for Bank Nifty. And Keep trailing the SL to 50 points.
    After it exits, again the entry would be 50 points above or below. (50 points above Long and 50 points below short)

  • SASIMENON says:

    CAN YOU CODE BELOW STRATEGIES.

    1.BUY( LONG) ABOVE OPENING PRICE

    SELL (SHORT) BELOW OPENING PRICE

    2.BUY (LONG) ABOVE AVERAGE TRADED PRICE (ATP LINE)OR WEIGHTED AVG.

    SELL (SHORT) BELOW (ATP LINE) OR WEIGHTED AVG.

  • sudhir285 says:

    dear siir
    1si startegy -ema 8/18 crossover after that buy & sell sighal &sl previous candel s high=low &macd 12/26/9 when rsi is above 40 buy it &below 60 after sell it pl. advise me how to wrie this code dear sir iam not a pl. yo adivce me also which strategy is sutaible 7strategy provider is avaliable pl. told me
    with regards
    sudhir biranje
    8087566996

  • currencyandnifty.com says:

    sir,

    1.can i make a strategy on 2000 sma on 1 min. in this version?
    2.is it limited to 1000 now?
    3.can you provide us in the next version atleast ?
    4. we have a group of traders waiting for it,so pls provide 2000 sma , atleast on 1 minute chart.

    pls give me a reply at the earliest.

  • Sebu says:

    how to write a code to add two closing price at specific time, X=close at 10:30:59 am + close at 2:05:59

  • kklkanna says:

    when can we expect algoz in mcx . next version of algoz??

  • prabhu-max says:

    sorry i posted the backtest signals for 45 sma rejection in seperate comment

  • prabhu-max says:

    sir i want to code for buy when 45 sma rejection occurs. when i enter the following code, it shows entry signals at wrong places

    buy: (sma(close,45)>ref(1,low))and ( close>sma(close,45) )

  • Sid says:

    Hi Zerodha,

    A quick question: is there any possibility of getting the Super Trend Indicator onto the Intraday and Historical Charts on Nest Trader / Nest Plus?

    Please let me know.

    Thanks,
    Sid

  • currencyandnifty.com says:

    Yes I see the backtest result and the live popup rates are different on the same strategy.pls clarify,

    You can conduct a monthly workshop for zerodha traders, on working days ,in zerodha branches to clarify the doubts,and disscuss these kind of problems,and open a new window to handle these issues.

  • chintamani says:

    Hi The strategy is given below with the logic.

    Please advise if it is correct in programming language or otherwise.

    Strategy: Buy Expression-0
    Buy Exit Expression-0
    Sell Exit Expression-0

    Sell Expression-

    HIGH>=OPEN AND
    OPEN>CLOSE AND
    CLOSE>=LOW AND
    LOW<REF(LOW,1) AND
    CLOSE<REF(LOW,1) AND
    CLOSE>=REF(OPEN,2) AND
    REF(OPEN,3)=REF(OPEN,2)AND
    REF(HIGH,1)>=REF(OPEN,1) AND
    REF(OPEN,1)>=REF(CLOSE,1) AND
    REF(CLOSE,1)>=REF(LOW,1) AND
    REF(LOW,1)>=REF(OPEN,2) AND
    REF(HIGH,1)<=REF(CLOSE,2) AND
    REF(HIGH,2)>REF(CLOSE,2) AND
    REF(CLOSE,2)>REF(OPEN,2) AND
    REF(OPEN,2)>REF(LOW,2) AND
    REF(HIGH,3)>=REF(OPEN,3) AND
    REF(OPEN,3)>REF(CLOSE,3) AND
    REF(CLOSE,3)>=REF(LOW,3) AND
    REF(HIGH,2)>REF(HIGH,3) AND
    REF(HIGH,2)>REF(HIGH,4) AND
    REF(HIGH,2)>REF(HIGH,5) AND
    REF(HIGH,2)>REF(HIGH,5) AND
    REF(HIGH,2)>REF(HIGH,6)

    Expression complete.

    LOGIC OF EXPRESSION

    HIGH IS GREATER THAN OR EQUAL TO OPEN PRICE AND(PRESENT CANDLE )
    OPEN IS GREATER THAN CLOSE AND
    CLOSE IS GREATER THAN OR EQUAL TO LOW PRICE AND
    LOW IS LESS THAN PREVIOUS CANDLE LOW AND
    CLOSE IS LESS THAN PREVIOUS CANDLE LOW AND
    CLOSE IS GREATER THAN OR EQUAL TO PRIOR TWO CANDLE OPEN AND
    PRIOR THREE CANDLE OPEN IS EQUAL TO PRIOR TWO CANDLE OPENING PRICE AND
    PREVIOUS CANDLE HIGH IS GREATER THAN OR EQUAL TO PREVIOUS CANDLE OPENING PRICE AND
    PREVIOUS CANDLE OPENING PRICE IS GREATER THAN OR EQUAL TO PREVIOUS CANDLE CLOSING PRICE AND PREVIOUS CANDLE CLOSING PRICE IS GREATER THAN OR EQUAL TO PREVIOUS CANDLE LOW PRICE AND PREVIOUS CANDLE LOW IS GREATER THAN OR EQUAL TO PRIOR TWO CANDLE OPENING PRICE AND
    PREVIOUS CANDLE HIGH PRICE IS LESS THAN OR EQUAL TO PRIOR TWO CANDLE CLOSING PRICE AND
    PRIOR TWO CANDLE HIGH PRICE IS GREATER THAN PRIOR TWO CANDLE CLOSING PRICE AND
    PRIOR TWO CANDLE CLOSING PRICE IS IS GREATER THAN PRIOR TWO CANDLE OPENING PRICE AND
    PRIOR TWO CANDLE OPENING PRICE IS GREATER THAN PRIOR TWO CANDLE LOW PRICE AND
    PRIOR THREE CANDLE HIGH PRICE IS GREATER THAN OR EQUAL TO PRIOR THREE CANDLE OPENING PRICE. PRIOR THREE CANDLE OPENING PRICE IS GREATER THAN PRIOR THREE CANDLE CLOSING PRICE AND
    PRIOR THREE CANDLE CLOSING PRICE IS GREATER THAN OR EQUAL TO PRIOR THREE CANDLE LOW PRICE AND PRIOR TWO CANDLE HIGH PRICE IS GREATER THAN PRIOR THREE CANDLE HIGH PRICE AND
    PRIOR TWO CANDLE HIGH PRICE IS GREATER THAN PRIOR FOURTH CANDLE HIGH PRICE AND
    PRIOR TWO CANDLE HIGH PRICE IS GREATER THAN PRIOR FIFTH CANDLE HIGH PRICE AND
    PRIOR TWO CANDLE HIGH PRICE IS GREATER THAN PRIOR FIFTH CANDLE HIGH PRICE AND
    PRIOR TWO CANDLE HIGH PRICE IS GREATER THAN PRIOR SIXTH CANDLE HIGH PRICE.

    Here we need to have the signal/Alert on the candle which denotes expression-high/low/close /open.
    Then we need to take the position on the next candle as all the conditions are fulfilled.
    Please advise if the expression is correct.
    We have already made the strategy live but the signals that we are gettig on the chart are not correct ones.
    The same strategy have already been implemented in Metastock , and is working fine
    Are we going wrong somewhere in expression or in making the strategy live or otherwise somewhere. Please advise as this is vvimp for us.

  • Rdstyle says:

    I want to run the following:

    a. Single Scrip
    b. Based on my technical logic, want to enter the market based on SL-Limit or SL-Market Order
    c. Execution of this order, should then either place a profit order or a stop-loss order
    d. Execution of either of the order, other order gets cancelled, and I start from point b again.

    Request you to assist.

    Rd

  • taruj says:

    referring to SASIMENON on May 8 2013, 10:44 pm.
    A stoploss % is essential or we can keep it blank.?

    Can you please explain further?

    if I (using Algoz) have taken a position for BNF @ 12500 and I set SL as 4% it will sqr off the position at 12000?

    I am trying to put my proposed strategy across. Pure Intraday trades.

    Time Frame: 15 Min

    Long Position: 5 EMA crosses over 10 WMA (Buy at MKT)
    Stop Loss: Previous Candle Low

    TSL: Previous Candle Low
    Short Position: 10 WMA crosses over 5 EMA ( Short at MKT)
    Stop Loss: Previous Candle High
    TSL: Previous Candle High

    regards,

  • Sid says:

    Hi Zerodha,

    My requirement are simple.

    1) For EOD trades, Buy Nifty Calls when 3 EMA > 15 EMA on Nifty Spot. Buy Nifty Puts when 3 EMA < 15 EMA on Nifty Spot.

    Additionally as a confirming indicator, I also want to make certain that MACD (5,20,4) has given a buy / sell signal as well as RSI-EMA 21,9 (9 EMA of 21 RSI) has also given the same buy / sell signal.

    Please help me code the same and back test it.

    2) For Intraday Trades, I want to buy Call / Puts if the Nifty Spot crosses a certain value, say 6000, upwards (then Calls) or downwards (then Puts) respectively. How can I put in this sort of a conditional order?

    for example: if Nifty Spot < 6000, initiate Buy Nifty Puts (In The Money / At The Money).

    OR

    if Nifty Spot > 6000, initiate Buy Nifty Calls (In The Money / At The Money).

    Thanks for your help in advance and eagerly awaiting your help / reply.

    Regards,
    Sid

  • Miks says:

    When I try for backtesting, I dont see any such option. All there is in my strategy is the Edit option. How do I proceed further?

    Also what expression do I use for EMA crossover say 3 EMA crossing over 7 EMA then Buy and vice-versa?

  • Ajit says:

    Please can you brief on the difference between crossover function and “<” or “>”. Also please give me the code for my strategy as posted below:

    Buy : EMA3 cross EMA 21 from below, MACD histogram slops upwards, Stochastics %K above %D and going above 30.

    Sell : EMA21 cross EMA3 from above, MACD histogram slops downwards, Stochastics %K below %D and coming below 80.

    Thanks
    Ajit

  • currencyandnifty.com says:

    Sir,

    we cannot make a strategy above 1000 sma even on 1 min. chart and it does not backtest and get the result

    pls allow the system to work upto 3000 sma on 1 min.chart.

    There are 60 candles per hour,375 candles per day,and for 22 days it will have 8250 candles.

    A 3000sma will start after 3000 candles from the beginning and it goes on , so can you provide us more than 1000 sma,s

    atleast on 1 min, chart and let the strategy backtest and proceed???

  • ricky says:

    sir can u please code this strategy for me:-

    Exit Strategy

    1. When fast Stochastic reverses from it’s upward move, curves downwards and crosses the slow line from above, sell half of the units.

    2. If the next bar goes below the low of the previous bar, exit completely

    thanks in advance

  • Vasant says:

    Please let me know on the query posted on 11 May; I’ve reproduced it below.

    Could you please help me with the code for below ?

    Buy trigger – +DI higher than -DI AND Slow Stochastic (14,3); 14 period crossing above 3 period at the closure of 15 minute candle OR +DI crosses over -DI when 14 period Slow Stochastic is above 3 period at the closure of 15 minute candle.
    Exit Slow Stochastic (14,3); 14 period crossing below 3 period at the closure of 15 minute candle OR -DI exceeds +DI at the closure of 15 minute candle
    Short trigger -DI higher than +DI AND Slow Stochastic (14,3); 14 period crossing below 3 period at the closure of 15 minute candle OR -DI crosses below +DI when 14 period Slow Stochastic is below 3 period at the closure of 15 minute candle.
    Exit – Slow Stochastic (14,3); 14 period crossing above 3 period at the closure of 15 minute candle OR +DI exceeds -DI

  • Nanu says:

    Hi can you give formula for Trailing Stop loss

    Example 1% trailing Stop in Picture:

  • pypawar says:

    i am planning to use my strategy but it is not showing any option to go live and also i want to take backtest of my strategy
    how to enable the options of backtest, go live and alert of my strategy

  • Sebu says:

    Is it possible to get alert when a candle cross to 30 sma (in blue circle) also i wish to avoid continues signals (in red circle)
    I try the close<SMA…,,.It work well in back test but in live trade its generating signal in all candle below the sma line.

  • sangi says:

    Hi,

    You corrected my code for reversal strategy. thanks a lot. But tht code gives signal when a reversal candle gets formed and that too when i run scrip by scrip only.

    But buy/sell is actually abv /blow the high/low of PR/NR. So Pls. give me a code tht generates signal on actual buy/sell with exit tgts as defined blow.

    When I backtest, Should I go scrip by scrip? Or is there anyway to test this strategy in nifty 50 for a particular period?

    My strategy for reversal:

    Buy:abv the high of the positive reversal(PR) candle.SL is the low of the PR. exit for buy: closing the 50% buy posn at 1:1 and rest at 1.618 fibo extn(diff between high and low of th PR * 1.618) added to the high of the PR.

    Sell: blow the low of the negative reversal candle. NR is just opposite of PR definition.

    Definition of positive rev can:

    Low of the current candle should be more than the low of the previous candle.
    close of the current candle should be more than previous candles close and open of the current candle.
    high of the current candle should be less than the high of the previous cndl.

    RSI of the current candle should be more than 30 and RSI of the previous candle should be less than 30.

    hope to get the reply soon. Thanks in adv.

  • Sebu says:

    I add MACD crossover strategy to 10 charts and make live.Then i close 9 charts.
    but it work only in 3 charts.In the chart i find the crossover but no buy sell signal generated by the system. is there any limit in no of charts.can i add strategy without open the plus chart?

  • pypawar says:

    i want to have a strategy for buy if RSI period 14 close above 55
    and exit the position if RSI period 14 close below 30

    i tried this RSI(CLOSE,14)>55
    RSI(CLOSE,14)<30

    but it is showing invalid expression
    pls help me in getting correct expression

  • anildpi says:

    Hi
    Can u pls code me the below strategies :

    1 ) Buy : Bar close > The high of immediate previous bar and Bar close > Bar open
    Sell : Bar close < The low of immediate previous bar and Bar close < Bar open.

    2 ) Buy : Price crossover > Highest high of previous 30 bars
    Sell : Price crossover < Lowest low of previous 30 bars.
    Regards,
    Anil.

  • Devendra says:

    Dear Zerodha,

    Not getting Historical charts in Nest Plus Charts
    for algoZ

    ID : DD0314
    Devendra

  • Devendra says:

    Dear Zerodha,

    I have a strategy
    of EMA 8 and 13 Crossover
    on 10 min chart
    which (on an avg) gives 1 OR 2 trades a day
    i.e. 2-3 buy AND sell signals
    When Backtested it plots arrows at right places

    But When I set it live,
    on 10 min interval
    and keep watching 10 min chart of nest plus

    unnecessary alerts are shown
    instead of 8-9 alerts 20-30 Alerts pop up

    How to avoid this ?
    IS it a Bug in algoZ

    This happens for any strategy !

    Pl. Guide

    Devendra

  • Vasant says:

    Could you please help me with the code for below ?

    Buy trigger – +DI higher than -DI AND Slow Stochastic (14,3); 14 period crossing above 3 period at the closure of 15 minute candle OR +DI crosses over -DI when 14 period Slow Stochastic is above 3 period at the closure of 15 minute candle.
    Exit Slow Stochastic (14,3); 14 period crossing below 3 period at the closure of 15 minute candle OR -DI exceeds +DI at the closure of 15 minute candle
    Short trigger -DI higher than +DI AND Slow Stochastic (14,3); 14 period crossing below 3 period at the closure of 15 minute candle OR -DI crosses below +DI when 14 period Slow Stochastic is below 3 period at the closure of 15 minute candle.
    Exit – Slow Stochastic (14,3); 14 period crossing above 3 period at the closure of 15 minute candle OR +DI exceeds -DI

  • sangi says:

    Pls. answer my query posted on 11th may. thank you.

  • KKChoudary says:

    Hi Team,

    I haven’t yet received any clarification on below issue. Kindly help me to solve the below problem.

    This is a simple MACD crossover script as mentioned below. But there are false signals (encircled in red), though crossover has not happened. Can you please explain the reason for these false signals? Thanks..

  • currencyandnifty.com says:

    zerodha,

    pls allow to work our strategy in all sectors like equities.FO and currency at the same time,if we login ZT and select.

    we mean to work our strategy SBIN on cash and TCS on FO at the same time on ZT if we select both,can you ?

  • Kiran says:

    Hi Zerodha,

    Thanks for your reply,,

    And one more query i have.

    Why it is not working in MCX, because i trade in most in commodity.. when it will be available in commodity…

  • Harish-Upadhya says:

    Hi,

    Please provide the code for the below strategy.

    Buy—If the range (difference between high and low) of previous candle is the least of past 30 period/candle and Last price(LTP) crossovers high of previous candle.

    Sell—-If the range (difference between high and low) of previous candle is the least of past 30 period/candle and Low of previous candle crossovers LTP.

    Thanks,
    Harish

  • SASIMENON says:

    Sir,

    An automated strategy can go live with your server on all trading days,without trader login with a dealer terminal?

  • anildpi says:

    Hi,
    Can u pls give me a code for the below strategy :
    Buy : Price close > Recent peak
    Sell : Price close < Recent low.
    Anil.

  • SASIMENON says:

    How a stoploss can assure , minimum 2% profit,from each trade?
    pls explain

  • Faisal says:

    Hi Zerodha,

    I have made a strategy as follows :
    Buy: EMA(Close,3)>EMA(Close,5) Sell: EMA(Close,3)< EMA(Close,5)

    Buy exit: CLOSE<EMA(close,5) Sell exit: CLOSE>EMA(close,5)

    In this case, does it exit the existing lots and add a new lot into position or just exit the existing position.
    I.e. I have a short at nifty 5851.4. At 5726 long trigger occured. so in that case it should exit current short position and need to add one long position. How can this be done. the above code is sufficient ?

  • Kiran says:

    Hi Zerodha,

    Is this tool wil work in mobile application.. If works how to use,,
    If not what is the alternative way to see the charts in mobile and tablets..
    I’m using mobile application i don’t have have access to systems..

    Thanks in Advance…

  • gumka says:

    How to code stochastic for following condition

    Buy when stochastic +ve crossover is below 20

    Sell when stochastic -ve crossover is above 80

    one member asked this but it gives error when applied

    with regards

  • MANiPPT says:

    Dear Zerodha,
    How can i cancel alert on my live strategy.
    Regards,
    Mani

  • SASIMENON says:

    A stoploss % is essential or we can keep it blank.?

  • SASIMENON says:

    Hello Zerodha programmers,

    Can you suggest few moneymaking scripts for all zerodha traders, atleast one

  • Sridhar_Blrr says:

    Hi Zerodha,

    Thanks for the new features added . Can you please help me to develop a expression for the below strategy.

    Strategy 1:

    EMA cross over 12 x 26 for buy and sell signal with the filter of MACD cross over at “0” line to generate buy or sell signal

    Strategy 2:

    EMA cross over 12-26 with filter parabolic SAR indicator buy and sell signal.

    Strategy 3:

    EMA cross over 12 x 26 for buy and sell signal with the filter of MACD cross over buy and sell.

    Thanks in Advance.

    Regards,
    Sridhar

  • Nithin Kamath says:

    NEHALMay 7 2013, 5:04 pm
    Zerodha,

    Can you please help me to develop code for following criteria?

    1. buy = average of 15 period highest price & 15 period lowest price is greater than average of 30 period highest price & 30 period lowest price
    2. sell = average of 15 period highest price & 15 period lowest price is lower than average of 30 period highest price & 30 period lowest price

    Thanks in advance.

    Nehal
    [ Click to thank ]Zerodha replyMay 8 2013, 1:50 pm
    Buy:
    SET H = MAXOF (MAX (HIGH, 14), REF (HIGH, 15))
    SET L = MINOF (MIN (LOW, 14), REF (LOW, 15))
    SET AVG = (H+L)/2
    SET H1 = MAXOF (MAX (HIGH, 29), REF (HIGH, 30))
    SET L1 = MINOF (MIN (LOW, 29), REF (LOW, 30))
    SET AVG1 = (H1 + L1)/ 2
    AVG > AVG1

    Sell:

    SET H = MAXOF (MAX (HIGH, 14), REF (HIGH, 15))
    SET L = MINOF (MIN (LOW, 14), REF (LOW, 15))
    SET AVG = (H+L)/2
    SET H1 = MAXOF (MAX (HIGH, 29), REF (HIGH, 30))
    SET L1 = MINOF (MIN (LOW, 29), REF (LOW, 30))
    SET AVG1 = (H1 + L1)/ 2
    AVG < AVG1

  • RainMaker says:

    I think Super trend is an indicator, just like PARSAR and should be incorporated in the list of Indicators on Nest Plus Charts and must show on chart.

    As a user then we can buy / sell as the indicator signals, for the given timeframe.

  • Srinivas says:

    Please provide the code for the below strategy

    Supertrend:

    Formula

  • Harish-Upadhya says:

    Hi Zerodha,

    Please provide the code for the below strategy which is based on narrow range.

    1) Buy LTP > previous day high and previous candle range(difference between High and Low) should be narrowest of any of the past 6 candles(range of each candle may or may not be continuous).

    2) Sell LTP < previous day low and previous candle range(difference between High and Low) should be narrowest of any of the past 6 candles(range of each candle may or may not be continuous).

    Please find the screen shot for your reference.

    Thanks,
    Harish

  • anildpi says:

    Hi sir,
    Can u please give me codes for the following strategies?
    1. Divergence in RSI,
    2. Divergence in Stochastics,
    3. a) Buy when the price close >Day’s Open and sma50.
    b) Sell when the price close < Day’s Open and sma50.
    Regards,
    Anil.

  • APM says:

    On go live with 5 minute candle setting , it is firing based on one minute candle and generating lot of trades
    Please help

  • Shaan says:

    My logic is explained below. Kindly let me know the code for he same.

    Buy on the previous day’s high. Stop loss for Nifty is 30 points. If it moves in the direction of the trade, then the stop loss moves to the previous day’s low or 30 pts which ever is lower. Similarly for Short positions as well.

  • APM says:

    Dear Sir

    Please Reply to my mail
    While making Live- Even if I am specifying 5 minute Candle, it is firing based on 1 minute Candle
    Please help

  • Shri says:

    Thank you for previous answer.
    Today taken system live. It generated 2 signals as per my expectations but there was no sound alert only pop up mg.
    Set security alert gives beep for alert . Nothing for algoZ running scripts.
    Please let me know where is the option in nest plus to configure sound alerts. If not in front of pc sound alerts are very useful.

    Thank you

  • sangi says:

    the code i have given above is for NR.

  • sangi says:

    Hi,

    This is my strategy for reversal. I have coded and it works in odin , but not in algoz. Can u tell me why it is not working in algoz and pl rectify the mistake.

    Buy:abv the high of the positive reversal(PR) candle.SL is the low of the PR. closing the 50% buy posn at 1:1 and rest at 1.618 fibo extn(diff between high and low of th PR * 1.618 added to the high of the PR.
    Sell: blow the low of the negative reversal candle. NR is just opposite of PR definition.

    Definition of positive rev can:

    Low of the current candle should be more than the low of the previous candle.
    close of the current candle should be more than previous candles close and open of the current candle.
    high of the current candle should be less than the high of the previous cndl.

    RSI of the current candle should be more than 30 and RSI of the previous candle should be less than 30.

    Code:
    SET A = HIGH
    SET B = REF(HIGH,1)
    SET C = CLOSE
    SET D = OPEN
    SET E =REF(CLOSE,1)
    SET F = RSI(CLOSE,14)
    SET G = REF(F,1)
    SET H = LOW
    SET I = REF (LOW,1)
    A > B AND C < D AND C < E AND H > I AND E > 70 AND G < 70
    Please help me in this regard. If you find that this is not coded properly, pls give me the correct code.
    Thanking you in advance.

  • APM says:

    I want to have a code for the following
    Buy : When the Low of the Candle is above EMA 34 Close and the previous candle close is below EMA 34 ( Candle moving from Bottom crossing EMA 34)
    Sell : When the high of the Candle is below EMA 34 close and the previous candle close is above EMA 34
    I am using the following code :
    LOW>EMA(CLOSE,34) AND Ref(Low,1)<EMA(CLOSE,34)
    Buy Exit :0
    HIGH<EMA(CLOSE,34) AND Ref(HIGH,1)>EMA(CLOSE,34)
    Sell Exit : 0

    During live I have specified 5 minute candle but it is firing using one minute candle for example for sun pharma between 9.15 to 10.30 I got more than 6 firing

  • APM says:

    Can you please let me know the code for following.
    This is for my exit Criteria

    Buy Exit : 3 Consecutive Red Candles
    Sell Exit : 3 Consecutive Green Candles.

  • RainMaker says:

    ON My strategy > Edit what is meant by :
    ORDER IS RELEASED AT THE VWAP CLOSE IT CONSIDERS THIS FACTOR FOR THE SAME

    Aren’t all orders are based on the close price (LTP) of the respective timeframe candle.?
    I do understand the VWAP, but the point I wish to know is whether trades are based on VWAP or LTP calculations in algo.

  • Dharam says:

    Hi,

    I am looking to trade with pivot points. My Buy expression would be =(Prev Day High+Prev Day low+Prev Day close)/3)*1.001)

    and Sell Expression would be (Prev Day High+Prev Day low+Prev Day close)/3)*.999)

    Pls help me code this for back testing. Thanks!

  • thavva says:

    Few questions.

    1. Does back test include brokerage and other charges too?
    2. Back test results for how much quantity for cash and futures? Is it like for cash 1 share and for F&O one lot?
    3. I should be connected to trading platform once i take my strategy live to run it during trading hours always? or i can logoff in between?

  • jawahar_1 says:

    Dear sir,

    This DJ9237.
    BUY
    Buy when close price of the scrip is above 3 period EMA crosses over 18 period SMA.
    CLOSE>CROSSOVER(EMA(CLOSE,3),MA(CLOSE,18))

  • Shri says:

    Zerodha,

    Thank you for previous code.

    I have another query.
    I use MACD crossover system to buy and sell on 5 min chart of Nifty call/put Options.

    When I get a signal I confirm and order is executed. In preferences I have put stoploss of 0.5.
    Now how to modify the stoploss once trade is in profit .
    And since this is Options trade once I get sell signal as per system will it execute the order if I confirm.

    Earlier before algoZ when I traded , for options after buying I could place only either SL order or sell order and not both.
    If tried to place both it gave RMS limits error for not sufficient margin.
    So in algoZ should I cancel SL first for options and then confirm sell or how does it work.
    Sorry for long question.
    Thank you.

  • Devendra says:

    Zerodha, I am waiting for 4 Days to
    get answer to my queries. Pl. Help !
    ———————————————–

    Thanks a lot to Zerodha for algoZ

    How can I write Buy Expression when :

    ADX (14) > 10 AND +DI > 20

    Sell When

    ADX (14) > 10 AND -DI > 20
    —————————————-
    My other Strategy is :

    Buy when Price closes above Bollinger Band middle or centre
    Buy Exit when when Price closes above Bollinger Band top

    Sell when Price closes below Bollinger Band middle or centre
    Sell Exit when when Price closes below Bollinger Band bottom

    Pl. provide Code for above 2 Strategies [ADX and BB]

    Thanks in Advance
    Devendra

  • Sebu says:

    how to write strategy for macd histogram?
    buy – macd histogram<0 and increasing value
    sell – macd histogram>0 and decreasing value

  • rameshrao says:

    hi,
    I just tried to test algoZ, for that I copied the expressions given in the example and tried to save, on clicking save button, nothing is happening and even in my strategy EMA, still showing EDIT only instead of other options..

    I’m using WINDOWS 8

    Thanks
    Ramesh Rao

  • rameshrao says:

    hi,
    I just tried to test algoZ, for that I copied the expressions given in the example and tried to save, on clicking save button, nothing is happening and even in my strategy EMA, still showing EDIT only instead of other options..

    I’m using WINDOWS 8

    Thanks
    Ramesh Rao

  • thavva says:

    Hi Zerodha,

    can you reply to my question asked on Apr 30 2013, 11:12 pm? Please provide the formula for the same.

    thavva

  • Nithin Kamath says:

    Vincent asked this on an email:

    I TRIED TO WRITE THE CODE AND FAILED. PLEASE TRY TO HELP ME AND TELL ME HOW TO SAVE.
    FOR BUY SIGNAL
    1) EMA5 CROSSING EMA6 FROM BELOW AND THE PRICE IS ABOVE EMA5:
    PARABOLIC SAR CROSSING BELOW PRICE.
    FOR SELL SIGNAL:
    2) EMA6 CROSSING BELOW EMA5:
    PARABOLICSABOVE
    ALSO I WANT THE POP UP MESSAGE OF THE STOCK WHICH SATISFIES THE CONDITION.
    REGARDS,

    Answer:

    Buy:
    EMA (CLOSE,5) > EMA (CLOSE, 6) AND REF (EMA(CLOSE, 5),1) < REF(EMA(CLOSE,6),1) AND CLOSE > EMA(CLOSE,5) AND PSAR (CLOSE,0.02,0.2) < CLOSE.

    Sell:
    EMA (CLOSE,5) < EMA (CLOSE, 6) AND REF (EMA(CLOSE, 5),1) > REF(EMA(CLOSE,6),1) AND CLOSE < EMA(CLOSE,5) AND PSAR (CLOSE,0.02,0.2) > CLOSE

    Buy exit: 0

    Sell exit: 0

    You will have to run this strategy individually for stocks, there is no option to run a screener. What you will have to do is, take live the same strategy individually for the various stocks you are tracking. Blog http://www.zerodha.com/z-connect/blog/view/managing-your-script shows you how to take live and setting alert preferences.

  • SASIMENON says:

    Sir,
    whenever I go live on my strategy,whether my 10sma on
    1-minute chart,will work as 50 sma,on 5-min.alert preference??
    Give me a clear answer pls.

  • Anamika says:

    Dear Zerodha,

    I want to backtest following system:

    Buy: CROSSOVER OF 9 EMA & 20 SMA (on five min chart) AND 9 EMA > 20 SMA (on 15 min chart)
    Sell: CROSSOVER OF 20 SMA & 9 EMA (on five min chart)

    Is it possible in Algo Z

  • O.P.Vyas says:

    Please let me know how to write a Script if I wan t to buy Nifty Future if it crosses a particular certain level say 5900.

  • baskaran says:

    super trend indicator possible to code in nest plus script ?

  • Shri says:

    @Zerodha,

    I want to write code to find MACD histogram.
    i.e MACD – (minus) Macd Signal

    For eg if macd (12,26) =10 macd signal (12,26,9)= 2 Histogram=Hist=Macd minus Macd signal = 10-2 =8

    After finding histogram value my sell signal would be
    Sell = Histogram < ref(close,1) and ref (close ,1) < ref (close ,2).
    Here close is macd histogram values and not candle values.

    Please help me code this..
    Thank you

  • Juggy says:

    I want to find whether the trend of the last three CLOSE periods of 5 minute interval charts. Can i use?

    TREND(CLOSE, 3) = UP

    Particularly, the second parameter “2” is it for “periods” or only “days” ?

    Thanks,
    Juggy…

  • Srinivas says:

    SuperTrend indicator possible to code in Nest Pulse script ??

  • RainMaker says:

    Zerodha

    How to code stochastic for following condition

    Buy when stochastic +ve crossover is below 20

    Sell when stochastic -ve crossover is above 80

  • APM says:

    I want to use 5 minute candle instead of 1 minute candle
    Buy for closing above 34 EMA with Stochastic % K period 20, % k slowing 3 and % D period 4 with % K Crossing % D above 30
    Sell for closing below 34 EMA and Stochastic % K period 20, % k slowing 3 and % D period 4 with % D Crossing % K below 80
    Please let me know the program

  • Aquif says:

    Hello. Since RSI below 30 may not always be a good signal to buy especially if your not closely monitoring the prices, I usually rely on RSI divergences ….So is it possible to create an expression to buy if there is an RSI divergence or may be a MACD or KST divergence?

  • thavva says:

    Can you provide formula for below strategy.

    1. Buy when CLOSE > EMA(HIGH,40) and difference is not more than 2 points.
    2. Exit buy position when difference between trading price and EMA(High,40) is more than 5 points
    3. Buy again when prices is touching EMA(HIGH,40)
    4. Exit the buy position when difference between price and EMA(HIGH,4) is >= points.
    5. Close the position when closing price is < EMA(LOW,40) and initiate short.
    6. Follow same procedure for shorts to book profits for 5 points and enter again whince price touches EMA(LOW,40).

    Find the attached image for reference.

  • Debjyoti says:

    How to avoid repeat Buy / Sell?

    If I have already sold a script, how to avoid selling it again on the second and third third signal generated by the logic?

  • Nithin Kamath says:

    Dr Suhas had asked this query:

    Dear Sir/Madam,
    I want to write strategy, but I am not able to fit my startegy in this algo. Anybody please let me know how to write this.
    1) I want to buy when closing of the candle is higher than highes of previous 9 candles & sell when closing of candle is lower than lows of previous 9 candles. This will be in hourly TF.
    2) Secondly buy will be only when the trend is uptrend confirmed by cross-over of 8 & 34 EMA in hourly TF. Sell will be vice-versa.
    3) In this system , exit from buy will be when candle closes below the lows of previous 9 candles with closing price below 8 EMA and exit from sell will be when candle closes above highes of previous 9 candles with closing price below 8 EMA.
    Please let me know how to write this strategy?

    Answer:

    Buy expression: CLOSE > MAXOF(MAX(HIGH,8), REF(HIGH,9)) AND EMA(CLOSE,8) > EMA (CLOSE,34)

    Sell expression: CLOSE MINOF(MIN(LOW,8), REF(LOW,9)) AND EMA (CLOSE,8) < EMA (CLOSE,34)

    Buy Exit: CLOSE < MINOF(MIN(LOW,8), REF(LOW,9))AND CLOSE < EMA (CLOSE,8)

    Sell Exit:CLOSE > MAXOF(MAX(HIGH,8), REF(HIGH,9)) AND CLOSE > EMA (CLOSE,8)

  • Dweep says:

    Pls code following strategy for me: all standard params

    Buy if Close < Lower Bollinger AND RSI < 30
    Exit long if RSI > 50 OR Touch Bolinger Avg.(Central MA)

    Short Sell if Close > Upper Bolinger and RSI > 70
    Cover Short if RSI < 50 OR Touch Bolinger Avg.(Central MA)

    Stop Loss of 5%

    Thanks.

  • RainMaker says:

    How to stop a running script / strategy ?

    Once I select to backtest / a strategy the script keeps running. Only when I select another strategy the first one stops and the other one starts running and keep on giving alerts. How to stop it running once I am not interest or done with it.

    I could stop the running script only by swithcing off the Ztrader.

  • svr says:

    Hi Nitin,

    I am using parabolic SAR however, Its giving me weird results

    CROSSOVER(CLOSE, PSAR(0.02, 0.2)) = TRUE,

    I want to use this for both Buy/Sell, and Buy should signal only when stock price is above Parabola and Sell should signal only when stock price is below Parabola. Please suggest

    Thanks in advance

  • Vicky says:

    Is AlgoZ available with Z-Trader(the web version) ?
    The software version is probably unusable when in office

  • Juggy says:

    Dear Team,

    Is Algoz for intraday only?
    When i take positions and close and open ZT where can i see the list of strategies that are already running ?

    Thank you,
    Juggy…

  • Sebu says:

    Hi,

    My amibroker afl code is
    Buy=Cross(MACD(),Signal());
    Sell=Cross(Signal(), MACD());

    with the support/resistance of fibonacci extension.
    How do i use the code in ZT?

  • thavva says:

    I don’t see Backtest option for My strategy? How to get that option?

  • kklkanna says:

    How to Stop or edit currently runnning live script

  • Arunjn30 says:

    pls help me to write my strategy at the earlirst to backtest,I am anxiousily waiting

    I have two stratergy to start of

    1) For day trading
    how to write a code If it is nearing todays high, or low like which shows up in http://www.buzzingstocks.com/in/heatmap.htm.
    in the same expression i want to use buy only when EMA 10 crosses EMA 30 days or vice versa the time period that i want to use in 5 or 15minutes candle

    2) Cross over of EMA 10 with EMA 30 days for 15 minutes candle with ADX crossing from 20 i.e buy or sell only when ADX is crossing from less than 20 to rising upward.

    also please let me know is it possible to set alert using this stretergy for all the stock listed in market watch or only i can set alart for stock which i have opened in the chart.

  • Faisal says:

    Dear Nithin,

    I would like to do trade on Nifty future on 5x 3 ema crossover system. If 3 ema crossover 5 ema buy and if 3ema come below 5 ema sell. Basically I would like to long / short 4 lots of nifty. Profit on 1st lot i would like to take on 50 points. 2nd lots profit on 100 points. 3rd lot profit on 150 points. 4th lot for trailing stop loss.

    It will be greately appreciated If your people will be able to make a code for the above.

  • kklkanna says:

    i want set a exit trigger for buy or sell with 1% from entry price , how to set that?

  • AnilKumar says:

    Congratulations on starting this excellent feature! All this would help enhance a trader’s confidence. However, I feel Zerodha seems to be taking the new initiatives at the cost of ignoring the basic requirements.
    For example, I want to fully utilize my margin funds (leaving a cushion of say 5%). (This would be in Zerodha’s interest too.) However, there is huge difference between the margin blocked in the trading account (436K) and margin statement (512K) generated (both at EOD). SPAN calc(at browser based Zerodha trader) calculates a much lower amount (252K) for the same position. Can you please give the trader a confidence that she can take a position (without running the risk of a margin call/penalty) based on funds availability shown by trading account?

    Now the queries related to algoZ.

    1. Would you make this feature available on your browser based trading platform?
    2. Is it possible to calculate ratio of the prices of two securities (say Nifty and BankNifty) and apply technical indicators on this ratio?
    3. Where can I find the comprehensive list of keywords (eg Close, RSI, REF) that are used in coding?

    PS. Sorry for putting an out-of-context concern here. However, I have unable to get a satisfactory response so far.

    Thanks,
    Anil Kumar

  • sudarshanagni says:

    Hello zerodha.

    How can write strategy for different time frame . Suppose i want to write following strategy for 5 min candles.
    Also i want use Fibonacci retracement condition for ex buy IF close>38% level
    Buy;
    close>ema(close,110)&CCI(simple,14)>100

    Sell:
    close<ema(close,110)&CCI(simple,14)=-100<CCI(simple,14)<-500 (I want to only sell if CCI is greater than -100 on -ve scale for ex -110,-120)

    Where i can write Stop loss for buying and selling
    for buy close<EMA(Close,3)
    for sell close>EMA(close,3)
    Eagerly waiting for your valuable guidance.

  • tks61 says:

    what is the code for stop loss?

  • SASIMENON says:

    Traders,

    we can make this blog,live, informative,result oriented,profitmaking one.
    Clear all your doubts ,for a better profit,share your strategies if you are profitable,
    Sharemarket is an ocean of money,anyone can make a profit if you are consistent,
    dedicated and not greedy.

  • prabit says:

    Sir,
    I have gone through the your replies and examples. Nowhere I saw any mention of timeframe. A particular strategy may not work for all timeframes. Is it that the programmes are only for daily and one minuite?

  • bhuvanprabha says:

    where can we get the complete list of functions and their parameters that are available. The manual and guides that are available in this forum seems to be inadequate. Request the complete programming/user manual please.

  • SASIMENON says:

    Sir,

    Any phone nos,are available to communicate to experts,though we dont want to publish ,our strategy

  • SASIMENON says:

    Sir,
    Thank you for the valuble reply,

    I wish to know, 1. SMA VALUES 2000 ,3000,are available to make an expression ?

    2. As I am a zerodha trader,where I can go for these fecilities.

  • Gopiramnath says:

    Dear Sir,

    Another excellent effor by Zerodha team. I want a code for the following strategy.

    Trading Price > Previous close and Trading Price > Open = Buy
    (But it should be done @ 10.15 AM of every day and closes the position @ 3.10PM)

    Trading Price < Previous Close and Trading Price < Open = Sell
    (But it should be done @ 10.15 AM of every day and closes the position @ 3.10PM)

    Stoploss is vice versa and it should take position as well in case of stoploss triggered.

    Can you make a strategy for this?

    Thanks in advance

  • Nithin Kamath says:

    Pradeeep TV asked:

    Basically i want to use heikin-ashi charts, so my close, open, low and
    high are specified below —

    HA-Close = (Open(0) + High(0) + Low(0) + Close(0)) / 4

    HA-Open = (HA-Open(-1) + HA-Close(-1)) / 2

    HA-High = Maximum of the High(0), HA-Open(0) or HA-Close(0)

    HA-Low = Minimum of the Low(0), HA-Open(0) or HA-Close(0)

    Buy —> If the close goes above highest close of last 4 candles then buy.

    Sell —> If the close goes below lowest close of last 4 candles then sell

    Answer:

    For all those who don’t know Heiken-Ashi is a type of candle stick chart with the difference being in the following parameters.

    Close = (Open+High+Low+Close)/4
    Open = [Open (previous bar) + Close (previous bar)]/2
    High = Max (High,Open,Close)
    Low = Min (Low,Open, Close)

    Your condition is the below to buy/sell, which is based only on the close, so you really don’t need to worry about open, high, low.
    Buy —> If the close goes above highest close of last 4 candles then buy.
    Sell —> If the close goes below lowest close of last 4 candles then sell

    The below should be self explanatory.

    Buy expression:

    SET HAC = (OPEN+HIGH+LOW+CLOSE)/4
    HAC>MAXOF(REF(HAC,1), REF(HAC,2), REF(HAC,3), REF(HAC,4))

    Buy exit: 0

    Sell expression:

    SET HAC = (OPEN+HIGH+LOW+CLOSE)/4
    HAC < MINOF(REF(HAC,1), REF(HAC,2), REF (HAC,3), REF (HAC,4))

    Sell exit: 0

    You can check out the example above where I have mentioned the use of REF function. REF basically takes reference of the candle, so REF(HAC,1) would mean HAC for 1 candle before, REF(HAC,2) 2 candles before and so on.

  • atulshar946 says:

    Dear Team,
    need your help to write and test following
    expression for Let say WR+ => -50 AND STOCHRSI => 0.50 it should buy and WR+ < -50 AND STOCHRSI < 0.50

    Thanks
    Atul Chaudhari

  • SASIMENON says:

    pls help me to write my strategy at the earlirst to backtest,I am anxiousily waiting

    200 ema crossover above 1300 sma for a buy
    200 ema crossover below 1300 sma for a sell

  • amarchamba says:

    My strategy is:
    When 14 period ADX is above 25
    MacD with 26,13,6 values shows a buy/sell crossover respectively, and then the move is confirmed by below criteria to open a buy/sell position respectively
    Stock retraces at least 3 days from up/down trend (It can be between 3 and 5 days retracement) and then to take buy/sell position respectively when the price goes above/below previous days High/low respectively

    I hope there will be a code for my above strategy

  • ananthak says:

    Can you share any document on AlgoZ

  • pypawar says:

    from when can u give more info about writing strategy , as i work on multiple strategies for scripts

  • gb333 says:

    I WANT TO CODE THE STRATEGY 3 EMA AND 15 EMA CROSSOVER.
    HOW CAN I WRITE THE CODE WHEN –

    EMA(CLOSE,3) CROSS EMA(CLOSE,15) THEN I WILL BUY
    AND WHEN

    EMA(CLOSE,15) CROSS EMA(CLOSE,3) I WILL SELL

    TIME INTERVAL – DAILY

    REGARDS
    GAUTAM

  • Prashant says:

    What is the code for gann hi lo indicator, it gives similar results as given by super trend indicator used by marketcalls.in

  • Sebu says:

    Thanks for the great idea!

    Generally I use MACD of Short Period 12 and Long Period 26 with RSI Period 10.
    I buy @ cross over + RSI~30 (Increase the value of RSI from a lover range)
    I sell@ cross over + RSI~70 (Decrease the value of RSI from a higher range)
    Please make strategy for the expression.

  • jimmy_087 says:

    Can you give strategy for:

    Buy: EMA(close 7) crossover EMA(14) + trailing stoploss at 1.5%

    Sell: EMA(close 7) crossbelow EMA(14) + trailing stoploss at 1.5%

  • ZTrader says:

    Hello Nitin,

    I am not a programmer, so I will explain my strategy in layman terms and you please let me know is it possible to code this strategy..

    it is kind of breakout strategy….i want to place Stop Loss Buy pending order above previous bar’s High and Stop Loss Sell pending order below the previous bar’s low and if any of the order gets executed, the corresponding against order should automatically be the Stop Loss value for the Executed order.

    I hope you understand this strategy…do reply me…

  • Dip says:

    As given by you in the simple example, a 14 EMA crossover gives you a lot of unwanted signals. What if I want to sell on 14EMA crossover if RSI is above 60 and buy on 14EMA crossover, if RSI below 40?
    How do I code it and can you also share the backtest result.?

  • Djinn77 says:

    Hello Nitin , I wanted to understand the following points :

    1. There was a plugin available from Ami broker to your Trading Terminal Software. Is it still available?
    If Yes , how does a user purchase Data , analyze it and back test it in this module?

    2. Can a code written in Ami Broker AFL Language be used in your Software Algoz? If not is there any way out possible to do so? Since we have so many codes written and they employ a lot of different charting tools and indicators how do we integrate the two systems?

    3. Are you planning on coming up with a Data Subscription for charting software real time as well as past historical data.

    Which Language is AlgoZ based on? It is a charting software with features like Amibroker/MT4 etc

    Thanks
    Dheeraj

  • Ubermensch says:

    Something similar to quantopian would be of great use to the traders.
    Also, could you open a GitHub account to group these scripts?

  • Ron says:

    When Nifty 5800 CE plus 5800 PE is less than Rs. 200, buy the same…please give a code to execute this strategy….its a very simple thing, does not involve any technical but so difficult to keep track of….not sure if AlgoZ is going to execute such strategy because it involve two contracts….