Pi Bridge for Amibroker

January 19, 2015
Pi Bridge

Traders,

Pi, our proprietary trading platform is now accessible to everyone who has an account with Zerodha. It has all the features you could expect in a modern trading platform. Check out https://zerodha.com/pi.

Why Pi Bridge?

With Pi we are trying to introduce the concept of coding and backtesting strategies. “Tradescript” the scripting language on Pi is intended for traders who want to code their own trading strategies but don’t know how to program in low-level languages like C, C++, and others. Without a programming language traders can’t develop automated trading systems or perform backtesting of strategies. Tradescript, a vector programming language, offers extreme flexibility with a minimal learning curve. So for example, the code for a 14-candle moving average strategy is Close>EMA(Close,14). Quite simple, right?

Tradescript is good for traders who don’t know programming, and for those who are looking at it as a stepping stone to learn. But for professional traders out there who are adept at coding and run complex trading strategies, Tradescript will not fit the bill. We ran a survey few months back to find out what such advanced traders like to use. The answer was: AFL, Easylanguage, Python, C++, etc. Tradescript is within our trading platform, so executing trades based on signal/alerts is quite easy. But what about traders who are using pure charting, analytic, or programming tools like the ones above which have no trading capability?

This is why we (Zerodha + Tradelab) have decided to build Pi Bridge to give seamless and reliable connectivity from the charting or programming tool to the trading engine on Pi. The plan is, whatever be your front end, we will help you fire orders using the bridge. This will definitely be the first of its kind in India. We started off by enabling the bridge for the most popular request we got – AFL or AmiBroker Formula Language. We also made the bridge compatible Ninjascript (Ninja Trader) and other programming languages like C, C++, C#, Python, R programming etc. Check this link to know more about them.

Following are the details on getting started with Pi bridge for AmiBroker:

Enabling Pi Bridge

You can place a request for the bridge on the Pi page of Q by clicking on Start the Pi bridge trial .

pi-bridge-screen-edited-SRH

After a 7 day free trial we you will automatically be charged Rs 500/month + taxes (which will be automatically debited from your trading account on the first week of every month). Enabling the bridge might take up to 24 hours from the time you have put in a request.

If you wish to unsubscribe, you can disable access from from Q itself, as manual requests will not be accepted.

Installing

Make sure both Pi and AmiBroker applications are closed. Download the installer from Q after you are enabled for the bridge.

Double click on the Pibridgeinstaller.exe file from the installation file for Bridge that you would have downloaded from Q. You should get a message saying Pi bridge installed successfully within a few seconds. Once done you should be able to see pibridge.net.dll in installed Amibroker folder on your computer.

Launch Pi and select Two-way Semi-auto or Mock trading

Make sure you first launch Pi before AmiBroker (every time you want to use the bridge). You can go to View -> User Settings on Pi, and under Pi Bridge choose either Mock , Semi Auto, or  Two-way Semi-auto trading (will explain both in a bit).

2 Way Semi Auto trading

Launch AmiBroker

If everything has happened correctly, as soon as you launch AmiBroker, you should see the Pi Bridge button turn from red to green at the bottom of the Pi screen.

bridgeicon

 

*Even if you don’t see a green light, we have added a small check in the AFL  if(!brd.GetConnectionStatus()) brd.Reconnect();  to reconnect the bridge before the order is fired.

Difference between Mock and Two-way Semi-auto trading

When you select mock, orders are logged as a file and this can be used to test and improve your trading system. You can find the log under Pi folder as PiBridge.log; see the image below.

In Two-way Semi-auto trading, the orders instead of getting logged onto a file, get logged into a window called “generated alerts” from where it can be very easily traded.

log

Mock – Logs

Firing order from AmiBroker using AFL

To place orders, you have to first create a Pi Bridge object using CreateStaticObject function (AmiBroker function to create a global instance) and place orders using the PlaceOrder function.

API Details –

PlaceOrder(string pExchnge, string pTrdSymbol, string pSymbol, string pUserStrategyName, short

pOrderSide, int pInitialQty, int pDiscQty, double pLimitPrice, double pTriggerPrice, string pOrderType, string

pProdType, string pClientCode, string pValidity)

Example:

//COM Calling function:

brd=Null;

if(IsNull(brd))

{

brd = CreateStaticObject(“pibridge.Bridge”);

}

//AFL Buy Logic

brd.PlaceOrder(“NFO”, “NIFTY15SEPFUT”, “NIFTY”,”STRATEGYNAME”, 1, 50, 50, 8500.05, 0, “L”, “NRML”,

“DN0005″,”DAY”);

where

pExchange = “NFO” or “BFO” or “CDS” or “MCX”

pTrdSymbol = “NIFTY15SEPFUT”

(you could see from Pi Marketwatch Trading symbol columns)

pSymbol = “NIFTY” or “BANKNIFTY” etc. should be within 10 characters

pUserStrategyName = strategy name through which orders are put to distinguish orders from different strategies..

pOrderSide = 1 or2 . 1 for Buy or 2 for sell

pInitialQty = 1 (put actual quantities to trade)

pDiscQty = 0 for default

pLimitPrice = 8500.05 (price in INR for NIFTY15SEPFUT)

pTriggerPrice = 0 price in INR (send non-zero values in case of SL and SL-M order type)

pOrderType = “L”, “MKT, “SL”, “SL-M” for Limit Market, StopLoss and StopLoss Market ordertypes.

pProdType = “NRML” or “MIS” or “CNC”

pClientCode = “DN0005” Your Pi User id like DN0005

pValidity = “DAY” or “IOC”

Here is an example on a simple strategy, sending a buy/sell order every 15 seconds at a predetermined price.

Write the AFL and take it live on AmiBroker

order

AFL to place order every 20 seconds at set buy/sell Nifty values

Generated alerts window on Pi

As soon as you take the AFL live, every time your AFL gives a buy/sell, the alert is logged into the generated alerts window (under the Alerts menu on Pi) along with a Buy/Sell Trade button. When you click on this, the buy/sell order window opens with your predetermined product type, quantity, and order type. See the pic below where you will see a buy/sell alert generated every 20 seconds.

final

Generated Alerts

Here is a short Video of the Pi Bridge for Amibroker in action:

For all those looking to get started coding on AmiBroker, here is a link to download a database of over 5000 AFLs. Make sure to backtest before taking any strategy live. If you have any coding related queries related to the Pi Bridge you can post it here.

Note: The Pi bridge will work with AmiBroker irrespective of where you source the data feeds from. As a Zerodha client you can get a special offer on real-time data feeds from Neotrade Analytics.

 

Happy Trading,

Nithin Kamath

Founder & CEO @ Zerodha, team working towards breaking all barriers that I personally faced as a retail trader for over a decade. Love playing poker, basketball, and guitar. Getting body fat % in single digit is the next personal endeavor :) .

