Here is a simple Button Style Trading Control’s in Amibroker (Extracted from Wisestocktrader : Credit goes to the creator ranjicgnr). The Creator had added button style manual trading control to place One-Click Trading from Amibroker Charts. He had desinged the framework for sending manual click button trading from Amibroker to NEST/NOW trading terminals using Nest Plus Plugin.(Requires Nest Plus Plugin Subscription from Omnesys).
[wp_ad_camp_5]
So looking at the charts and taking a manual decision and then using the trading terminals to place orders are cumbersome and involves lot of delay in the process. Manual button based trading solves the delay by trading from Amibroker Charts. The User Interface and the User Experience is cool. IF you are a amibroker user it is a must to try out. If you are very new to Automated trading then start with the tutorial Understanding Autotrading in NSE Future markets
Features
[su_panel background=”#ff8c0d”]You can predefine your quantity of Buy/Sell in the parametersYou Can Enter your Client ID in the Parameters
You can select the Buy/Sell Price from Ask price, Bid price or LTP.
Option for Enabling Actual Trading (If Disabled, No Signals will go to NOW/NEST, But chart will generate signals.) This can be used for testing.
Selecting the Buy/Sell as Intraday or Delivery.[/su_panel]
Requirements
For Buy/Sell Price selection, use Aux1 and Aux2 for importing the Ask Bid Prices.
Symbol in the Amibroker should be the same as present in the NEST/NOW.
Active Nest Plus API Subscription is required (Contact Nest Plus for Details)
Usage
Copy The Afl to Custom Afl folder of amibroker.
Drag and drop the afl to an intraday chart blank chart.
Enable Controls and Auto Trading Options.
Set Lot Qty and Purchase Type.
Type the Client ID.
Press Buy Or Sell when you decided.
(Decisions should be based on your trading strategy. This Afl will not generate any Buy/Sell Signals automatically)
[Suggest Features For Improvement]
[NEST, NOW, Amibroker are registered products of the Respective Companies]
The Following code is tested in Amibroker 5.8 and 5.9 version
https://gist.github.com/1f2f58bb8976a07ed1fc
This is the error message i am getting with amibroker 5.6 version any solution for this
Auto trade :
StaticVarSet(“LTQSave”, LTQLastTemp, 1);
StaticVarSet(“VolumeTemp”, VolumeLastTemp, 1);
StaticVarSet(“AskSave”, AskLastTemp, 1);
StaticVarSet(“BidSave”, BidLastTemp, 1
————————————-^
File: ‘Formulas\Drag-drop\Auto trade 3.afl’, Ln: 129, Col: 38
Error 16.
Too many arguments
Use ‘Edit Formula’ to correct error”
thanks sir
Some issue with Amibroker 5.6 version it seems but works from 5.8 onwards. most of the users using 5.6 facing it. let me explore.
Dear sir
I don’t know what to say, what your doing is splendid job for the traders like me, without anything in return.
Information is wealth, your just giving it like anything–pure selfless
Thanks a lot
showing error 16 sir, kindly check it, i am using 5.7 version
Tested in 5.8 and 5.9 and worked fine. May be the code uses some new functions which is not compatible with 5.6 and 5.7 will try to figure it out.
I am facing error too many arguments
StaticVarSet(“LTQSave”, LTQLastTemp, 1);
How to rectify it
Probably you are using Amibroker version less than 5.8. Currently the code is compatible with 5.8 and above. Kindly try upgrading your amibroker version and check it out.
i have copy your AFL & run in Amibroker 5.9. it shows Buy Sell button. but i want to know can we use it with any broker or particular broker required to use auto buy sell pls. suggest
1)You need a Nest/Now Trading Terminal most of the discount brokers these days provides you can also use yourbroker tool to find out which are the brokers providing
2)You need to have Nest API subscription (Rs250/- month) from Omnesys and a Nest Plus Trading Terminal download
3)Now you can place semiautomatic trading from Amibroker to Nest Trading Terminal.
screen shot for this afl if possible
FROM WHERE CAN I DOWNLOAD THIS AFL?
Click on RAW File at the bottom of the code and you can copy and paste in your notepad and save it in .afl format
and start using it.
dear sir,
how can i join your amibroker course ? kindly reply
regards
maninder singh
Try joining our workshop apart from that we are not offering one to one or online courses at this point of time http://www.marketcalls.in/workshop/amibroker-technical-analysis-workshop-bengaluru-feb-2015.html
How to use Bid & Ask price in Aux1 & Aux2? Can you please elaborate?
Hi!!
Can you please tell where can I subscribe for the Nest Plus Plugin for NOW? I have contacted Omnesys (which have been overtook by thomas reuters) and they have told me that the plus api is only available on nest trader terminal and can be bought only via broker. Please help me in this regards.
Thanks in advance!!
heads off Raj bhai….. good one
Sir,
I have following observations:-
a) Does this needs to be dragged & dropped on any Strategy AFL or Strategy needs to be typed into it?
b) When BUY/ SELL Button is punched, symbol error comes in NEST Trader, as symbols text in NEST Trader is different from those in AMIBROKER. Please advise its remedy?
c) Any change in codes required to make it to puch orders AUTOMATICALLY?
Thanks & Regards.
The first requirement is you need Nest API to be enabled. Check with your broker to do that. Then you have to drag and drop to your own startegy.
Thanks Raj Sir,
My query remain, half answered:
a) The NEST Api is activated by ZERODHA (my broker);
b) The AMIBROKER Symbol is NIFTY-I, but NEST Trader has NIFTY14JANFUT , so there is incompatibility in names. How to Address it, when orders goes in NEST Trader.?
c) Can it be made to punch orders automatically?
Please advise.
You have to program line no 26 according to your symbol to match NEST symbol
TempName = Name() + “-EQ”;
Thanks Sir.
Raj Sir,
Can u please advise on this KAKA’s AFL. (credit of these goes to KAKA ji);
Though, the NEST Plus API is activated. Somehow, I see that orders is not going into NEST Trader.
ClientID = ParamStr(“ClientId”,”ID”);
Symbol= ParamStr(“Symbol”,”NIFTY14JANFUT”);
Slp= Param(“Slippage%”, 0.05);
Bprice= NumToStr(Ref(H,-1)*(1+slp/100),8.3,True);
Sprice= NumToStr(Ref(L,-1)*(1-slp/100),8.3,True);
Quantity=Param(“Quantity”,1,1,100,1);
OE = ParamList(“Order Execution”,”Immediate,On Candle Completion”,1);
AT = ParamToggle(“AutoTrade”,”No,Yes”);
if(OE==”On Candle Completion”)
{
Buy=Ref(Buy,-1);
Short=Ref(Short,-1);
Sell=Ref(Sell,-1);
Cover=Ref(Cover,-1);
}
AplliedQuantity=IIf(LastValue(Buy) AND LastValue(Cover) OR LastValue(Short) AND LastValue(Sell),Quantity*2,Quantity);
RefNumber = Nz(StaticVarGet(“RefNumber”));
Checkdt=Nz(StaticVarGet(“lastdt”));
dt = LastValue( DateTime() );
Cond=LastValue(Buy) OR LastValue(Short) OR LastValue(Sell) OR LastValue(Cover);
if(AT)
{
plus = CreateStaticObject(“Nest.PlusApi”);
if(plus)
{
plus.SetObjectName(ClientID);
if(Cond AND Checkdt != dt )
{
if(LastValue(Buy) OR LastValue(Cover)){plus.PlaceOrder(“BUY”,RefNumber, “NFO”,Symbol,”DAY”,”LIMIT”,AplliedQuantity,BPrice, 0,1,”NRML”,ClientID);}
if(LastValue(Short) OR LastValue(Sell)){plus.PlaceOrder(“SELL”,RefNumber, “NFO”,Symbol,”DAY”,”LIMIT”,AplliedQuantity,SPrice, 0,1,”NRML”,ClientID);}
StaticVarSet(“RefNumber”,RefNumber+1);
StaticVarSet(“lastdt”,dt );
}
}
}
Try this:
Delete “, 1” and make sure to correct all below lines look like this:
Auto trade :
StaticVarSet(“LTQSave”, LTQLastTemp);
StaticVarSet(“VolumeTemp”, VolumeLastTemp);
StaticVarSet(“AskSave”, AskLastTemp);
StaticVarSet(“BidSave”, BidLastTemp);
I just you had worhshop on Amibroker. When can be next one and where ?
Thanking You
Vasant
We havent finalized yet. Planning to do after Sep 2015 either in Delhi or Hyderabad.
Does it also works for placing Cover Orders and Bracket Orders ?
When comes to Autotrading only Limit Order is supported for Retail Traders and MKT/LMT for Dealers. Cover Order and Bracker Order are just manual trading features.
Dear Sir,
& Also Mr Kiran,
Can you please amend it so that Orders are Pucnched Automatocally into NEST and SELL & COVER be also supported.
I could not place your suggestions for AUTO TRADE into it.
ClientID = ParamStr(“ClientId”,”ID”);
Symbol= ParamStr(“Symbol”,”NIFTY14JANFUT”);
Slp= Param(“Slippage%”, 0.05);
Bprice= NumToStr(Ref(H,-1)*(1+slp/100),8.3,True);
Sprice= NumToStr(Ref(L,-1)*(1-slp/100),8.3,True);
Quantity=Param(“Quantity”,1,1,100,1);
OE = ParamList(“Order Execution”,”Immediate,On Candle Completion”,1);
AT = ParamToggle(“AutoTrade”,”No,Yes”);
if(OE==”On Candle Completion”)
{
Buy=Ref(Buy,-1);
Short=Ref(Short,-1);
Sell=Ref(Sell,-1);
Cover=Ref(Cover,-1);
}
AplliedQuantity=IIf(LastValue(Buy) AND LastValue(Cover) OR LastValue(Short) AND LastValue(Sell),Quantity*2,Quantity);
RefNumber = Nz(StaticVarGet(“RefNumber”));
Checkdt=Nz(StaticVarGet(“lastdt”));
dt = LastValue( DateTime() );
Cond=LastValue(Buy) OR LastValue(Short) OR LastValue(Sell) OR LastValue(Cover);
if(AT)
{
plus = CreateStaticObject(“Nest.PlusApi”);
if(plus)
{
plus.SetObjectName(ClientID);
if(Cond AND Checkdt != dt )
{
if(LastValue(Buy) OR LastValue(Cover)){plus.PlaceOrder(“BUY”,RefNumber, “NFO”,Symbol,”DAY”,”LIMIT”,AplliedQuantity,BPrice, 0,1,”NRML”,ClientID);}
if(LastValue(Short) OR LastValue(Sell)){plus.PlaceOrder(“SELL”,RefNumber, “NFO”,Symbol,”DAY”,”LIMIT”,AplliedQuantity,SPrice, 0,1,”NRML”,ClientID);}
StaticVarSet(“RefNumber”,RefNumber+1);
StaticVarSet(“lastdt”,dt );
}
}
}
i wan to punch an automatic order when ever a signal come in my afl but at lower close value
..like i am trading banknifty option for strikeprice XXXXX @ Rs 55 . Signal come at Rs 55 but order should be placed for Rs 50 .
can it be done?
What afl code i need to put in my afl
I get error on the line : nestplus.SetObjectName(“MaualTradingInt”);
Error 19: COM method/function ‘SetObjectName’ call failed. COM Error: COM Error: HRResult = 80010105
Nest plus is initialized well. Seems some problem with the above method.
Please help what should be done to resolve.
Nest Shut down long back.