Need a sample code for autocreating PI Order from Amibroker.An Ami Explorer should trigger this.

snbarma
I have a Amibroker Explorer.The result of it should trigger Order creation.
The code I have written, I have giving here. It is is plain code without any bells and whistle.
I am not sure if this code I am writing is in right direction or not.
Your suggestion/input will help.
===========================
cond=(buyma OR sellma) AND comb;//Explorer works fine with this
Filter=cond;
ORder = IIf(buyma AND comb,1,IIf(sellma AND comb,2,0));
if(BsCond>0) {
brd = CreateStaticObject("pibridge.Bridge");
NTrdSymbol = Name()+"-EQ";
prevO = Ref(O,-1);//previous bar's open
prevC = Ref(C,-1);////previous bar's close
cond=(buyma OR sellma) AND comb;
ooo=ValueWhen(cond,prevO,1);
ccc=ValueWhen(cond,prevC,1);
if (Order==1) {
NPrice=ooo;
NOrder="BUY";
}
if (Order==2) {
NPrice=ccc;
NOrder="SELL";
}
brd.PlaceOrder ("NSE", NTrdSymbol,NOrder,NPrice, 100,.....);
==================================================================



Sign In or Register to comment.