625 comments

  1. stock hunter says:

    if i want to use amibroker bride, then i need amibroker software and data feed ?? or i can get data from PI ?? sorry dont hv that much knowledge about these things

    • Yes, you will need to have amibroker and data feed for it. You can’t get data feed for amibroker from Pi.

      • sandip says:

        Respected Sir , Pi Bridge for Amibroker……..why semi-automated ?

        allow fully automated at the earliest . mainly in MCX.

        i hope in till feb month end , you can do it.

      • ShirajRoz says:

        Data from PI to EXcel enabled ?

      • Dileep says:

        Where do I get Amibroker? Does 500 per month includes data feed plus amibroker charges? Also How much for Amibroker?

      • SAI says:

        I WISH TO ADD INDICATOR OF KPL FO PI ,MAY THAT I GET ?
        THE BELOW MENTIONED FORMULA AMIBROKER KPL AFL
        _SECTION_BEGIN(“SS 36”);
        no=Param( “Swing”, 36, 1, 55 );
        res=HHV(H,no);
        sup=LLV(L,no);
        tsl=IIf(ValueWhen(IIf(C>Ref(res,-1),1,IIf(CRef(res,-1),1,IIf(C<Ref(sup,-1),-1,0)),1)==1,sup,res);

        Plot(tsl, _DEFAULT_NAME(), colorCustom12, styleStaircase); PlotText( "S.S 36\n", LastValue(Cum(1)), LastValue(tsl), colorCustom12)|styleNoRescale;

        Buy=Cross(C,tsl);
        Sell=Cross(tsl,C);
        shape=Buy*shapeUpArrow + Sell*shapeDownArrow;
        PlotShapes(shape,IIf(Buy,colorCustom12,colorCustom12),0,IIf(Buy,Low,High));
        _SECTION_END();

      • SHREE BHASKAR says:

        SIR,
        CAN I ASK YOU ABOUT AMI BROKER? IN ADDITION TO THAT DATA FEED PRICE? PLEASE TELL ME THE FULL DETAILS ABOUT THE SOFTWARE AND OTHER EXPENSES, SOFTWARE SUPPORT ETC.

        THANK YOU,
        SHREE BHASKAR

        • Akshay.A says:

          Amibroker is third party product and we don’t give any support for that. we don’t also provide data feeds, you would have to check with someone for this.

          • Rohit says:

            Dear Akshay,

            I am a user of Zerodha, gone through all the articles present. I have a few doubts. Could yourself or any one of your technical team members kindly call on my registered mobile number.

            Thanks,
            Rohit

            • Can you email [email protected] with contact details and query.

              • Dharanidharan Ganesan says:

                Hi Hero of Zerodha,

                I am Dharanidharan Ganesan, ZA9362.
                I like to know the difference between the Zerodha PI alert and Amibroker Alert in real market(Which is more realable based on timing).
                I am planning to buy Amibroker software for generating alert only…. If PI alert is superior I will be happy.
                Need some guidance to create alert.
                I cant find any video tutorial series for Pi alert.

                Please guide me…

    • Priyanka Satti says:

      By mistake i have activated my PI brdige 3 days back, now the status is showing as enabled.

      Please tell me how unsubscribe it ?? i dont want it but unable to find the unsubscribe button..

  2. manju says:

    1. sometimes the buy sell signals are generated as the candle is still forming. So do they generate alerts? How to handle this?
    2. What do i do if i want to trade only at high/low of the signal candles?
    3. Can u shed some light on multiple strategies? How to go about it? Open multiple charts in tile mode?

    • Manju, will not be able to help you on Amibroker. There are a lot of forums discussing on Amibroker, do google for it. I am sure you can handle all that you want on AFL.

      • manju says:

        Atleast 3rd question? as it pertains to the bridge . I mean, if one wants to trade multiple strategies, all have to be kept open in tile mode or any specific mode?

        • Even the 3rd question doesn’t pertain to bridge. The bridge will accept orders from AFL, as long as you have that code to fire orders. As far as Ami is concerned, as long as you are running all the strategy, don’t think which mode makes a difference.

          • Sudhahar says:

            Dear Nitin,

            In order to just get a buy or sell signals generated in PI? Are you really suggesting us all this? – to buy/subscribe Amibroker for writing AFL, subscribe Neotrade for data feed and subscribe for Pi Bridge with Zerodha ??? Sounds misleading. So are you telling us there is no way to trade automatically in Zerodha or you are reserving this functionality for benefiting some privileged customers ?

        • CHOKS says:

          Hi,
          To trade multiple symbols in Amibroker,say for Ex you have 50 symbols in ur database, you want to apply ur strategy to all symbols;
          Two options are there,
          Option-I
          open chart for each symbols and lock it. U’ll hav 50 charts opened in ami.No need to Tile windows or Float Windows.u just view any symbol chart.What ‘ll happen,Ami ‘ll simultaneously update all 50 Charts and any signal generated on any symbol or any chart ‘ll reflected in pi.
          But this method consumes large memory of Ami, so Ami performance ‘ll go down.

          Option-II
          No Need to open chart for each symbol
          Open only one chart any symbol
          Just send ur AFL to automatic analysis window and set the following in settings DropDown Menu
          Tick – Auto-Repeat Scan/Explore
          Set AR interval to 1S (1 second)
          & do the following in settings page (very Important)
          General TAB;
          Initial Equity – If u plan to invest 10000 per symbol then 50 x 10000 = 500000
          Position – long & short
          Periodicity – ur Chart Time Interval
          Min Shares – 1
          Min Position value – 10000 (Ur investment Per symbol- Trade value)
          Account Margin – 100
          PortFolio TAB;
          Max Open Positions – 50 (No of symbols u want to track)

          That’s it
          Press the Scan button
          It’ll Scan all Ur all symbols every 1 second with Ur AFL
          and any signal generated on any symbol, It ‘ll fire orders to Pi.

          “The goal of a successful trader is to make the best trades. Money is secondary.” – Alexander Elder

          Happy Trading

          If ur Using latest Version of AmiBroker i.e. 5.7 or above;

          • RK1480 says:

            I have installed Amibroker 5.9. I could not find :
            automatic analysis window ,
            Tick – Auto-Repeat Scan/Explore
            Set AR interval to 1S (1 second)
            General TAB;
            please guide

      • RA2351 says:

        how can I open pi

  3. maheshwar says:

    Hi Nithin,

    one more great news, hope to see the MT4 bridge soon :), any timeframes Nithin ?

  4. RAJESH J says:

    Halo Nithin Witch is Working Best Charting Platform ( Amibroker / Ninjatrader / Metatarader ) For PI Bridge ? Thank You

    • Rajesh, for now we only the Bridge for Ami live. I guess Ami is better as you have so many users to help you out with AFL’s.

    • Abhijit says:

      I prefer Ninjatrader. It is free, supports free NSE feeds from yahoo finance, allows adding extra indicators(even add custom code), backtest, and also run Monte Carlo simulation. I request Zerodha to come up with Pi bridge for Ninjatrader platform. I will be happy to pay for Pi bridge for Ninjatrader.

  5. kirrick says:

    pExchange – Does this support “NSE” also ( I mean equity) ? I can see only NFO option in the doc above

  6. Nachiket says:

    That last link just made my day. My hard disc crashed yesterday. Re-installed everything today but all the AFLs were lost. Thanks!

  7. udit says:

    Thanks for this much awaited feature. Is there any Api to place cover orders? Something like brd.placeCoverOrder that will accept stop loss as an additional argument? If not currently available, can I expect to see it in the near future?

  8. Muthukumar says:

    Any one have AFL for pair trading/arbitrage trading? Please one when i get..I plan to do with Pi Bridge

  9. Fadil says:

    sir

    is PI bridge for amibroker mean give PI datafeed to amibroker ?
    sir can i use amibroker AFL in PI for back test ?

    plse reply

  10. aju says:

    Hi nithin
    can u add few demo video detailed PI bridge ?

  11. rahul says:

    Hi nithin
    I have a personal wish can u recommend few AFL {I’ve seen AFL library upload above} which would be the best as well as accurate for day tradere

    Dont forget to recommend
    Thanks in advance

    • Rahul, don’t think there is anything like the best or most accurate in this business. I guess you have to backtest and adapt, the list of codes is just to help you get started. Even if I suggest you something, it may or may not work, don’t want to be responsible for that. One of the reasons we as a business have stayed away from suggesting what to buy/sell.

  12. Bala says:

    Hi Nithin sir, how to get the offer from neotrade analytics for data feed?.

  13. fadil says:

    sir can i use amibroker AFL in PI for back test ?

  14. fadil says:

    sir
    in ur knowledge any method to covert AFL file to a trade script format ?

  15. rahul says:

    Hi nithin
    is bracket order avail on PI ? also
    when wil be the final launch of PI ?

  16. pravin says:

    Dear Nitin,
    how can we change the code below to send orders automatically for different scripts, e.g if i want to send orders for Reliance and CESC futures, i want to create one strategy AFL and depending on the script it should pick up the script name from amibroker automatically, instead of having to hardcode the script name in the code below as well as the order quantity and limit price as applicable for that script.

    brd.PlaceOrder (“NFO”, “NIFTY14DECFUT”,”NIFTY”,”STRATEGYNAME”, 1,50,50, 780000, 0, “L”, “NRML”, “DZ1105″,”DAY”);

    • CHOKS says:

      Hi Pravin
      It’s very simple
      It all depends on from where u r getting data feeds and format of the symbol name in Ami Database.
      I’ll explain for equity.
      My database contains symbols of all Nifty stocks i.e CIPLA, TATMOTORS, BPCL etc
      I just included the following in my AFL

      Symbol = StrFormat(Name()+”-EQ”);//

      What happens, if signal is generated for CIPLA,the AFL automatically create symbol as CIPLA-EQ

      Normal AFL Symbol Specific;;;;

      brd.PlaceOrder (“NSE”, “CIPLA-EQ”,”NIFTY”,”STRATEGYNAME”, 1,50,50, 780000, 0, “L”, “NRML”,
      “DZ1105″,”DAY”);

      So in place of “CIPLA-EQ” use Symbol
      For All Symbols in DataBase
      brd.PlaceOrder (“NSE”, Symbol ,”NIFTY”,”STRATEGYNAME”, 1,50,50, 780000, 0, “L”, “NRML”,
      “DZ1105″,”DAY”);

      So any signal generated on any symbol on any chart, ‘ll have that particular Trade symbol in the brd.PlaceOrder and orders ‘ll be fired to Pi.

      For Qty
      I’ll Explain wat I’m doing
      I always want to invest 50000 per symbol ie my investment is fixed for all symbols at 50000;
      So for Ex :
      CIPLA ‘s mkt price is 659

      Qty = ceil(50000/lastvalue(c,1)); i.e 75 Qty for CIPLA
      Buyprice = Valuewhen(Buy,C);

      For Each Symbol Qty ‘ll differ buy trade Value Remains same.

      Just add Qty to brd.PlaceOrder as follows

      brd.PlaceOrder (“NSE”, Symbol ,”NIFTY”,”STRATEGYNAME”, 1,Qty,0, Lastvalue(Buyprice,1), 0, “L”, “NRML”,
      “DZ1105″,”DAY”);

      For Futures, If u post ur Symbol format, if possible all Symbols and ur Investment, I’ll post AFL Code

      Happy Trading

      • pravin says:

        Thanks Nitin for explaining how to select symbol, however for Futures Quantity is fixed lot size and differs by symbol, so the calculation of dividing by the amount per contract will not work it will have to pick up the lot size as per the symbol e.g Cipla is 250 lot size and Reliance might be 500, we cannot fix this in the afl to any one size, or can pi bridge understand if we say 1 lot and pi will adjust the order as per lot size, please suggest.
        regards
        pravin

      • pravin says:

        Sorry thanks choks

        • CHOKS says:

          Hi Pravin,

          I posted some code here …Pl check it….

          Where Ur getting data for AmiBroker?
          How many Lots Do you Trade per Symbol?
          Ur Symbol format in DataBase? Ex ICICIBANK or ICICIBANK-EQ or ICICIBANK-I or ICICIBANK15JANFUT
          How many Symbols U want To Trade? Ex 20 or 30 etc
          Ur AFL based on Which Time Frame?

          Last important Question,,,
          Till What Date U Trade current month Contract?
          Ex if Current month Contract Expires on 29 Jan 15 ,,,,Till Wat date u Trade This Contract?

          Post Ur Replies I will code it….
          If u post ur Snapshot of amibroker with symbols Tab visible in the Left…It ‘ll Better for me to Code…..

          • CHOKS says:

            In Pi Bridge, no need to mention Lot Size i.e. 1250 or 2000 etc…
            Just Qty of Lot ‘ll work Ex 1 or 2 etc….

            • fadil says:

              HI Chocks
              any way to convert Amibroker afl to trade script code for bcktesting in Zerodha PI

              • CHOKS says:

                Hi Fadil,
                No Software or apps is available for converting afl to TradeScript….
                Even if someone has such apps, it ‘ll not convert it fully…
                Bcoz , AFL is more advanced Coding than Tradescript…..All AFL functions Cann’t be converted into tradescript…….

                tradescript is basic coding language to get idea about Algo or Auto trading……..

                As mentioned by Nitin…. Once You got Basic Idea on charting, Coding and Algos, U hav to move to Professional Charting softwares like Amibroker…..

                Moreover
                Why U want to convert ur AFL to TradeScript?
                U Can Backtest it in the Ami itself, which has More option to backtest……If U hav any Specific Reason pl Post it

                Happy Trading

          • pravin says:

            hi choks,
            i’m using GDFL, the amibroker symbol is in format “cipla-I” for current month contract, whereas in ZT it is CIPLA29JANFUT , we will need to convert the symbol name to Zt format.
            thanks for all the help once more.

            • CHOKS says:

              Hi Pravin,
              If u r subscribed for GDFL dataplan,then U might hav GDFL trading Plugin enabled which has function called symbol Mapper..U might hav known…It’s a csv file placed in C:\program files\Amibroker\Formulas\GDFL-NEST\GFDL_NEST_Symbol_Mapper.csv.Just open it , in col A enter the symbol in Amibroker i.e CIPLA-I and in col B enter the respective trd symbol i.e CIPLA29JANFUT…Likewise u add all symbols in database leave the first row or header and save it in the same file format i.e.csv
              then
              Just Copy the Below Code and Paste at the end of your AFL i.e. before
              _SECTION_END();

              When U Copy Paste from ZConnect, the Double Quotation mark will Change in AFL, So ReType all Double Quotation Marks after copy Paste. and Change the Client ID parameters with Urs…

              That’s all U hav to do..Whenever the buy/sell signal generated on chart, it’ll automatically compare the symbol on chart in csv file and respective trade symbol ‘ll be added to the brd.Placeorder Just in the parametr window set ur Order Type , lot size etc…it’ll work for all symbol in database…

              ///——————————————–\\\\\

              ClientId = “DP0012″;//Change As per Your client ID
              Symbol = StrFormat(Name()+”-EQ”);
              QYT = Param(“Lot Size?”,1,1,25,1);
              Exch =ParamList(“Select Exch?”, “NFO|BFO|NSE|BSE|CDS|MCX” );
              PType = ParamList(“Product Type?”, “MIS|NRML|CNC” );
              OType = ParamList(“Order Type?”, “L|MKT|SL|SL-M” );

              OT_SNM = “Use Symbol Mapper Dictionary”;
              OT_SN =”NOTHING”;
              GFDL_OT_SM(OT_SNM,OT_SN);

              BuyP = LastValue(ValueWhen(Buy,C),1);
              ShortP = LastValue(ValueWhen(Short,C),1);
              SellP = LastValue(ValueWhen(Sell,C),1);
              CoverP = LastValue(ValueWhen(Cover,C),1);

              Checkone=Nz(StaticVarGet(“Check”),0);
              Checktwo = LastValue(BarIndex(),1);
              OrdCond=LastValue(Buy) OR LastValue(Short) OR LastValue(Sell) OR LastValue(Cover);

              Brd = Null;

              if(OrdCond AND CheckOne != CheckTwo)
              {
              brd = CreateStaticObject(“pibridge.Bridge”);

              if(LastValue(Buy))
              {
              brd.PlaceOrder (Exch, OT_FSN ,Symbol,”MyAFL”, 1,Qty,0, BuyP, 0, OType, PType, ClientId,”DAY”);
              }

              if(LastValue(Sell))
              {
              brd.PlaceOrder (Exch, OT_FSN,Symbol,”MyAFL”, 2,Qty,0, SellP, 0, OType,PType, ClientId,”DAY”);
              }

              if(LastValue(Cover))
              {
              brd.PlaceOrder (Exch, OT_FSN,Symbol,”MyAFL”, 1,Qty,0, CoverP, 0, OType, PType, ClientId,”DAY”);
              }

              if(LastValue(Short))
              {
              brd.PlaceOrder (Exch, OT_FSN,Symbol,”MyAFL”, 2,Qty,0, ShortP, 0, OType,PType, ClientId,”DAY”);
              }
              StaticVarSet(“Check”,CheckTwo );
              }

              Reset = Ref(Buy,-1) OR Ref(Sell,-1) OR Ref(Short,-1) OR Ref(Cover,-1);
              if(LastValue(Reset))
              {
              StaticVarRemove(“check”);
              }

              Alert = Buy OR Short OR Cover OR Sell;
              AlertIf(Alert,”SOUND C:\\Windows\\Media\\Notify.wav”, “Audio alert”, 0 );

        • Satya says:

          After going through one of the video presentation in youtube taking about the P1 Bridge, for me it looks like it can read the Amibroker chart and punch the orders, was it completely automated? means do i need to click on submit on the order or it just takes it?

  17. sh says:

    When will the Pi to Ami bridge be activated ?.

  18. Alex says:

    Dear Nitin,

    For long have been using Zerodha trader terminal with RTD activated for live data into excel and thereby into Amibroker. Will this feature remain intact in Pi too or have to pay now on for RTD ???

  19. Billa says:

    Hi Nithin,

    Am trying to write simple strategy in Tradescript, its giving signals properly, but to finetune it furthermore like adding stoploss n some tweaks, I need to make small modifications in code but dont know how to code that ( read manual completely )…So where can I find sample codes for stoploss,target ? Zerodha tech team will help ?

    Thanks….

  20. Billa says:

    Is it possible to select Date Range for Back testing of Tradescript strategy in Pi ?

    If not, Please do include that option, will be very helpful when we test strategies on Futures contract ( so that we can test strategy on each month contract in specific range )

    Thanks Nithin….

  21. dp0012 says:

    PI bridge for AMI is use less if bridge work like this. Its keep sending buy/sell order every second you can pick buy or sell to place the order. PI Bride should send order to PI for buy and sell when any signal appear in Ami. other wise if some one has to monitor 5 or 6 chart. He will gone mad to see the 5 to 6 signal in one second in PI and failed to select correct signal.

    • getting someone to call you back and have this fixed.

      • Seems to be working fine at our end, can you check your strategy. If your strategy on AFL gives you 6 signals a second, those six alerts will be triggered here. You will need to make those changes in your AFL

        • dp0012 says:

          I have tested some other service provider auto trade software it’s working fine with my AFL. Only place the order when signal appear on the chart. But when i live the PI its shooting buy or sell every second. I have added below to my AFL.

          _SECTION_BEGIN(“PI-AUTO”);
          //COM Calling function:
          brd=Null;
          if(IsNull(brd)) {
          brd = CreateStaticObject(“pibridge.Bridge”);
          }// AFL Buy/Sell Logic

          brd.PlaceOrder (“NFO”, “ICICIBANKJAN15FUT”,”ICICIBANK”,”AMI-B”, 1,3,1, 0, 0, “M”, “MIS”, “DZ1105″,”DAY”);
          brd.PlaceOrder (“NFO”, “ICICIBANKJAN15FUT”,”ICICIBANK”,”AMI-S”, 2,3,1, 0, 0, “M”, “MIS”, “DZ1105″,”DAY”);
          _SECTION_END();

  22. sh says:

    Pi bridge is not working for me. I am getting the error that the server cannot be started and the attached error as well. Please check.

  23. PT says:

    with 4-5 days of using live charts…quite few problems… don;t have confidence in watching the charts to manage the trade. as they frequently stop drawing and lack of refresh button makes it difficult, need to close the chart and reopen…today’s example attached… instead of current candle the candle the old candle started changing with illusion that price is still within the limit drawn…after re adding the chart that candle showd long wick which was not there before and now the wick is gone and the actual candle is showing gap down as it should.

  24. Udit says:

    Hi Nitin,

    I am getting the following error when installing PI Bridge :
    “Could not find Amibroker installed”

    My Amibroker is installed in the following directory
    C:\Program Files (x86)\AmiBroker

    Please provide a resolution quickly. I have also raised a support ticket for the same
    http://support.zerodha.com/tickets.php?id=944472

  25. Billa says:

    Hi Nithin..

    When our tradescript backtest completes, all the indicators we used in code are coming in result page ( with chart above and all the indicators used in code below in minimized forms ).

    If possible, before showing up backtest results , a dialog box with options to show/hide indicators based on our need will be great for users, who just need Buy/Sell signal for clear view ( or based on their choice of view ) and indicators wont get cramped at end of page.

    For example even if we try simple crossover code, it generates atleast 4 indicators below. Please take this as my suggestion…

  26. Udit says:

    Sorry Nithin I didnt see your reply before posting this. Ignore 🙂

  27. kirrick says:

    When I try to install nothing happens and I went to the directory and there also nothing was added.

    Also my PI bridge request is still pending.

  28. kirrick says:

    I installed the latest PI bridge. When i tried to login it just hung. Then uninstalled PI reinstalled it. I use Windows 8.1 and this time it asked to install the dependables and never has asked this for my previous 2 installation of PI . Now its been more than 1.5 hrs and its still hanging and this time have not even installed PI Bridge.

    Never faced this issue before. Please look into this soon

    Regards,
    Harish

    • Getting Saket to call you back.

      • kirrick says:

        Thanks Nitin.. I got the help for setting up the bridge.

        As far as PI hanging during login …. This is my observation/scenario ……..
        1. Login using credentials
        2. Input the answers to secret questions
        3. Again the login screen is shown … During first login this would be present for sometime. Actually what I used to do this time was that again I clicked on “Login” button in this screen and PI used to just hang.
        If i dont click on login button again after input of secret answers … Everything works fine.
        Note- This issue is only during first login

  29. Mohideen says:

    Hi Nitin,

    Client ID is RM0029.

    1st let me congratulate you for an excellent software “Pi”. I know it will take some time but just a kind reminder except market watch no other fonts could be customized or made to “Best Fit Of All”.
    I have installed Pi plus the Amibroker Bridge including the latest patch still the bridge is RED. I have called zerodha they said send a mail 2 [email protected] still waiting for somebody 2 help me out as my trail of amibroker bridge will expire on 27th.

    • Mohideen, the latest release of bridge is available on Q. Do install it. A small change in the code, I have already updated the blogpost above as well. So even if you see red light on Pi, fire the order with a new code, it should work.

  30. Vaibhav says:

    Hi Nitin,

    I have downloaded and installed the PI bridge patch. I get the installed alert prompt. However, I’m no able to see the bridge file in the Pi folder.

  31. Vaibhav says:

    Nor do I see the second green light at the bottom. DO I need to wait for activation?

    • There is an update to the code, can you check now. Do copy this within your AFL. It is okay even if it showing red light. If you run the AFL, the pi bridge should turn from red to green.

      • Udit says:

        Hi nithin,

        Even after doing the aforementioned, I am not able to get the bridge to work. Amibroker complains saying com object is null. Please help.

        • Udit, can you send an email to [email protected] and [email protected] with your contact. They will call back and check this out.

          • Udit says:

            Its working fine now. It will be a really convenient feature for my wife :). Now if you can just add support for cover orders it will be really great. We can calculate the SL in AFL and pass it on to Pi through the bridge.

            Sharing the afl snippet that I am using to help others..

            _SECTION_BEGIN(“Pie Bridge”);

            enablePiBridge = ParamToggle(“Enable PI Bridge?”,”NO|YES”,1);

            Contract = ParamStr(“Contract”,”NIFTY15JANFUT”);
            Sym = ParamStr(“Symbol”,”NIFTY”);
            nLots = Param(“Lots”,4,1,20,1);

            if(enablePiBridge) {

            brd=Null;
            if(IsNull(brd)) {
            brd = CreateStaticObject(“pibridge.Bridge”);
            }// AFL Buy/Sell Logic

            if(!brd.GetConnectionStatus()) brd.Reconnect();

            if(EndValue(Buy) == 1) {
            brd.PlaceOrder (“NFO”, Contract,Sym,”PIVOTBREAKLong”, 1,nLots,0, EndValue(C), 0, “LIMIT”, “MIS”, “DU0126″,”DAY”);

            }

            if(EndValue(Sell) == 1) {
            brd.PlaceOrder (“NFO”, Contract,Sym,”PIVOTBREAKLong”, 2,nLots,0, EndValue(C), 0, “LIMIT”, “MIS”, “DU0126″,”DAY”);

            }

            if(EndValue(Cover) == 1) {
            brd.PlaceOrder (“NFO”, Contract,Sym,”PIVOTBREAKLong”, 1,nLots,0, EndValue(C), 0, “LIMIT”, “MIS”, “DU0126″,”DAY”);

            }

            if(EndValue(Short) == 1) {
            brd.PlaceOrder (“NFO”, Contract,Sym,”PIVOTBREAKLong”, 2,nLots,0, EndValue(C), 0, “LIMIT”, “MIS”, “DU0126″,”DAY”);

            }

            }

            _SECTION_END();

  32. Paresh says:

    Hi ,
    i am new , i am heaing about auto trade with zerodha , how is work and how much perct. safe
    i am not full concrate in trading i , am looking amibroker with zerodha,
    i am only take postion in NSE future opition and leave so how is work amibroker and given singnal sell and buy comes in acc. money , need any human interface or not
    pls. guide me
    tnx

  33. Billa says:

    Nithin, Requested for Pi Ami Bridge activation yesterday, Please activate… Thanks

  34. dp0012 says:

    when we run the patch i received the error amibroker not found. i have to done all the patching manually.

  35. Manish says:

    Hi Nithin,

    I installed PI and now want to try out this Bridge too. Here is my question. Let’s say I don’t use AFL to fire buy sell… instead I use the Buy/Sell trigger we have built in from Amibroker.. will it work ?? Here is the screen shot for your reference.

    http://prntscr.com/5vxcxc

    I know PI has this feature of trading from the chart… but Basically.. I want to fire the order from Amibroker instead of doing that from PI. 🙂

    • Manish, if you have someone who is proficient at AFL, this should be easily possible. Like I said in the post, we are also working on giving you back order updates, so you can even run execution algos that are available on Ami.

      • Nachiket Joshi says:

        How would the brokerage be charged if we’re using our execution logic from AFL? Would we be charged 20 for every order that’s traded or the master order? On other words, how would you identify an order which has been sliced?

        • Nachiket, we will still charge per executed order within our trading platform. If you have a master order on Ami and using some execution logic, the trading platform will not really be aware of it.

  36. dp0012 says:

    New patch installation error.

  37. narsima-rn0564 says:

    its okay dont eye the sky be on earth&take ur minimum basics in PI first provide pivot,r,r2,s1,s2 mr.kamath these r basics in any software.walk the talk be realistic

  38. kirrick says:

    For an active trader one of the benefit is quick order placement through the bridge. Whenever a order gets updated in the notification window can it come with a beep sound so that the trader is alerted, now its assumed that he would be glued to the screen always.
    Other point is when we have mulitple order entries, can we have a colour code if the user has already clicked on it. So that he knows what he has seen and what not . I think current ZT works like this only

    Regards,
    Harish

    • Yep, on our list of things to do.

    • CHOKS says:

      Hi Harish,
      If u Use Amibroker, U can do it with AFL

      Alert=Buy OR Sell OR Short OR Cover;
      AlertIf(Alert,”SOUND C:\\Windows\\Media\\Notify.wav”, “Audio alert”, 0 );

      in Built Notify.wav is not that Much audible,
      So U can Download any Hig Pitch Wav file from Net and copy to C;/Windows/Media Folder and use it…

      Happy Trading

  39. Ramesh Gangappa says:

    Hi Nithin,
    I have installed Pi plus the Amibroker Bridge including the latest patch still the bridge is RED.
    Amibroker complains saying com object is null. Is there any specific to Amibroker version?

    Thanks
    Ramesh G

  40. Billa says:

    Zerodha…Please activate my Pi Amibroker Bridge..still status is pending..

  41. Nilanjana says:

    Pi Bridge for Amibroker is good stuff. What are the requirements for fully automated trading in MCX?

    Your MCX transaction cost 310 is now high. Other discount brokers reduced their charge to 260.
    You already have lowest transaction charge in NSE derivative. We have full faith on you.

    I want to ask little tough question to you but it is important.
    How much more volume do you need to bring it down?

    Best of luck.

    • Nilanjana says:

      I am interested with PI. Want to join Zerodha soon.

    • Nilanjana, presently we don’t have full automation on MCX. You could use the bridge for semi-automation. The commodity business hasn’t really picked up much, but yes we are looking at ways to reduce any additional overheads.

      • sandip says:

        Nithin sir, what you said ? “The commodity business hasn’t really picked up much”. 🙂
        Your transaction cost is still very high in MCX .check your brokerage calculator.
        only high volume traders are able to afford & utilize zerodha.
        zerodha is cheaper but still not the cheapest.
        Rs 10 per trade is not far away.let see who will make new records… maybe a new broker will come or zerodha will do it.

  42. Billa says:

    Hi Zerodha,

    When I do Mocktrade with AFL, its generating too many signals in PiBridge Log (almost every 2 seconds), but in AFL only 1 signal is generated. Client ID : DB0235

    Can you pls suggest a solution..Thanks..

    • Billa, you have to make changes in your AFL code. My guess is that your AFL code is firing orders every 2 seconds, so it just has to be coded properly on AFL. The Bridge picks up alerts, only when it is fired by AFL, and not on its own. Will try to put up some sample AFL codes next week.

    • dp0012 says:

      In my case i am also facing same issue. This amibroker bridge bridge firing to many signal.

      • Like I said, Pi bridge just accepts your signals sent by your AFL. So it is upto the way your AFL is designed. If you are getting continuous buy alerts, put in a condition saying fire the next alert only when a sell comes. We will put up some sample strategies soon.

    • CHOKS says:

      Hi Billa,
      This is bcoz of Ur AFL.The Ami Chart is refreshed every sec,so that it re executes all the lines in ur AFL every Sec . As Long As the lastvalue or EndValue (BUY) or (SHORT) or (COVER) or (SELL) == 1, it’ll fire orders to PI Bridge.For Ex if chart time frame is 1min, & u got Buy signal at 10:55:06, the lastvalue(BUY) ‘ll remain 1 Until 10:55:59 & at 10:56:00 it’ll become zero.So ami ‘ll continuously fire Order from 10:55:06 to 10:55:59.

      For that U hav two option;
      One is make the RefNO Unique.
      Ex;
      BuyRef = StrFormat(Name()+”_Buy_” + Cum(Buy));
      What’ll happen, as soon as the 1st buy signal fired at 10:55:06,it’ll be reflected in Pi Bridge and other signals ‘ll be rejected by the pi since other fired signals have same BuyRef & Finally U’ll hav only one order shown in Pi Bridge.

      Option-II
      Using StaticvargetText and StaticvarsetText
      This method is very good.Bcoz it’ll fire only one signal & other signals are ignored by amibroker AFL itself.
      Just post ur Ami Time Frame & I’ll post relevant code…..
      Hopes this might hav solved ur Problem……..
      Happy Trading

      • dp0012 says:

        Hi CHOKS i am using 5 minutes time frame. Pls advice the sample code what we have to use with our AFL. Thanks for your help.

        • CHOKS says:

          Hi Just, Copy the Below Code and Paste at the end of your AFL i.e. before _SECTION_END();

          When U Copy Paste from ZConnect, the Double Quotation mark will Change in AFL, So ReType all Double Quotation Marks after copy Paste.

          I Hope This’ll work….Check it …..

          Happy Trading

          ////——————————-\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

          ClientId = “DP0012”;//Change As per Your client ID
          TrdSymbol = “ICICIBANK15JANFUT”;//Change As per Your Symbol
          Symbol = “ICICIBANK”;//Change As per Your Symbol
          QYT = Param(“Lot Size?”,1,1,25,1);
          Exch =ParamList(“Select Exch?”, “NFO|BFO|NSE|BSE|CDS|MCX” );
          PType = ParamList(“Product Type?”, “MIS|NRML|CNC” );
          OType = ParamList(“Order Type?”, “L|MKT|SL|SL-M” );

          BuyP = LastValue(ValueWhen(Buy,C),1);
          ShortP = LastValue(ValueWhen(Short,C),1);
          SellP = LastValue(ValueWhen(Sell,C),1);
          CoverP = LastValue(ValueWhen(Cover,C),1);

          Checkone=Nz(StaticVarGet(“Check”),0);
          Checktwo = LastValue(BarIndex(),1);
          OrdCond=LastValue(Buy) OR LastValue(Short) OR LastValue(Sell) OR LastValue(Cover);

          Brd = Null;

          if(OrdCond AND CheckOne != CheckTwo)
          {
          brd = CreateStaticObject(“pibridge.Bridge”);

          if(LastValue(Buy))
          {
          brd.PlaceOrder (Exch, TrdSymbol ,Symbol,”MyAFL”, 1,Qty,0, BuyP, 0, OType, PType, ClientId,”DAY”);
          }

          if(LastValue(Sell))
          {
          brd.PlaceOrder (Exch, TrdSymbol,Symbol,”MyAFL”, 2,Qty,0, SellP, 0, OType,PType, ClientId,”DAY”);
          }

          if(LastValue(Cover))
          {
          brd.PlaceOrder (Exch, TrdSymbol,Symbol,”MyAFL”, 1,Qty,0, CoverP, 0, OType, PType, ClientId,”DAY”);
          }

          if(LastValue(Short))
          {
          brd.PlaceOrder (Exch, TrdSymbol,Symbol,”MyAFL”, 2,Qty,0, ShortP, 0, OType,PType, ClientId,”DAY”);
          }
          StaticVarSet(“Check”,CheckTwo );
          }

          Alert = Buy OR Short OR Cover OR Sell;
          AlertIf(Alert,”SOUND C:\\Windows\\Media\\Notify.wav”, “Audio alert”, 0 );

          ///————————————–\\\\\\\

          • sh says:

            Thanks CHOKS,
            Your codes resolved the issue of multiple orders . Great.

          • dp0012 says:

            Working thanks for your help CHOKS.

          • bpr says:

            Hi Choks,

            It is not working for me. Please help.
            When debugging I found the LastValue(BarIndex(),1) is always returning a constant value in my case 186.

            IT actually goes through the if condition once and then never as the value of CheckOne = Checktwo always true afterwards.

            I am new to Amibroker. I was testing this on Nifty 1 minute chart with neotrade data if that helps.

            • CHOKS says:

              Hi Bpr,
              If i’m correct then ur prob is only the first Buy/Sell signal is fired to Pi and Other signals are not fired

              Just copy paste the code below at the end of ur afl i.e.
              before _SECTIONEND
              Delete and retype all Double Quotation in the formula U just copied

              ///—————-
              Reset = Ref(Buy,-1) OR Ref(Sell,-1) OR Ref(Short,-1) OR Ref(Cover,-1);
              if(LastValue(Reset))
              {
              StaticVarRemove(“check”);
              }
              ///———————————-

              • bpr says:

                Thanks a lot CHOKS.

                After putting this I see it that it partially works. Meaning sometimes single order and sometimes multi orders are fired.

                After debugging I see the barIndex () gives a same number most of the time but some times changes the number arbitrarily that causes this issues.

                So I replaced checkTwo with a constant as anyways the barIndex is not working and the logic above urs is a workaround to that

                //CheckTwo = LastValue(BarIndex(),1);
                CheckTwo = 50; // a arbitrary constant

                Now it is working except for cases where a signal comes back to back.

                Because say previous candle has a sell signal and as soon as the current candle start the reset block runs but then when the current candle signal comes it will still go through the reset block thus multiple buy will be fired.

  43. gilari says:

    Can we triger a bracket order using pi bridge when bracket order is eabled in PI ?

    • Not for now, but yeah in the future we will give an option for you to fire various kinds of orders using the bridge.

      • CHOKS says:

        Hi Nitin,
        I think that Current Pi Bridge does n’t support Modify or Cancel Order…
        Those Two features are very Important…..
        Pl try to include it in future release……
        Nest Trading Plugin Supports all three features…Place , Modify and Cancel ….
        And Also…
        Link to Excel i.e. RTD function is very Important to any Trading Platform..So Pl include that too also….
        Happy Trading

  44. sh says:

    Hi
    Anyone able to use Pi bridge successfully ?.

    • sh says:

      Pi bridge is working nicely. Thanks Nitin & Choks for the code. Please incorporate pop-up alert and release the new version of bridge soon. Thanks.

  45. dp0012 says:

    Hi Nithin until we fix the all issue with bridge. pls continue the trial. When all issued fixed then you can charge Rs 300 for PI Bridge. My Trial expire 27 jan.

  46. intime says:

    Hi Nitin,
    1) Is there good Real time data provider to Ambibroker for NSE cash segment?
    2) With Zerodha Pi, we would never have to subscribe to real time data feed. Right?
    3) I am new to automated trading and not planning to trade actively but I want to have i) Backtesting my own strategy as well as ii)Running own startegies in real time(data) with Alerts …Would “Tradescript” sufficient for that in near future develoement of Javascript(6 months)?
    4)I am planning to deploy Ambibroker and/or Zerodha Pi on “cloud VM”…What should be min requirements for cloud VM (wrt no of CPU cores, RAM size, Disk Size)

    Thanks in Advance Nitin

    • intime says:

      Sorrry…Not Javascript but Tradescript

    • intime says:

      Sorrry…Not “Javascript” but “Tradescript”
      Also reason for asking question (3) is “Should I buy ~30K worth Ambibroker” OR is Zerodha Pi sufficient with future devlopments in Zerodha Pi

      • CHOKS says:

        Hi Intime,
        In India , No authorized Vendor is Providing Real Time Data for NSE Equity…
        Earlier Global data Feeds provided data but Stopped Right Now…
        Those who are advertising in Internet, are providing data which is Scrapped from Broker Terminal and also their data Updates 2 o 3 sec after Our Trading Terminal and also they are not authorized.
        I have tested almost all Real Time Data available in Net… All are same scrapped Data with 2 or 3 sec delay….spent More Than 3 months for Searching Realtime data vendor for NSE Equity,,,

        Even Global Data Feeds Real Time data of NFO is somewhat delayed than our ZTrader Terminal.Currently I subscribed to NFO realtim data in Global Data Feeds…

        ESignal which is Leading Data Provider, provide realtime data for NSE Equity,but I have not tested it… They r not providing any Demo….Live Chat with their Representative ,told that NSE Realtime Data cost is $159 per Month Appx 10000 per month…Too Costly….

        My opinion is,
        Our Ztrader Terminal data is Sufficient or U Can Say more Reliable and Fast and Accurate than the Data Vendors Data….There So many Ways, U can fetch data from Terminal to Amibroker……

        Happy Trading

    • 1. Guess only GFDL and Neotrade offer data for amibroker in India, both of these don’t offer for NSE cash.
      2. No, there is nos subscription fees for real time feeds as you get this on your trading platform.
      3. Tradescript is good for beginners to intermediate coders, but as you advance you would probably have to migrate to other languages.
      4. If you want to run this on bigger scale, 8 cores, 8 gb ram, 1TB hard disk, and i7 processor.

      • intime says:

        thanks nitin for reply
        So in case I go for Ambibroker, whats best way to feed my ambibroker instance with
        i) historical (intradya) data
        ii) real time data

        I am sure many of zerodha clients would be using Ambibroker, how do they populate their DBs

  47. Taron says:

    Hi Nithin
    Iam new to Zerodha
    I ve have a suggestion
    when i open a/c with zerodha they told me that only listed stocks avail in Zerodha website got only margin other stock should take n cash postion after ward i checked zerodha website and saw listed stocks
    otherthan listed stock there are more stock which are fundamendally sound so can u add more stocks to get margin (intraday)on my investigation by comparing with other brokers stocks listed in zerodha (margin stocks) not much as compared to other brokers
    it will be greatfull to all Zerodha users to add more stocks to margin list

  48. Dark Trader says:

    Dear Nithin, is It possible to put orders from Ami manually, through PiBridge to Pi

  49. Taron says:

    Hi nithin u miss my prev comment

    Hi Nithin
    Iam new to Zerodha
    I ve have a suggestion
    when i open a/c with zerodha they told me that only listed stocks avail in Zerodha website got only margin other stock should take n cash postion after ward i checked zerodha website and saw listed stocks
    otherthan listed stock there are more stock which are fundamendally sound so can u add more stocks to get margin (intraday)on my investigation by comparing with other brokers stocks listed in zerodha (margin stocks) not much as compared to other brokers
    it will be greatfull to all Zerodha users to add more stocks to margin list

  50. Billa says:

    Hi CHOKS,

    I cant find C:\Tickdata as mentioned in excel. It will be in Amibroker folder or NEST folder ? I am using Zerodha Trader (3.11.2), so can I also use that excel for realtime feed ?

    Thanks CHOKS…

    • Billa says:

      CHOKS, please tell where can I find Dllreg file, I searched but in vain…

      I followed all other steps and configured, excel refreshes everysecond but LTP or Volume is not showing any values in excel,may be because of C:/Tickdata and Dllreg file I guess…

      Suggest how to proceed..Thank you…

      • CHOKS says:

        Hi Billa,
        Sorry for the delayed Post….
        just Re download the Zip file from the link…
        Follow the steps provided in notes
        Before Open the excel file close Nest Trader and Amibroker if it is running
        While Opening the Excel File, if u Got security warning that macro is blocked
        Just select options and select enable this content
        then proceed as per notes..
        I programmed all steps except 2 or 3 steps in Excel
        I hope it’ll work fine
        U no need to create database in amibroker….

        • dp0012 says:

          Hi CHOKS,
          When i click on setup i received access denied error. Pls advice what would be the issue. I am login as administrator also pls advice what is the default directory is excel look for? Any change in windows 64bit ? Thanks again for your help.

          • CHOKS says:

            Hi Dp
            Hav U Enabled macros?
            Post the exact Error?
            Let me check

            • Billa says:

              Hi Choks,

              I think its “Run time Error 70” Permission Denied(Visual basic error). Bcos I am also getting same…

              • CHOKS says:

                Hi Billa,
                I think, some of my macros’s uses FileCopy command…May be that giving the Error..
                What OS u r using and architecture ?and MS Office ?
                I modified some of the filecopy Command ..
                just download the file again….and follow the steps..
                If u still got error..Just post the screen Shot…

  51. Ramesh Gangappa says:

    Hi Nithin,

    Does Pi Bridge support Modify or Cancel function ?
    Also is there any way to get the status of the placed order ?

    Thanks
    Ramesh G

  52. Fadil says:

    Hi Nithin
    I have a Suggestion plse consider

    we can modify Bracket order price only through Nest terminal it is difficult to Zerodha client who were outside after placing Bracket order can u plse opt other alternative ways to modify Bracket order
    throgh Mobile app , (so it is easy to acess any where) and zerodha customer care (right now when any one call u customer care to modify BO they told they have no option to modify)
    plse consider both option it will be helpfull to all zerodha customers…

  53. sh says:

    Hi Nitin,

    When will be the updated version of Pi bridge be released. Its very difficult to use it without popup alert. Please update it and release the new version as soon as possible.

    • We will have a new patch for Pi and bridge. But the popup alert bit is still not live I guess.

    • CHOKS says:

      Hi Sh,
      where U want pop alert?
      in Amibroker? or in Pi?
      If Amibroker, it can be easily implemented through AFL……
      U can also Hav Audio alert through AFL…….it’ll Alert U even if u are in another room provided that u turned on Ur Comp Speaker….

      • Fadil says:

        HI chock
        waiting for ur tradescript update

      • sh says:

        Hi Choks,
        Is it possible to get the traded price and quantity from Pi and display it in amibroker chart? Thanks

        • CHOKS says:

          Hi Sh,
          At Present, Pi Bridge doesn’t support that feature.
          Present version supports only placing order
          As mentioned by nithin,,future version ‘ll include that so that U can modify or cancel or even U Can do trailing stoploss…
          If u want the last buyprice and current P/L in ami Chart .. U can Do it with AFL…
          U can Create a box which will show the details of trade which generated in amibroker

  54. sh says:

    Hi Choks
    I was asking for a popup alert in Pi when the alert is generated and an option to place order from the alert itself. Yeah i am managing with the amibroker alert for the timebeing. Thanks Choks

  55. HEMANTH says:

    any plans to release bridge to esignal 12 in future ??

  56. CHOKS says:

    Hi,
    Those who want to fetch data from Nest Trader to Amibroker, can download the file from the link below.
    It ‘s not the new thing, it’s already available in internet..under the name Josh utility …
    But I modified certain code for better performance and user interface…
    There are Two Method,s
    1. using excel VBA and Amibroker Com Object…
    2.Using Amibroker Dll Plugin and Excel as a DDE server..

    I uploaded the first method Only to Just get started with…
    First method uses little bit more resources than second one..
    Second Method is very straight forward & Use very little Resource and Faster than 1st method..
    (U’ll definitely like the second, one when u use)

    //—To Whom—–\\
    Those who New to Amibroker and Coding…
    and want to test their Buy/Sell Logic and coding…before subscribing to data from vendors…
    Who want to familiarize themselves with Amibroker Charting…
    And For Those Who not in position to Subscribe to Data….

    //——Features——\\
    I supports all exchanges..
    U only need to add symbol and select Exchange and select contract month(if Futures)..
    Symbol ‘ll be automatically add to Amibroker
    No Need to Manually Create any Database in Amibroker…
    The Amibroker symbol format is Equivalent to Nest Traders TradeSymbol..So U don’t need any symbol mapper or manually enter symbol name in the AFL …
    Supports Multiple strategy…..
    Data updates instantaneously…
    For NSE stocks , Quote’s ‘ll be fetched only from 09:15:00 till 15:30:00..
    For MCX , Quote’s ‘ll be fetched only from 10:00:00 till 23:55:00..
    U’ll not find any irrelevant quotes in the Database
    Starting and closing of the Amibroker from the Excel itself…
    Databases’ll be Automatically Backup-ed with Date & time…When U close Excel file..
    Data Speed More or Less matches with RT data provided by most of the vendors…
    and many more

    //——Limitations——\\
    It don’t have back fill…means if ur Net disconnected for 30Min.. there’ll be no Quote for that 30 Min…
    or if U just sit for Trading at 1100Am… U’ll get quotes only from 1100am..Better sit 10min before Market starts…
    (this is the Main Difference between this and the commercial RT Data…For NSE EQ, U Can fill that 30 Min with Google API)
    It’s not substitute for RT data provided by commercial vendors…
    (Of course, if U r satisfied with this U no need to Subscribe for RT Data)

    //—Tested in—\\
    Windows 7
    MS office 2007
    32Bit OS
    Nest Trader 3.11.2
    Amibroker 5.7.2

    //—-Final—–\\
    To fetch Data always do
    1. First open Nest Trader and log in and Let it fully load
    2.Second Open the Excel File (Amibroker ‘ll be Opened From Excel)
    If U opened Excel 1st and then Nest Trader..the RTD Function’ll not work

    //—-Link—\\
    https://drive.google.com/uc?export=download&id=0B-AWKNHhYByLdDdKeHFJYmJTU1E

    • Alex says:

      Dear Choks,
      Would like to have the 2nd method in my coffers. Can u post the link plz for dll based feed.

      Thx

      • CHOKS says:

        Hi Alex,
        U can Download the 2nd method from..
        https://drive.google.com/uc?export=download&id=0B-AWKNHhYByLd3k5ZVl3eDhVX3c
        Try both method..Post Ur Feedback..

        • rahul says:

          i got an error while setup excel file (data to ami)

          • CHOKS says:

            Hi Rahul,
            Ignore the Error …
            Ensure AmiBroker&NestTrade is not Running
            Now Goto Folder options in controlPanel..
            From the View Tab…Select Show Hidden Files & folder..Press Apply & OK…
            Goto C:\Users\Public\Documents\ or Documents Folder..
            There’ll be Folder Named TickData..
            Inside that Folder..A File Named..DllReg.cmd..
            Just select the File..Right click..Runs As Administrator..
            It’ll Unregsiter & Register Nest Dll Files..Press ok Button..
            Finished
            /////
            To Get data…
            First Start nesttrader..Login and Wait for it to fully Loaded..
            Then open the ShortCut RTDataDDE from desktop..
            It’ll open the excel file..
            Add all Required…Symbols(Not Trade Symbol),select Excahnge, select Contract month…
            Ex
            SILVERM – MCX -FEB
            ICICIBANK – NSE – BLANK
            ACC-NFO-FEB
            It’ll show price in LTP Column..
            Now press the Open Ami Button..It’ll open Amibroker…
            Then Press Add symbols to Amibroker button..
            Now All Symbols’ll be added to amibroker..U can Check it Amibroker..
            As soon as the market opens..ie 091500 for NSE & 100000 for MCX..
            It’ll start feed Data…
            U can check the Quotes from Quote Editior in Amibroker…

        • fadil says:

          Hi CHOCKS
          iam still waiting for ur tradescript update (PI tradescript) ……..

  57. sohil says:

    Can you share the link for Neotrade Analytics pricing for zerodha clients. Unable to find on their website

  58. vivek says:

    hi choks,
    am able to get data from nest trader to ami using both the methods u discussed above(1. using excel VBA and Amibroker Com Object…
    2.Using Amibroker Dll Plugin and Excel as a DDE server..). been doing so since a long time and have also solved the backfill issue(coded a macro to get data from data table of nest once every 20 days for all scrips in fno,cds segment. hence am having backfill for the last 4-5 months).

    my question is: since pi and nest cant be kept running simultaneously(when i login to pi, am logged out of nest automatically), how to feed ami

    • CHOKS says:

      Hi Vivek,
      Log in both Nest Trader & pi at a time not permitted…
      Current Version of Pi doesn’t support RTD…
      So We have to Wait till the Final Release of Pi…
      Could U pl post Vba to extract Data Table from Nest…
      Let Me Try it…

  59. vivek says:

    hi choks,
    by macro, i did not mean an excel vba macro….
    was referring to the macro software to simulate keyboard and mouse(there are many available online). so it can simulate any manual action in an automated fashion. that way i just have to click one button and leave the pc on for 3-4 hours- i kno thats a lot of time, but its only once in 20 days.( better to use esignal which can give 5-6 years of back data without any hassles- perhaps better than gdfl or neotrade)

    pi should start capturing all data for several years. it could offer more than 50k candles for a premium charge- dont kno,maybe, that would amount to competing with data vendors?

  60. vivek says:

    @zerodha,
    if its non compliant to allow feeding ami from nest, why is it made possible by those who own nest , in the first place. the exchange could ask omnesys/reuters to stop it. right?

    • Vivek, what is used to feed data from NEST to Ami is not what omnesys/reuters has built. It is a hack that some guys have built on their own, and hence omnesys/reuters don’t come into picture.

  61. vivek says:

    @zerodha
    tried downloading the pi bridge today. only the patch seems to be available, not the bridge itself. after opening the pibridgeinstaller.zip, there was only one file in it:
    pibridge_critical_patch_03022015.exe
    where can i get the bridge from?

  62. Prabakar says:

    Hi Nitin, Choks,

    I am new to PI and Pi Bridge.

    When using pi bridge, got error Access to the path “G:\Zerodha\Pi\userSettings.xml” is denied.
    Pi Bridge icon at the bottom showing Red.
    opening the pibridgeinstaller.zip, there was only one file in it:
    pibridge_critical_patch_03022015.exe is there any file i am missing to download.

  63. VNS Kodukula says:

    Hi Nithin !

    Am a new client of Zerodha. Please clarify my doubt.

    With the Expert Advisor, the trades takes place automatically as MT4 OR I have to wait for popup signal before sitting the system all the time ?

    And also please provide the link which shows the HOW TO SETUP AND USE AUTO TRADING with PI.

    Thank you and Awaiting your reply soon.

    -Sai

  64. Siva_Sri says:

    I follow all the instructions. but, still pi bridge is not working . I sent 2 or 3 mails . no reply

  65. ARVIND SINGH says:

    Hello Nithin

    I am not satisfied Fibonacci retracement tools . Please improved Fibonacci retracement tools for Pi. i am confused this tools. view attachment and improved… thanks

  66. fadil says:

    Hi CHOCKS
    No reply afterwards still waiting for ur update……it very helpfull to all zerodha users
    who has lack of knowledge in code writing

  67. Rajesh says:

    Hi Nithin,

    I just installed PI in my office laptop.
    I am not able to login, possible because my laptop is behind an office firewall.
    Any work around for running PI under office firewalls.

    ERROR:: Unable to login, please restart to continue

    I am getting above error after answering security questions.

    Thanks,
    Rajesh

  68. Rajesh says:

    Nithin,

    Is there any access to Web based trading of PI beta version.

    Rajesh

  69. D.Omprakash says:

    D.Omprakash

    Hi Nitin i need the coding strategy for the below one and please tell me where i have insert this coding in pi software. The strategy is need alerts in pi whenever eod charts daily charts crosses 30 day ema with adx symbol crossing 20 and above for all stocks

  70. biju says:

    hi nithin,
    i have a doubt,what do you meant by active trader,if those who have more than 10000 in their account,do you think they are active traders?

  71. biju says:

    actually am a novice in trading ,so i cant invest huge amount for trading,and lack of time for trading is a problem for me,so backtesting and automated trading trading is possible ,it will help us

  72. Divyesh says:

    Dear Nithin/CHOKS,
    may i request for any sample AFL which is ready for trade via Pi Bridge. trader should have to change his strategy portion. so the people like me who don’t know language, can easily convert his study and can do trade via Pi Bridge…..!
    or plz create any video on that and publish so it can be easy….!

  73. shankar says:

    my expectation is fully automated and to try any strategies let everything remain same just select demo/live button as in best trading terminal think or swim. in options part bring all the features of think or swim.

  74. shankar says:

    forgot to mention that apart from so many private softwares for full automation, master trust also provide fully automated trading from amibroker to their terminal MT3..also data comes from their terminal. monthly charge 900rs.. then why not Zerodha !

  75. Ramesh Gangappa says:

    Having issue with placing order with PI bridge. Following order is sent from AFL thru PI bridge.
    Issues are
    1) Trigger Price has additional digits 1660.09997558594 in “Generated Alerts” window.
    2) The product, Order Type & Trigger Price is NOT updating in Order Window.

    Order Triggered as follow
    plus.PlaceOrder(“NFO”,”LUPIN15FEBFUT”,”LUPIN”, “try1”,2, 1,1, 0, 1660.10 , “SL-M”, “MIS”, “RC0232”, “Day”);

    Thanks
    Ramesh G

  76. currencyandnifty says:

    Choks,

    Can you code an Amibroker AFL,on any EMA-SMA crossover strategy on NIFTY15FEBFTR,with Pi bridge plug in and voice alert with AFL, as a reference forever, pls for the sake of all

  77. MotaSheth says:

    Hi Nithin,

    My Client ID is DR1595

    I have the following up and running :
    1. AmiBroker
    2. Live NSE Data Feed
    3 .AFL for my strategy, capable of firing orders.
    4. Pi
    5. Ami-PI Bridge (getting activated tomorrow morning)

    My Question:
    What additions I need to do to enable the same AFL for sending/firing orders to Live Market using Pi?

    Thanks

  78. RAO says:

    RESPECTED SIR

    IN THE CHART I HAVE NOT FIND BACK TEST OPTION AND MY STRATEGY OPTIONS
    I HAVE ATTACHED SCREEN SHOT

    THANKING YOU SIR

    K.NARASIMHA RAO

    CLIENT CODE :RN0796

  79. RAO says:

    IN THE PI CHART HOW TO CREATE BUY AND SELL SIGNALS SIR, IN ALERTS BACK TEST THEY SHOW FAIL TO LOAD CHART , HOW TO GET BUY AND SELL SIGNALS

  80. vivek says:

    when i try to download the pi bridge from q.zerodha.com, a “pibridgeinstaller.zip” file is what i get. but there is only one file inside it: pibridge_critical_patch_04022015
    what should i do?(the bridge was activated on 3 feb)

  81. RAJESH J says:

    Hallo Nithin Can We Use Any other Data Feeds With Amibroker For PI Bridge or only Use GFDL For Amibroker Data Feed ?

  82. maheshwar says:

    Hi Nithin,

    any update on MT4 bridge, when are you planning to release it ?

  83. RAO says:

    SIR
    I REQUEST FOR PI BRIDGE IT IS PENDING ,AFTER ENABLED ,I HAVE TO INSTALL AMIBROKER SOFTWARE OR JUST PI BRIDGE DOWN LOAD ,

    • Rao, Pi bridge is for people who use AFL (amibroker formula language). So unless you know how to code strategies using AFL, Pi bridge would not be of any use to you. Yes, you will need to have Amibroker, Have data feeds to Amibroker, and have knowledge to code using AFL.

  84. MotaSheth says:

    Ami-PI Bridge is still not activated, please help

  85. PEDDI RAVINDAR says:

    Nitin sir,

    User ID : DR2267

    I Installed Pibridge and Amibroker but no access to use Pi bridge.Please do give me the access.

  86. MotaSheth says:

    i am being able to generate the orders in amibroker, the orderlog & orders.txt is getting generated but the orders are not going in PI ? what can be the issue ?

  87. sh says:

    Hi
    When will the next version of Pi bridge be released ? Any tentative date ?
    Thanks

  88. alok says:

    Hello,

    i wish to automate a investing (very low frequency) strategy on Amibroker using Pi bridge. Can you suggest some professional outfit or can some super user (like chocks) here can provide me his services on a professional basis to get this going.
    Tks.
    Alok Jain

  89. raj says:

    pi bridge showing red plz help me

  90. raj says:

    pi bridge done but get error 31 on alf

  91. M ANANTHA RAMAN says:

    Nitin,

    I was under the impression that with PI bridge we will get the tick by tick data from Pi. But after reading some comments it seems that you need a separate data source for Amibroker. We dont understand then what is the use of the Bridge? Sorry some of us does not have this much knowledge. Can i get the tick by tick data from Nest? I saw some post regarding NEST2AMI.

    • CHOKS says:

      Hi Anantha Raman,

      Pi bridge is just a link between Amibroker and Pi terminal.It enables the Amibroker (Charting Software) to communicate to Pi terminal.Pi bridge’s sole purpose is to fire orders to pi terminal from amibroker whenever u get a signal in amibroker.If Pi bridge is not there, then whenever u get signal in amibroker,u have to switch to Pi terminal and manually enter the order details and place the order which is time consuming.But with Pi bridge,U have ur order details prefilled and just u need to confirm the order.To use amibroker, U need to subscribe data from any authorized data vendors.Pi is Trading terminal just for Trading (With Advanced Features), It’ll not provide U data for amibroker.Amibroker can be feed with data by many ways, and Nest2Ami is one of them..

    • Anantha, We are not allowed to give you data on anything outside the trading platform as per exchange rules. The NEST2AMI utility is something built by people, and we have no control on it. The use of bridge is only if you are someone who is coding strategies using AFL on amibroker. If you don’t, then Bridge may not be of any use for you.

  92. anand says:

    I requested for pi bridge ambibroker for trial today.
    its been activated.
    the download link for this was done.
    but on installation error is appearing.
    pls find attachment of screen shot.
    pls guide me as there is only 7 days of trial.
    my id DA0172.

  93. anand says:

    the download zip file doesnt have pibridgeinstaller.exe.
    it only have patch file.
    as per your instruction we have to install it. but that file is missing.

  94. kirrick says:

    During non market hours does PI Bridge work ( For testing purpose). Its not turning Green when I fire the code from Amibroker.

    I am using the following code:

    brd=Null;
    if(IsNull(brd))
    {
    brd = CreateStaticObject(“pibridge.Bridge”);
    }

    if(!brd.GetConnectionStatus()) brd.Reconnect();

    brd.PlaceOrder(“NFO”, “NIFTY15MARFUT”, “NIFTY”,”STRATEGY-S”, 1, 1, 1, 8395.25, 0, “LIMIT”, “NRML”, “RB0799″,”DAY”);
    brd.PlaceOrder(“NFO”, “NIFTY15MARFUT”, “NIFTY”,”STRATEGY-B”, 2, 1, 1, 8412.50, 0, “LIMIT”, “NRML”, “RB0799″,”DAY”);

    • Use this:

      SECTION_BEGIN(“PiBridge”);
      RequestTimedRefresh(15, False);
      brd=Null;
      if(IsNull(brd))
      {
      brd = CreateStaticObject(“pibridge.Bridge”);
      }

      if(!brd.GetConnectionStatus()) brd.Reconnect();

      brd.PlaceOrder(“NFO”, “NIFTY15FEBFUT”, “NIFTY”,”STRATEGY-B”, 2, 1, 1, 8412.50, 0, “L”, “NRML”, “RB0799″,”DAY”);

      brd.PlaceOrder(“NFO”, “NIFTY15FEBFUT”, “NIFTY”,”STRATEGY-S”, 2, 1, 1, 8395.25, 0, “L”, “NRML”, “RB0799″,”DAY”);

      _SECTION_END();

  95. Rahil says:

    Hi nithin
    Awaiting for ur PI final release in order to fire BO
    I think its too late….
    how long should i wait for final release will it it release in this year or not?

  96. kirrick says:

    I was trying to use “MIS” and “MKT” option. Eventhough MKT shows up in the Generated alert window when you click on Buy or Sell button, the window that pops up is still prepopulated with default values liek NRML and Limit. Then need to manually change the values.

    • Having this checked.

      • Kirrick says:

        Hi Nitin, Any update on this. Actually i was testing my algo today and its painful to keep changing the values and click on submit as one short lot of orders get into the system. Without Bracket Order and this feature not working, for active day traders this is nightmare.

        Also just one more observation : Today morning when I was firing lot of orders that were in Q (generated alerts) some of the orders took time to execute and they were still in the order window. Please note that they were all market orders and orders after these were executed. Observed this earlier also. Later slowly all the orders got executed.

        • CHOKS says:

          Hi Kirrick,
          As a Temporary solution, the following may work..
          In Pi User Settings under order Window Tab, Choose your desired Order Type and Product Type.Regardless of what product type and Order type u entered in Pi bridge code..
          Your Order window reflect the Order and Product Type from User Settings…
          In Short…Just select Prod Type as MIS and Order Type as MKT in user settings in Pi…Ur problem solved.

          • Thanks Choks, @Kirrick, this should help you for now. Will have this checked out about orders firing being slow from generated alerts window.

            • Kirrick says:

              Hi Nitin,

              Any update on the order execution delay issue. Even today I faced this problem and this is turning out to be a big issue for my style of trading as this will create lot of slippages for me. I am attaching the screenshot also.

              • Kirrick says:

                I guess I found out the cause of this delay.(Just a guess after seeing this behavior again). This should be something to do with voice alert. Please check with your dev team whether next order gets fired after previous order voice alert is finished?

                • Kirrick, if there are multiple orders, they are all fired instantly. The voice alert might take a little long to read the orders out. But if you check the time on your orderbook, it will be fired as soon as you click in the alert box. Also there is an option to delete alerts in the generated alerts box.

                  • Kirrick says:

                    Nitin, All the orders were Market orders they should not be sitting in the pending order window (Top part of the window) with status Open. I have seen this with ZT also sometimes after the server migration.

                    • For how long does it sit as open?

                    • Kirrick says:

                      It depends. When i fired only 2 orders the second order executed soon after voice msg got completed. For the screenshot which I have attached as many orders were in q, it took some time, maybe around 1 min. You can reproduce this by firing 10 to 20 orders one after the other quickly during early morning session.

          • Kirrick says:

            Thanks Choks. I tried this now (non market hours) and looks like its partially solved. Product is correctly reflecting the settings i.e “MIS”, but the Order Type is still “Limit” eventhough in the settings its been set as “Market”. Need to check this during market hours.

            • CHOKS says:

              Hi Kirrick,
              If U still got Limit in Order dialog..Then U may try this..
              since U want to Place order only in Market…
              Then add/Subtract Price Slip of 0.5% of C to Ur Buy/Short Price…
              i.e BuyPrice = Lastvalue(valuewhen(Buy,C) + (C*0.005),1);
              ShortPrice = Lastvalue(valuewhen(Short,C) – (C*0.005),1);
              Thereby U R placing a Buy Limit Order with price Higher than 0.5% of Mkt/Ltp price and Sell Limit Order with price lesser than 0.5% of Mkt/Ltp price..
              So Ur order gets executed with the available best Buy/Sell Price…
              Placing a Order with Higher/Lesser price than Mkt/Ltp dosen’t have any effect if ur intention is to place a Mkt order
              I Hope..this may temporarily solve Ur issue

              • Kirrick says:

                Choks, I am doing this already. But didn’t want to do this as wanted to be 100% sure of order execution as currently there is no way to know in Amibroker about the order status.

  97. kirrick says:

    Just testing my code again which places a single order in live market. Now its continuously placing order very one sec and still not stopped. Attaching screenshot

    • kirrick says:

      I closed PI and tried this again and its workign fine. I had opened PI and Ami and was not using it for almost couple of hours and later found this issue. After closing both of them and working on it again its fine now. Anyways this is an issue that need to be look into, the reason being is there is a strategy that generates buy/sell signal once in a day then this might be an issue for the trader.

      • Kirrick, you have to incorporate the change within your code on AFL to ensure that orders don’t keep firing. Check this: http://tradingqna.com/13310/afl-for-ema-crossover-firing-through-pi-bridge

        • kirrick says:

          I understand where you are coming from , but I didn’t do any changes to my code. It was working earlier and it was again working after i restarted PI & amibroker. So only inbetween ( as mentioned in the scenario above) it was not working.

          • Ramesh Gangappa says:

            Kirrick, you need to lock once the order is placed, otherwise it will trigger multiple times as it is enabled “Multi threading” and time intervals.

            • kirrick says:

              Thanks Ramesh . I didn’t get what exactly you mean by locking, is it something I need to do at the PI end or in AFL code.

              • Check Choks code here for EMA crossover: http://tradingqna.com/13310/afl-for-ema-crossover-firing-through-pi-bridge. You need to do this in AFL.

                • Ramesh Gangappa says:

                  you can refer the link as Nithin mentioned …
                  Add locking mechanism while placing the order

                  currTimestamp = LastValue( TimeNum() );
                  LastTimestamp = Nz( StaticVarGet(“LastBarTimestamp_”+Name()+”_” +GetChartID()) );
                  if ( currTimestamp != LastTimestamp )
                  {
                  StaticVarSet( “LastBarTimestamp_”+Name()+”_” +GetChartID(), currTimestamp );

                  BUY or SELL

                  }

                  • kirrick says:

                    I got it now what you are referring to as locking. I have a different logic in my trading system code to handle this. Actually I was just testing with a simple code as mentioned in my query above which I fired once ( by scanning once). It used to work always as this is the basic testing code which I use for testing the AMi -> PI connectivity. Only once it showed me the above behaviour ( firing order every one sec continuously ) as I had kept the session open for long time. After I restarted PI and Ami and tried this again there were no issues ( Didn’t do any change to my code). I thought this might be a bug ( in PI or Ami not sure) and that is the reason I bought it to notice of Zerodha. As this might be difficult to reproduce attached the screenshot also.

  98. Ramesh Gangappa says:

    Hi Kirrick,

    Amibroker is expected to refresh on following factors & execute AFL code. I’m not finding repeated order in PI until unless Amibroker fires ….
    1) Local database change
    2) Plugin-based realtime feed “Intraday refresh interval” )
    3) Dedicated RequestTimedRefresh() function
    4) Manually refresh
    5) Wakeup from Sleep mode if it is enabled

  99. biju says:

    sir,
    i requested for pi bridge yesterday.but still my status is activation pending

  100. biju says:

    my status now

  101. biju says:

    hi nithin,
    my trial datafeed ends on monday.my support ticket still open ,nobody from zerodha contact me,still my status is activation pending,my id is RB0730,please solve this problem

  102. Pramod says:

    Hi Nithin,

    Generated alerts in Pi application doesn’t match well with the the AFL buy signal. For the below buy singnal from AFL,

    brd.PlaceOrder (“NFO”, “NIFTY15MAYFUT”,”NIFTY”,”SNAME”, 1, 25, 0, 821000, 0, “L”, “NRML”, “RP0000″,”DAY”);

    I see quantity is getting changed to 625, limit price is taken as 821000 instead of 8210.00.
    Also there is no way to delete the alert from Pi Generated alerts window. This makes quite confusing to track the new alerts and difficult to get rid of the unwanted alerts. Is it possible to incorporate this feature?

    However, I really appreciate the Pi tool you developed and banking heavily on the improvements yet to come.

    Thanks,
    Pramod

    • Pramod, copy pasting what choks mentioned:

      What he has done is Just He copy pasted the Code from the Blog.In the Example given in the blog “NIFTY14DECFUT” price is written as 780000 (Seventy eight thousand);
      So he also put lmt price as 821000 (To be 8210.00)
      Second, He wish to buy one lot of Nifty…So entered lot size in qty instead of No of lots he want to Buy…So 25 x 25 (nifty lot size) =625

  103. Pramod says:

    Hi Nithin,

    During launch of Pi, it doesn’t pass through the contracts download page and it hangs there forever. This is not the first time its happening, it happens randomly. After few retries, relaunching the Pi seems to fix the issue. What might be the problem? is there any setting i need to do or is there is a option to turn off auto downloading contracts?

    Thanks,
    Pramod

  104. Kirrick says:

    Nitin, URGENT ISSUE FOR ME .PI bridge connectivity is not working. Its the same setup i used yesterday. The Bridge Button is not turning Green.

  105. Kirrick says:

    Hi Nitin,

    I have been testing my strategy live using PI Bidge last couple of weeks. Some of the challenges summarized below:
    1. My strategy is live (entry) during first 40 mins. Actually its first 20 mins. During which lot of orders are fired one after the other sometimes around 20 within a minute time.
    2. When the order gets populated on the Generated alert window, I keep clicking buy or sell. One of the pain point is its takes some time for this order window to come up and by the time I come to the 20th order more than a minute would have lapsed.
    3. Due to this there are lot of slippages and tried to minimize this by cancelling the order confirm window and also voice msg. But still slippage is high for my kind of strategy.
    4. Following are some requests:
    Can the Buy/Sell window pop up faster.
    Is it possible to keep a check box next to Buy/Sell button on selecting that order gets fired immediately.
    Is there a possibility in future that PI supports direct order placement from Amibroker like a dealer terminal ( of-course after NCFM certification).

    These are really critical points for me or any traders whose frequency of trading is high.

    Regards,
    Harish

    • Without the confirm or voice message, I thought it would have been quite fast. But let me speak to the guys if we can make this any faster. Firing orders directly from that generated alerts window is a little bit of issue in terms of compliance. But anyways we are working on seeing how fast we can offer complete automation on Pi.

      • Kirrick says:

        Its takes some time for the Order window to show up after clicking.

        As I mentioned above, if you can provide a check box next to Buy/Sell button and on checking this if orders get fired without needing to open the Order window that would save lot of time.

        Good to know that Zerodha is working on fully automated solution. I have seen the demo of one of the product called Symphony presto and looks like there are not many decent competitors for them in India right now in the fully automated space , at-least at the retail end.

  106. biju says:

    NITHIN,
    i installed new patch,where to find pi bridge ,i check user settings
    now no orders firing from ami to pi

  107. Alb says:

    I’m getting this error msg when i log in pi trader after installing pi bridge and not able to login.

  108. biju says:

    why PI and NEST generates signals which is different as in amibroker…

    • CHOKS says:

      Hi Biju..

      1. The Price shown in During Amibroker Scan is the Close Price of the Signal bar..(Always)

      2. The Price shown in During Amibroker Back-test is may be any one of the Below
      It depends on what settings u have in Back tester Settings under Trades Tab OR
      U can control it in Formula level by Assigning BuyPrice / SellPrice / ShortPrice / CoverPrice

      Close Price of The Signal Bar or
      Open Price of The Signal Bar or
      High Price of The Signal Bar or
      Low Price of The Signal Bar or
      Avg Price of The Signal Bar or

      3. The Price U have in Nest/Pi is the Price at that time of Signal

      To understand More easily..
      Ur Database base interval is 1 min

      Below is the sample 1min Data from 10:00:00 am to 10:09:59 am

      Ticker,Date,Time,Open,High,Low,Close,Volume
      AXISBANK,11-03-2015,10:09:00,589.65,590.25,589.1,589.65,23916 //Highest of the 10 min Bar
      AXISBANK,11-03-2015,10:08:00,589.2,589.7,589.1,589.65,4643
      AXISBANK,11-03-2015,10:07:00,589.35,589.5,588.75,589.4,75740
      AXISBANK,11-03-2015,10:06:00,589.25,589.4,588.35,589.3,25061 //Lowest of the 10 min Bar
      AXISBANK,11-03-2015,10:05:00,589.35,589.95,588.95,589.25,12904
      AXISBANK,11-03-2015,10:04:00,588.6,589.45,588.6,589.35,10685
      AXISBANK,11-03-2015,10:03:00,589,589,588.5,588.85,5166
      AXISBANK,11-03-2015,10:02:00,589.2,589.3,588.45,589,7128
      AXISBANK,11-03-2015,10:01:00,589.5,589.6,588.9,589.2,8707
      AXISBANK,11-03-2015,10:00:00,589.5,589.6,589.4,589.5,4850

      U r testing Ur Strategy in 10 min Chart interval

      Suppose U get a Buy Signal at 10:03:59 am..

      Ur Buy Order ‘ll be fired to Nest/Pi with price at 10:03:59 am i.e. 588.85 (See Above Quote)
      So Ur Nest/Pi price ‘ll be 588.85..

      Buy when U Scan …It ‘ll show only the Close price of the Signal Bar…in this case it is 10 min Bar..
      Its Opening Price is Open price at 10:00:00 am i.e. 589.5
      Its Closing Price is Close price at 10:09:59 am i.e. 589.65

      Ur Scan price will be 589.65

      Same way Ur backtest price also ..
      If Ur afl has Buyprice variable
      For example

      BuyPrice = valuewhen(Buy,C); then backtest price ‘ll be 589.65 (Close Price of 10Min Bar)
      or
      BuyPrice = valuewhen(Buy,O); then backtest price ‘ll be 589.5 (Open Price of 10Min Bar)
      or
      BuyPrice = valuewhen(Buy,H); then backtest price ‘ll be 590.25 (High Price of 10Min Bar)
      or
      BuyPrice = valuewhen(Buy,L); then backtest price ‘ll be 588.35 (Low Price of 10Min Bar)

      U can’t set the Price in Scan Bcoz it always show Close price of Signal Bar..
      But in Backtest..If U want the Same price as it is in Nest ..U have code it accordingly..
      Hope I explained it Clearly..

  109. sh says:

    Hi Nitin,
    When will the final version of Pi bridge be released ?

  110. Arun says:

    what is the status of the MT4 bridge ?????

  111. Kirrick says:

    After installing the latest version of PI , I am not able to install the PI Bridge. Getting error msg “This is not supported on your machine version” . I am using windows 8.1

  112. aniruddha2907 says:

    Dear Sir,

    We have an option of using PI-Bridge for Ninja Trader to, I wanted to ask can one use it with Free Ninja Trader account. With all the functionalities.

    Regards
    Aniruddha

    • Ninjatrader is not live yet, but yes you can use it with free ninja trader account similar to AMibroker.

      • aniruddha2907 says:

        Sir,
        How long should it take??
        There is no hurry, but need to plan a few things at my end.
        Thanks, and if NT bridge works with all NT features, it would be nothing short of a dream. Keep up the great work.

        Regards
        Aniruddha

  113. Varun Gupta says:

    Are you looking forward to integrate Pi Bridge with Python?

  114. Abhijit says:

    I have two queries:
    1. Is tradescript similar to javascript?
    2. Can I use Pi bridge with Ninjatrader?

  115. manju says:

    Is there a Amibroker – Pi/Nest Bridge for Discretionary Trading? Like fire Orders whenever you want to buy/sell.

  116. SANKAR PATNAIK BALIWADA says:

    Its not working completely waste PI Bridge integration is not working.

  117. aniruddha2907 says:

    Hi Nitin,

    NT& is quite advanced compared to Amibroker. It is free as well.
    My question is will we be able to use all the order types and management options available in NT& with PI?
    I think all the orders are on the NT7 software and are sent to brokers terminal as and when they are triggered(correct me if I am wrong here), so if this is the case we should be able to use the Bracket Order features, and several interesting features on NT7 with regards to order management without any hindrance from the regulators AKA SEBI, et all.
    Shall we be expecting all the these things fro the new Pi-NT7 bridge which your are going to provide?
    One last thing, much programming is required in case of Amibroker, hope no programming will be required for using existing features of NT& with Pi bridge with NT7?

    Plz guide at your convenience.

    Regards
    Aniruddha

  118. Raman says:

    Hi Nithin

    Can you give me a expected date when Zerodtha is going to provide MT4 support? I MT4 is most easier for a retail customer to trade. I am using Pi and seriously keep asking for MT4 is annoying. Since I join here I am listening that very soon we are coming with it, but the point is when? Atleast we should have some dates with us or a time frame, recently your support team told me that it will take more two months for this. Kindly increase your speed and help us to trade more.

    Thanks

  119. Azgar Ali says:

    sir, I am trading Pi Terminal, position convert is not shown my admin position.

    Please tell me solution.advance Thanks

    • hmm.. convert position is the button next to square off all. Are you using a smaller screen as the screen seems to have shrunk? Can you click on the minimize and maximize button once, right top of Pi screen.

  120. GP says:

    Hai Sir,
    I buy nifty 8600 APR CE 4 LOTS @70 (100*70), if on expiry nifty close around 8550 and 8600 CE @10 , if i am not sell these on expiry date. how much amount i got, is it 100*10 or zero.
    or If NIFTY expiry at 8600, if i am not sell, how much i got?

    • Gp, if on expiry Nifty closes at 8550, 8600 calls will have zero value. On expiry, 8600CE will have Rs 10 value only if Nifty closes at 8610. So if Nifty closes below 8600 on expiry, you get back Rs 0, you get back money only if Nifty closes above 8600. Check this module on options which is still in the works.

  121. Birju says:

    Hi,

    Can you please provide some sample AFL codes for Amibroker-Pi bridge integration? i.e. sample strategy and its semi-automated execution for Pi bridge.

    Thanks,
    Birju

  122. ravk says:

    1. Please enable pi bridge to place manual order from Amibroker chart.
    2. in pi chart,plz enable crosshair.without it, very difficult to see ohlc value along with volume n other indicators.
    3. in pi chart ,plz introduce option of color coded volume ( ie say green for rising n red for decreasing vol)

    Thanks

  123. ravk says:

    If i place a market order from any location off pi chart..will it be executed?

    • There are no market orders allowed when trading from the chart. If you are buying below the current price, a limit order is used, and if you are buying above the market price a stoploss limit order with trigger is used.

      • ravk says:

        Any problem..if provision of market order directly from charts enabled..it will greatly increase execution efficiency which is vital for intra-day scalpers. one click market buy/sell orders with pre-set (eg quantity) criterion from chart itself is desirable.

        • The idea of placing orders on the chart is to basically put points at which u want to buy/sell (lines are drawn wherever you place these orders). If you want one click orders, go to user settings and untick on order confirmation/transaction pwd. Now you can use the normal order window as one click buy/sell.

  124. Puneet says:

    Please introduce the ichimoku indicator in pi.
    Can i code my own custom indicator using trade script.
    Thanks

  125. Nachiket Joshi says:

    For me, AmiBroker is not getting connected to Pi. I tried various AFLs posted above by Choks and others. But, it couldn’t connect to Pi.
    Yesterday when I started the trial for the bridge, it was connected with the AFL I used for connecting and logged the trades to a file even though, I selected Live Semi-Auto Trading in user settings of Pi. Support was unable to resolve it. Can anyone clarify what’s going wrong?

    • Nachiket, will get someone to call you back on Monday.

    • CHOKS says:

      Hi Joshi,
      Follow the below Trouble Shooting steps…If U checked all the steps..then Pi Bridge will work Fine

      If Orders are not shown in Generated Alerts Window on Pi or Pi Bridge is not Working.
      Then….

      1.Ensure that Amibroker is installed in C:\Program Files\Amibroker Directory
      If U are Using 64bit os then Create a Empty Amiboker Folder in C:\Program Files\ and Amibroker may be installed in C:\Program Files (x86)\Amibroker
      2.Ensure Pi & Pi Bridge is installed and U are enabled for Pi Bridge
      3.Ensure pibridge.net.dll file is present in amibroker directory
      4.U must first start Pi and then Amibroker..If u opened amibroker first and secondly pi..then Just close and reopen Amibroker only
      5.In Pi–>> User Settings under PiBridge Tab Select – Live Semi Automatic
      6.Ensure in Ur AFL u have correctly mentioned Exchange,ClientId,TradeSymbol,Symbol,Qty,OrderType,ProductType,Validity
      7.Use the sample AFL to check the Function Again
      8.Fired Orders will be available in Generated Alerts Window on Pi

      Download the sample AFL from the link below
      It has both Sample Trading System and PiBridge
      U can use this AFL for Your own Trading System
      Instructions are given in the AFL itself
      U Can check the Pi Bridge Connectivity From Parameter Window

      https://drive.google.com/uc?export=download&id=0B-AWKNHhYByLZmVEVFNxRVBuNUU

      • Nachiket Joshi says:

        Hi Choks,

        I don’t know whether you’re from Zerodha or not, but either way, thanks for taking out time.

        1. I actually replaced all the paths in your AFL with this path “C:\Program Files (x86)\AmiBroker”.
        2. I installed Pi bridge after I was enabled and it showed the successful installation message like in the installation help file.
        3. pibridge.net.dll file is present in AmiBroker directory.
        4. I opened Pi first yesterday as well as today.
        5. “Live Semi Automatic” was selected after installing the bridge, before running AmiBroker for the first time after installation.
        6. Exchange,ClientId,TradeSymbol,Symbol,Qty,OrderType,ProductType,Validity have been correctly mentioned in the parameters of the AFL.
        8. Fired Orders from the bar replay function were shown in the order log file in the Pi folder yesterday even after selecting “Live Semi-Auto Trading”. They were not reflecting in that file today, neither in the generated alerts window.

        There seems to be some other issue. I’ll try with the sample AFL you’ve given again.

  126. puneet says:

    hi, i have installed the latest version of pi, but i still cant get the cross-hair on charts. without that its very difficult to browse through charts. m sure its a pretty basic tool . if i have missed it somehow kindly tell me how to enable it . thanx

  127. Siddharth says:

    Hello,
    Some questions:
    1. I want to buy manually, but place a trailing stop loss of 3% on a daily basis based on previous day’s close, and should trigger a sell if the stop-loss is breached.
    Is that possible?
    The trailing stop loss should get adjusted everyday.
    2. Similarly, a trailing stop loss for shorts.
    3. Do I need to keep my machine and Pi running through the whole trading session, for this, or would the alerts and scripts be saved on your servers?

    • We have trailing SL orders, check this link. We will have this on latest release of PI by tonight.
      The order is at the server end, so you don’t have to be logged into your system. That said, currently this order type is only for intraday trades. All bracket and trailing SL orders get squared off by 3.20pm everyday.

  128. chandru jagan says:

    hi nitin and choks
    i have installed latest version of pi and pi bridge but pi bridge tab s not appearing in user settings,but pibridge.dll is placed in amibroker folder , path to amibroker folder is program filesx86 so created a empty folder in programfiles no use
    used choks trail code and made it work in amibroker but connection s not present , help me subscribed pi bridge for amonth

  129. rr2629 says:

    Hello Nitin,

    First of all thanks for providing the ‘Pi’ platform , seems to have most of the features that are needed for a professional trader. Can we connect and place orders from Meta Trader 5 on android?

  130. Manoj says:

    Hello

    In the example you have shown an alert every 20 seconds. What is the minimum time-gap allowed for such high frequency alerts?

    I am asking because an ex-employee of NSE once told me that very short times between orders are alerted to NSE Surveillance as possible (illegal) auto-trading. He was part of the team which did this.

    So if Pi Bridge generates orders say every 5 seconds (for say 2-3 minutes) and I rapidly accept them as-is, will this be a problem? I am stretching the example a bit, but want to know if there are any such limits.

    • Manoj, you don’t have to worry about this. These are just alerts, when you place a buy/sell on this alert, the orders are sent through our execution management system. EMS takes care of all the exchange compliance issues.

  131. Syam Mohan says:

    Hello Nithin

    Is it possible to connect to PI software without the bridge through some custom code without using your PI Bridge (any exposed API for PI ) ?

    Best Regards
    Syam

    • Syam, the bridge is the only way to connect. The bridge soon will have options for you to fetch your order status/funds, positions, and more. The bridge will also soon have an option to connect to other programming languages like python and etc.

  132. Manoj says:

    Has the field for Quantity changed from net quantity to lotsize?

    brd.PlaceOrder (“NFO”, “NIFTY15JUNFUT”,”NIFTY”, “STRATEGY1”, 1, 100, 0, 8306.25, 0, “L”, “MIS”, “DM9999″,”DAY”); ==== gives and alert with quantity 2500

    In earlier version (and in the code in this article), it is quantity, not lots.

    Any such changes, must be communicated properly, else will create problems.

    • CHOKS says:

      Hi Manoj,
      In Pibridge Code,
      If Trading Equity, then the pInitialQty variable should be filled with number of Shares U want to Buy/Sell
      If Trading Futures,then u should enter number of lots to Buy/Sell(Not Lot Size).
      In your case, u have entered 100 lots of Nifty.So your total quantity in generated alerts is 100 x 25(Lot Size of Nifty) = 2500.
      PiBridge code is not Changed.

  133. kishan says:

    so can we place bracket orders with this plugin

  134. Harsh says:

    Hi this is really nice and new to India 🙂

    I was wondering if there is any API for python ?

  135. v.shakeela says:

    Dear Sir,
    I am having trading a/c with Zerodha (RS6209). I get free trial of Pibridge upto 10.7.2015. I download Pibridge from Qzerodha. But it was not installed. They require Amibroker path for install. I don’t have amibroker software. Please guide me how to install the pibridge?

  136. Manisha says:

    Hello,
    Zerodha Executives are very good, they co-operate but Auto trading through PI is not very easy until you know AFL programming yourself.

  137. vivek says:

    is there any amount deducted for the use of pi bridge as of today(11th july 2015). when will the trial period expire?

  138. manojsaini18381 says:

    Dear Sir,

    I am using tradescript now i want to amibroker codes fir trading, I want to know you will charge fee for this , if yes how much ,

    RM2227

  139. Shivam says:

    Sir,Can you suggest me some realtime time data feed provider except globaldatafeeds from where i can purchase history data also?

  140. Sudesh Rane says:

    Sir,
    In Pi we place bracket order on pressing shift+F1
    With help of pi bridge, is it possible to place similar order from amibroker chart?
    If I have opened a chart in amibroker then is it possible to open bracket order form to place bracket order for that particular stock?

  141. sarath says:

    sir,

    as a beginner is bit confusing please share a you tube video it will very helpfull

    • Sarath, to be able to use the bridge you need to have an understanding on using AFL’s/basic programming.

      • ANIKET says:

        we have expert advisor on PI software its also fire orders on our strategy, so why there is a need of amibroker ? what is the diff. bet amibroker and expert advisor on zerodha PI software ?
        please reply…..

        • Amibroker is a much more advanced analytical platform. So you can code complex strategies which can’t be on Pi EA

          • ANIKET says:

            sir, please suggest me, i am not a good programmer so amibroker is suitable for me or not ? if yes then how the programming strategies will done ? or suggest any other automatic or easy usable software for me to generate bye/sell signal with target……generally which is used in private consultancies….by using particular software they generates bye/sell signals and suggests us to bye/sell……
            please reply in detail….
            its very valuable for me…

            • Aniket, if you want to automate strategies you will need to know how to make those strategies into a code/know programmin, Amibroker, pi or any other platform. If someone is selling you a software that it automatically makes buy/sell and makes you money (a money making machine), hmmm.. i’d probably not buy that.

            • Udit Khatri says:

              Ankit kinldy spend some time in technical analysis of the Share Market than u will be able to get the idea of u r own strategy or can code it …..

  142. Udit Khatri says:

    getting This error in Pi bridge testing , can u help in that nitin or expalin the error..

    • CHOKS says:

      Hi Udit..
      That is a warning raised by AmiBroker whenever we Use CreateObject Function in our AFL…
      This is to alert the user that COM objects are not MultiThreading friendly..
      What does that mean is whenever u create a COM Object and Call a Function…Amibroker will stop the execution of AFL code at that line and wait for the COM Object Function to finish and then continue executing the AFL code..
      Suppose if your COM Object Function takes 1minute to Execute then till that 1minute your chart will hang and freeze..
      But in Case of PiBridge….Its functions are executed in Milliseconds..and are Called only at the Signal
      U Won’t find or Notice any lag when calling PiBridge Functions like “PlaceOrder”
      So No Need to bother about that Warning…
      Go Ahead..

  143. DK says:

    Is Pi bridge compatible with the trial version of Amibroker?

  144. Manoj says:

    Hi Nithin

    Is there a way we can integrate Pi with Metastock Pro Trading System.

    Appreciate your response.

    Regards
    Manoj

  145. sandeep says:

    its available for MT4?

  146. Alok says:

    When I am sending command – brd.PlaceOrder (“NFO”, “NIFTY15SEPFUT”,”NIFTY-I”,”Pibridge”, 1,1,0, 7700, 7788, “SL”, “MIS”, “DS2286″,”Day”);

    It is working… But when I try to replace the fixed price with a variable… then it gives error
    mprice=7700;
    mprice1=7788;
    brd.PlaceOrder (“NFO”, “NIFTY15SEPFUT”,”NIFTY-I”,”Pibridge”, 1,1,0, MPRICE, MPRICE1, “SL”, “MIS”, “DS2286″,”Day”);

    Error hresult=8000402

    Please guide..

    • algogeek says:

      as you are using PlaceOrder () you can input the price parameter as number, but you can not define as above as it gives error. In Amibroker AFL Parameters are case sensitive.

      • Alok says:

        So how do I send order in Pi if I want to send order value by variables… Will much appreciate your help

        • algogeek says:

          to send order value by variables use

          Price=NumToStr(L,8.3,True);
          brd.PlaceOrder(“NFO”,Symb,Symb1,”AMI”,1,1,0,Price,0,”MKT”,”NRML”,”DV0412″,”DAY”);
          in place of “L”
          put your parameterized value or the price which u want to place
          Price = NumToStr(“SL”…)
          where SL can depend on you AFL

  147. Arun Kumar says:

    Nitinji,

    Have you enabled data from Pi to Excel ?

    Thanks
    Arun

  148. Ramesh Gangappa says:

    Is there any way to check PlaceOrder execution status ?
    Finding difficulty when we execute PlaceOrder continuously even with the delay.
    Example
    ThreadSleep(25);
    plus.PlaceOrder(“NFO”,TSym,PSym, myid,1, Qty, 1, 0, 0, “MKT”, “MIS”, “RR3676”, “DAY”);
    ThreadSleep(25);
    plus.PlaceOrder(“NFO”,TSym,PSym, myid,2, Qty, 1, 0, mysl, “SL-M”, “MIS”, “RR3676”, “DAY”);
    ThreadSleep(25);

    Sometime it will work if we increase delay like 100ms …but not sure ….

    It will be good if it returns the status, so that we can send the another if status is completed.

    Thanks
    Ramesh G

  149. DD1448 says:

    Hi Nithin,

    I need all details to start AutoTrading with Pi. (Without AmiBroker)
    i.e
    1. Coding my strategy
    2. Backtesting it
    3. Going live with my strategy.

    Can you please share any link or document where everything related to Algo trading is discussed ?

    Thanks and Regards,
    Divyesh

  150. tanvir750 says:

    helli sir

    can i convert interday trading to delivery trading?

  151. sarath says:

    sir,

    what is the difference between trade script and afl

  152. vai143 says:

    Hi,

    Can someone please tell me how to place a SL-M buy and sell order in pi bridge.

    Amibroker conditions are:
    Buyvalidate = ExRem(Buyvalidate,Buy);
    Sellvalidate= ExRem(Sellvalidate,Sell);

  153. RA5836 says:

    Team,
    Can we or do we have a detailed presentation on Pi Bridge, if yes, please provide me the link also let me know how much it costs. Regards, Muthu.

  154. jerry_wipro says:

    Is there a pi-bridge API kind of thing (in C/C++ or Python etc). I would like to write my strategies in Python and fire orders thru pi-bridge. As there is already support for firing orders thru AFL, If you could make the interface API open that would be great.

  155. jerry_wipro says:

    Any chance that it can be made fully automatic?

  156. Ramesh Gangappa says:

    Algo strategy name is not reflected in PI “Order Book” like “Pending Orders” & “Completed Orders”, neither in the PIBRIDGE*.log file.
    It will be difficult to distinguish orders from different strategies, especially if more orders are punched.

    It will be great help if you can reflect Algo strategy name.

    • Venu Madhav says:

      On Pi, Go to Alerts –> Generated Alerts –> If your orders are traded, you’ll find them here with the strategy name. Here’s a screenshot:

      • Ramesh Gangappa says:

        Hi Venu,

        Generated Alerts is only for mock & semi automation. Im requesting for “Complete Auto” where Algo strategy name is not reflected in order book or log file.

  157. Ramesh Gangappa says:

    New PI bridge update
    Thanks to Nithin, I have been waiting for this PI bridge update since a long time now as it supports more functionalities.

    New functions apart from PlaceOrder are ModifyOrder, CancelOrder, GetNetPosition & many more using logging mechanism.

  158. Shailesh Thakur says:

    Nitin Sir, Where is MT4 Plugin.
    i m MT4 user i use only MT4 for my trades.
    MT4 is a world number 1 technical and auto trade software.
    Please Nitin sir do something for MT4 Bridge. MT4 is a very helpful for every trader.

  159. vivek says:

    so if i understand correctly,once the pi bridge plus is out, its possible to:

    1) bypass cumbersome protocols (as described here(http://tradingqna.com/173/which-software-based-trading-amibroker-spider-ninja-other) and here(http://tradingqna.com/980/trader-fully-automate-their-trades-algo-what-formalities-cost)….

    2) get data out of the pi universe into R, python, matlab, excel, any trading platform, just about anything….(provided one has the know how). And things need not be just semi automatic 😉

    it blows my mind to think about it. But to make things even better could you not do away with the 55 scrip limitation. make it unlimited, for a cost

    • Hey Vivek,

      yes with bridge plus, you will be able to pull all the order/funds/position details into any programming language of your choice. But note that we will not be able to give you live market data (exchange has issues as it is against their data vending business). We have partnered with exchange approved data vendors, Neotrade, who will give you market data on any programming language of your choice http://neotradeanalytics.com/

  160. Siddhant says:

    Hi Nitin,

    I have just become a client of Zerodha. I have a technical query.
    Can you let me know if Zerodha has the facility of a scanner, where I can ‘pick’ ready queries and fire the same of a set of stocks.
    Examples:
    1. I need to run a query (On NSE Cash & FnO) to fetch all stocks where a Bullish Engulfing candle is formed. This query can be run for any time frame (Intra-Day & EOD). The query should return a list of stocks where a Bullish Engulfing candle is formed. Moreover, this will not be a Buy or Sell query as we currently have it in the back testing feature.
    2. I need to run a query on 15 min charts. The query should scan the market (Entire market) and display results of the query. The query can be a combination; like, All stocks that have a volume of 10 Lakhs or more and have a price between 100 and 500. Again, this will not be a Buy or Sell query as we currently have it in the back testing feature.
    3. I need to run a query to fetch all stocks where a certain Indicator or Oscillator has cropped up. Lets say I need the query to fetch all stocks where the SMA 10 has crossed over SMA 20 AND has a volume of 10 Lakhs or more and a price between 100 and 500 AND at this moment is exhibiting a Doji. Again, this will not be a Buy or Sell query as we currently have it in the back testing feature.

    Once the scanner lists the stocks, if I click on Chart, the system should pop up the chart with the technicals in place. For example in ex 1 above; the chart should mark out those areas where there has been a Bullish Engulfing candle. Or like in ex 3 above; the chart should display the SMA’s and mark the Doji.

    I ask the above questions because its really cumbersome to select stocks, then put in Buy and Sell queries and then back test it or use it for intra-day selections.

    Does Amibroker or Ninja Trader offer these features.

    If this is not the correct email ID to ask this question, then please forward it to the correct department or still better please have the concerned person call me.

    Warm Regards,
    Siddhant

  161. Shubham Satpute says:

    I am a zerodha client and my question is, How do you get pi to automatically execute every alert generated without having to click on buy and sell for every order generated in Generated alerts window?

  162. Karan Kalra says:

    When will the ninjatrader bridge for pi be ready Nithin. I am sure many ppl have been waiting for it for quite long now.

  163. rockstar says:

    Hi, Nithin
    Pls let me know, if pi bridge is supported for MT4 Application. Will be glad to know the same. I can see Meta trader in the screenshot of this post and When I login to Q backoffice, Meta trader is not listed. C#, python is mentioned.

  164. Rajesh says:

    Hi sir, I m Rajesh, I’m having account with Zerodha, I ‘m getting Live Market Data from other source to feed Amibroker and do the trading, I heard that Zerodha itself giving Live data to feed Amibroker for a monthly subscription of Rs 500/- Is it correct. Can I view the live chart in Amibroker with Live data provided by the Pi-Bridge ?

  165. vijaykumar says:

    i want installation for amibroker with choks

  166. Kumar says:

    Is Pi bridge to Ninjatrader is launched yet? I have been waiting for this since quite a long time

  167. Arjun Singh says:

    Is there any pi bridge for metatrader 4 also? I want to create EA and technical indicators in MT4, but use pi for order execution.

  168. Partha says:

    Is it possible to place the bracket order from the Alert generated window or otherwise is there any option of modifying Shift+F3/F4 shortcut keys to any other key?

  169. gurpreet singh says:

    sir my ID is DG0092.My Pi bridge is not working . Request you to please provide help me with team viwer. My phone no is 9646041230

  170. BM Kumar says:

    Hello Sir ,

    I tried to download the AFL from the gitHUb as you mentioned the url in your article like this ” For all those looking to get started coding on AmiBroker, here is a link to download a database of over 5000 AFLs. Make sure to backtest before taking any strategy live ”

    But that link is not working. Can you please check and advice ?

    Thanks
    BM Kumar

  171. BM Kumar says:

    Hey …….Thank you. It works.

  172. ravi says:

    hi nitin i want ambibroker or any one wat can i do pls

  173. Srinivas says:

    Hi Nitin,
    It great that you have provided the bridge but it only logs the trades, is there any scope of automating them with amibroker based strategies in the near future , else are you a partner broker with symphony amifuse to automate my trades ?

    Thanks
    Srinivas

    • Venu says:

      SEBI has prohibited automation for retail clients. You’ll have to become an Authorized person and obtain a dealer terminal to automate trades.

      • Srinivas says:

        If SEBI has prohibited retail investors then how come composite edge , sharekhan and IIFL is permitting for auto trading for their clients using the symphony API ? It would to great if zerodha tie-up with symphony and help their customers for doing auto trading using the amibroker based AFL’s.

  174. MOMIN AHMAD says:

    Dear Sir
    Please activate PI BRIDGE, I subscribed yesterday but still Activation pending. My PI ID is DM3713.

    Thankyou

  175. MOMIN AHMAD says:

    Dear Sir
    How to apply PI Bridge formula into Amibroker. I have copy paste formula from PDF file but it is not saving in Amibroker AFL. Afl is mentioned below. Please correct this Afl.

    _SECTION_BEGIN(“PiBridge Test”);
    brd=Null;
    if(IsNull(brd))
    {
    brd = CreateStaticObject(“pibridge.Bridge”);
    }
    if(!brd.GetConnectionStatus()) brd.Reconnect();
    brd.PlaceOrder(“NFO”, “NIFTY15OCTFUT”, “NIFTY”,”STRATEGY-S”, 1,1, 1, 8700.25, 0, “L”, “NRML”, “RB0799″,”DAY”);
    brd.PauseCode(60); //Pause the code for 60 seconds
    _SECTION_END();
    ================================================================
    _SECTION_BEGIN(“test”);
    plus=Null;
    if(IsNull(plus))
    {
    plus = CreateStaticObject(“pibridge.Bridge”);
    }
    Trading_Symbol = ParamStr(“Symbol”, ” NIFTY15OCTFUT”);
    Quantity = Param(“Lots/Quantity”,1, 1, 10, 1 ,1);
    Strategy = ParamStr(“Strategy Name”, “Zerodha”);
    Button_Cover = ParamTrigger( “BUY”, “Click Here To Buy”);
    Button_Sell = ParamTrigger( “SELL”, “Click Here To Sell”);
    Start_Trading = ParamToggle(“Start Trading”, “No|Yes”,0);
    Trigger_Price = Param(“Trigger Price”,7900.00,0.00,10000.00,1.00);
    if(Start_Trading)
    {
    GfxSetBkColor(colorBlack);
    Pi Bridge Help Document
    GfxSetTextColor( colorWhite );
    GfxSelectFont(“Times New Roman”, 25, 900, True );
    GfxTextOut(“You Are Trading”, 200 , 20 );
    }
    if(Button_Cover==1 AND Start_Trading==1)
    {plus.PlaceOrder(“NFO”, Trading_Symbol, “NIFTY”,Strategy, 1, Quantity, Quantity, Trigger_Price, 0, “L”, “NRML”,
    “DN0005″,”DAY”);
    PopupWindow(“Time: ” + Now() + “\n\n\n\n Price: ” + Trigger_Price,”Turtle: Cover ” + Trading_Symbol, 7200,
    640*mtRandom(), 480*mtRandom());
    PlaySound(“C:\\Windows\\Media\\tada.wav”);}
    if(Button_Sell==1 AND Start_Trading==1)
    {plus.PlaceOrder(“NFO”, Trading_Symbol, “NIFTY”,Strategy, 2, Quantity, Quantity, Trigger_Price, 0, “L”, “NRML”,
    “DN0005″,”DAY”);
    PopupWindow(“Time: ” + Now() + “\n\n\n\n Price: ” + Trigger_Price,”Turtle: Sell ” + Trading_Symbol, 7200,
    640*mtRandom(), 480*mtRandom());
    PlaySound(“C:\\Windows\\Media\\tada.wav”);}
    _SECTION_END();

  176. Sandip Patel says:

    Sir,
    I was activte pi bridge trial 3 days back but still today it is not connected with amibroker and no technical person can guide in this issue ,they simply say that post your query to tradingqna.

    Please help

  177. Rk Venkatesan says:

    sir i need green colour as background in pi software its possible.

  178. Yogesh says:

    Dear Nitin & Team,

    Please guide/ provide sample documents in C# for placing orders from virtual system.

  179. Rk Venkatesan says:

    sir brent crude oil is available for trade in mcx

  180. Rk Venkatesan says:

    sir what is the maximum lot allowed per trade in crude oil mega and mini in mcx

  181. Rk Venkatesan says:

    sir any paid mobile alert service available

  182. PRITISH HALDER says:

    Sir,

    I am interested in technical analysis and opened account in ZERODHA. Till now I have been using METASTOCK.
    Is there any way by which I can incorporate an indicator formula written in METASTOCK in ZERODHA PI and keep it confidential.

  183. Giri says:

    Hi,
    I’m on a MacBook Pro and was wondering if you had Pi for MacBook.

    The installation instructions seem to suggest that it is only for Windows machines.

    Giri

  184. Vasanth says:

    Is it possible to constantly scan market/particular scripts/segments for price discrepancies using algorithm for the retail traders to find the arbitrage opportunity during market hours?? If so kindly suggest. Not asking for fully automated system.Have to get alerts about the arbitrage opportunity.

  185. Rk Venkatesan says:

    sir i need data table of january month for crude oil in nest trader.

  186. yogii says:

    Can anyone let me knw where I can get Ans.

    Well I had sent an email to Zerodha Support & EA Zerodha regarding mine Pi bridge & AFL query on Last Sun 12/06/2016, whatsoever till date ryt nw I had nt received any respond from them…

    So jst let me knw wht to do???

    on Which platform should I raise my Query…

  187. Rk Venkatesan says:

    hi i want to trade on ncdex

  188. reghulal kaitheri ramath says:

    hi..
    It would be great if you could provide datafeed….why should we go for a third party if you can provide datafeed…Please work on it

    thanx in advance

  189. Rk Venkatesan says:

    sir i has coverted my position to normal but i cant place my stoploss order to gtc order

  190. Rk Venkatesan says:

    sir ..what is the maximum qty allowed per trade in usd vs inr pair

  191. ritesh says:

    Can anyone please provide a sample afl for use with Pi bridge to scan multiple symbols or a watchlist in Amibroker. When i scan in automatic analysis Pi bridge generates signals but the symbol remains the same only the price of different stocks are updated in Pi. I tried using the following codes, which i read about but when inserted in afl, the afl stopped generating signals.

    Symbol = StrFormat(Name()+”-EQ”);//

    Qty = ceil(50000/lastvalue(c,1));
    Buyprice = Valuewhen(Buy,C);

    brd.PlaceOrder (“NSE”, Symbol ,”NIFTY”,”STRATEGYNAME”, 1,Qty,0, Lastvalue(Buyprice,1), 0, “L”, “NRML”,
    “DZ1105″,”DAY”);

    I am new to coding so anyone with the solution please help me out.

  192. Kislay Kumar says:

    Hi
    “pLimitPrice = 8500.05 (price in INR for NIFTY15SEPFUT)” .I could not understand this statement when in my afl buy and sell signal generated at market price than why i should give limit price to fire my order? pLimitPrice = 8500.05 (price in INR for NIFTY15SEPFUT). Plz rectify my confusion. I just want to connect pi with amibroker for trade where my afl itself genrating buy and sell signal with target on market price and dont want any limit order.

    • algogeek says:

      you can fire signal for market order, just modify the parameter “L” to “MKT” in brd.PlaceOrder() function
      Example:

      brd.PlaceOrder(“NFO”, “NIFTY16SEPFUT”, “NIFTY”,”STRATEGY-S”, 1,1, 1, 0, 0, “MKT”, “NRML”, “clientid”,”DAY”);

      you can initiate the above function at your buy and sell signals in your AFL.

      • Kislay Kumar says:

        i have supertrend afl and getting buy and sell signal in amibroker . I just need to generate in pi. Is there need of modification in afl of supertrend or just punch formula else in ami so that it generate signal in pi?

  193. chandu says:

    at a time can i access the multiple accounts to create multiple order using AmiBroker

  194. Nikhil Bansal says:

    Mr. Nitin,

    I am really disappointed the way your support teams are giving support to the customers.

    I have called multiple times at your support desk and people are just in a hurry to disconnect the call without providing any resolution.

    Can you please help me in getting the PI bridge connected to amibroker? your support team is not able to fix it.

  195. Rajesh says:

    When are we getting BO support in pi-bridge?

  196. Chandrasekar says:

    Can I use Meta Trader for Pridge Connect .
    for Automatic Orders from MT4 to Pi

  197. Pramod says:

    Hello,
    Can you please help me to understand if the PI bridge is connected to Ninja Trader and if we can fire orders using Ninja Trader 7 ?

    Thanks!

  198. Sadashiv sahastrabuddhe says:

    I want the trade script for following condition

    MA 3 >MA 5> EMA 9 LAST CANDLE OPEN & CLOSE ABOVE EMA 9 THEN BUY

    & REVERSE FOR SELL

  199. Harmeet Singh Sahani says:

    1. If there is any formation of reversal pattern forming in any stock. The system notified me
    Is this possible in PI???
    If yes plz mention details over here !!
    2.Is there any way to use PI in my android device ??

    You have a great managers i must say . Your manager is very much helpful to me.

    Thanks!!

  200. Hrishikesh Kakaodkar says:

    Hi,
    I have activated pi bridge last week. But it is still showing STATUS : ACTIVATION PENDING. and down it shows..

    “You have successfully bought Pi bridge, your account will be enabled by admin shortly. Fee of Rs.500 will be deducted form your trading account monthly after a free trial for 7 days. You can stop your subscription anytime by clicking on the cancel link below. Click here in case of any queries on using the Pi Bridge.”

    whats the issue???

  201. Hrishikesh Kakaodkar says:

    In pi i am not getting pi menu also

  202. Hrishikesh Kakaodkar says:

    sorry.. In pi i am not getting pi bridge menu in user setting also as shown above.

  203. Pramod says:

    hello Team,

    I have my own software, which I and developing for the the generating the buy sell alerts. Will I be able to pull the data from the PI. If so, can you please help me with the details about the languages supported with the version details, Details about available APIs to download the data and the fees for the data.

  204. Wasi says:

    Hi,

    is there any way to put target and stoploss at once without requiring additional margin?

  205. Ranjan says:

    Hi Nithin, will you please help me to know. willl I have to write it for all the scripts manually in amibrokers ? Or is there any static way to feed it and use it when ever i want. Because there are so many contracts available in the nfo section like June July and etc. your quick response will be awaited Thanks.

  206. Satyajit Chattopadhyay says:

    Hi Nitin
    please include the “Supertrend” indicator in “Zerodha pi”.

    Thanks in advance.
    With regards

    • Satyajit Chattopadhyay says:

      Dear Nitin
      Updated the “pi” by removing the old one and installing the new one. The “Supertrend indicator is available.

      Regarding drawing horizontal line in “pi” :
      How to delete one horizontal line out of many horizontal lines drawn in the chart. How to edit the y-axis value of the horizontal line ?

      Kindly help to find out the solution.

      With regards.

  207. star says:

    Select horizontal line and click on delete, or right click and select delete study option.
    To edit, again select horizontal line and right click or double click and select edit study.
    For more help on this you can write to [email protected].

  208. selladurai R says:

    Hi Zerodha…Please activate my Pi Amibroker Bridge..still status is pending..My client is ZT5514

  209. SMP says:

    can we fire Bracket order with pi bridge or it is only Normal, mis or cnc for Futures

  210. hari says:

    Hi Sir,

    the link given for 5000 AFL is not working. can you please correct the link and re post it?

    Thanks in advance.

    Regards
    Hari

  211. Tanmoy Basak says:

    Hi Nithin,

    Do you have any plan to integrate PI/PI Bridge with matastock?

  212. Mukeshkumar says:

    Is PI bridge is compatible to Spider Software IRIS plus? if not do you have plan to do so?

  213. Aravindh says:

    Hi Nitin,

    I am trying to execute the order place command(exactly mentioned in above blog) from ami broker,

    command:

    brd = CreateStaticObject( “pibridge.Bridge” );
    brd.PlaceOrder(“NFO”, “NIFTY15SEPFUT”, “NIFTY”,”STRATEGYNAME”, 1, 50, 50, 8500.05, 0, “L”, “NRML”,”ZT2886″,”DAY”);

    Getting following error :

    Error::Not a valid packet format request,please verify and try again!
    05/09/2017 23:46:14: Error in request packet start:
    STRATEGYNA_12_NIFTY_X7D5USM937
    nse_fo
    NIFTY15SEPFUT
    LongSide
    50
    50
    8500.05
    0
    NRML
    50
    L
    ZT2886
    DAY
    Error in request packet end

    It seems to be the above command no more valid, can you pls share the last function with all the signature to me.

    rEGARDS,
    aRAVINDH

    • algogeek says:

      There is not change in function or parameters formats, if you are trying same above line, check the contract symbol (it should be NIFTY17SEPFUT ) and the LTP price and try, you can check below given simple code for reference,
      _SECTION_BEGIN(“PiBridge Test”);
      brd=Null;
      if(IsNull(brd))
      {
      brd = CreateStaticObject(“pibridge.Bridge”);
      }
      if(!brd.GetConnectionStatus()) brd.Reconnect();
      brd.PlaceOrder(“NFO”, “NIFTY17SEPFUT”, “NIFTY”,”STRATEGY-S”, 1,1, 1, 9900, 0, “L”, “NRML”, “RA0000″,”DAY”);
      brd.PauseCode(60); //Pause the code for 60 seconds
      _SECTION_END();

  214. Amrut Sabade says:

    Hi Nitin,

    I am surprised that this tool is not available on mac yet. It would be very good if you can provide us ETA for availability of the tool on mac

    Thanks
    Amrut

  215. Vikram says:

    Does PI Bridge now support placing bracket orders through it? or is it still not supported?

    Share Khan API does provide the support for trade tiger.

  216. Krishna Pai says:

    i am interested in pi amibroker setup installation. I have read several times and also contacted customer care for the procedure to install. i have done everything as guided by customer care. it needs to be enabled by zeroda. AS directed i have installed latest version of Pi, then i installed 3.2 version Amibroker. next thing was to install pi-bridge which is not responding as the bridge is not enabled . kindly do that for me. you have so much in advance stage but for all these problems would have solved by taking things our personnel computer on remote access easily or at least chatting would have done the things faster. by email support ticket i don’t think my problem will be solved. This is just a feedback sir. kindly solve my problem ASAP

  217. Dj says:

    Hi Zeroadha,

    I am trying to setup bridge between Zerodha and Amibroker. I have installed it correctly. However, I do not see Pie bridge in User Settings.

  218. xavier says:

    can i do mock trading through pi bridge without live data feed in to amibroker.
    i understand that now to make full use of amibroker plus pi bridge , cost will be Rs500 to data feed plus Rs 500 to pi bridge.
    without data feed from a third party vendor i can save relevant costs

Post a comment