Dissecting the Nest Plus Auto Trading API

mastermind007

Well-Known Member
#41
Z algo trading is under development.
What is Z algo?

All of us here are still struggling at
A is Algo. B is for Bank ... and so on. AFAIK, trails end at L is for Loss.
 

augubhai

Well-Known Member
#46
Hi Yusi,

Interesting topic!! Thanks for sharing all the info.

And what's my angle? Need to automate some of my manual trades... well, atleast after I find the holy grail ;)

Been lazy about working on the automation stuff. Do not have a handle on COM/DLL, so it will be slow whenever I try to program...

Function name: OrderUpdate
Parameter (bstr_ExchSeg As String,
bstr_AccountId As String,
bstr_OrdDuration As String,
bstr_CustFirm As String,
bstr_Product As String,
bstr_OrdType As String,
bstr_TrdSymbol As String,
bstr_TransType As String,
lDisclosedQty As Integer,
dTriggerPrice As Double,
dAvgPrice As Double,
dPrice As Double,
bstr_NestOrdNum As String,
bstr_ExchOrdId As String,
bstr_ReqId As String,
lFilledShares As Integer,
lUnfilledSize As Integer,
bstr_Status As String,
bstr_OrdStatus As String,
bstr_NestUpdateTime As String,
bstr_ExchTime As String,
bstr_ExchOrdUpdateTime As String,
bstr_RejReason As String,
bstr_StrategyCode As String,
bstr_WarehouseLoc As String,
bstr_GuiOrdId As String,
bstr_GuiOrgOrdId As String,
bstr_PCode As String,
bstr_RejectionBy As String,
lQuanToFill As Integer)
 

yusi

Well-Known Member
#47
Hi Yusi,

Interesting topic!! Thanks for sharing all the info.

And what's my angle? Need to automate some of my manual trades... well, atleast after I find the holy grail ;)

Been lazy about working on the automation stuff. Do not have a handle on COM/DLL, so it will be slow whenever I try to program...

Function name: OrderUpdate
Parameter ( ... )
Augubhai,

That is a unusual selection of parameters in that the fields are named different than what NOW or Nest provide. And, in particular, I don't understand GuiOrdId / GuiOrgOrdId.

Since the auto-trading API does not have an interface for most of these parameters, you would have to extract these fields from the Order Book / Completed Orders / Trade Book windows. In an old utility (O2A, Odin to ASCII), I had done something similar, where it would write out selected fields from both these books, but barring a handful nobody was interested.

Trivia: Now has 69 columns in the Order Book, and 35 columns in the Trade Book. Nest has 81 and 44 column respectively, including the perplexing Giveup Indicator in the Trade Book.
 

augubhai

Well-Known Member
#48
Yusi,

At this point, I do not have much info to clarify your doubt...

OrderUpdate is a function signature that I received from a source. I am not even sure if the info given is right, but I am guessing that OrderUpdate is the call that we need to make to get all orders. (From where the call is to made, and with what params? ... I have no clue)

I was hoping that you would have seen some function with this name while dissecting the API.

As you can see, I have a busy diary on TJ. All the trading has taken up a lot of my time, but has got me nowhere. But be sure that once I find the method to get rich :), I will devote my time to automating it.

I am hoping that you would have completely dissected the API by then. :thumb:.... and also hoping that NEST/NOW would not have changed the API, by the time we dig it. It's so frustrating that NEST does not share the API right on their web page. Don't they want people to use their API? Have you asked them for the API docs?
 
#49
hi I have this code for auto trading
ClientID = ParamStr("ClientId","000000");
Symbol= ParamStr("Symbol","NIFTY13MAYFUT");
Price=NumToStr(C,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")
{

}

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,Pri ce,0 ,1,"NRML",ClientID);}
if(LastValue(Short) OR LastValue(Sell)){plus.PlaceOrder("SELL",RefNumber, "NFO",Symbol,"DAY","LIMIT",AplliedQuantity,Pri ce,0 ,1,"NRML",ClientID);}
StaticVarSet("RefNumber",RefNumber+1);
StaticVarSet("lastdt",dt );
}
}
}

when signal is generated it is sent to nest but in nest it says i don't have the API or AIP activated to place the order. please tell me how to pass this error and place the order
 

Similar threads