I think there is no in-Built function in Pi to do that.But instead, U Can use PiBridge to Place order from Text File…U Can use any Programming Language like VBScript or C++ to raed the text file content and place order in Pi using PiBridge.
The Following is the Detailed Process…
Ensure U are Subscribed to PiBridge
Ensure in Pi UserSettings under PiBridge Tab…U have selected Live semiAutomatic options
Copy the File Pibridge.dll from Amibroker Directory to C:\Windows\System32 Folder
Just Coded For MKT order Type Only…U Can modify the code to suit any Order Type
Create a Text File with Name Order.txt
add Trade Details in the below Format
OneLine Per Trade
Trade,Exch,Symbol,TradeSymbol,OrderType,ProductType,ClientId,Qty
Example:-
BUY,NSE,ACC,ACC-EQ,MKT,MIS,AB0123,120
SELL,NSE,AXISBANK,AXISBANK-EQ,MKT,MIS,AB0123,250
after adding required Trades save and close the Order.txt File
Now open a New Text Document and Copy paste the below code and save the file with .vbs extenstion and give any name For Ex:- Bridge.vbs
'Starting Code
On Error Resume Next
Dim objFSO,objFile,bridge,strline,strarr
Set objFSO = CreateObject(“Scripting.FileSystemObject”)
Set bridge = CreateObject(“pibridge.Bridge”)
Set objFile= objFSO.OpenTextFile(“Order.txt”, 1)
Do Until objFile.AtEndOfStream
strLine = objFile.readline
strarr = split(strline,",")
if ucase(strarr(0)) = “BUY” then
Trade = 1
Exch = ucase(strarr(1))
Symbol = ucase(strarr(2))
TrdSymbol = ucase(strarr(3))
OrdType = ucase(strarr(4))
ProdType = ucase(strarr(5))
ClientId = ucase(strarr(6))
Qty = CInt(strarr(7))
call bridge.PlaceOrder (Exch, TrdSymbol ,Symbol,“TEST”, Trade ,Qty,0,0,0,OrdType , ProdType, ClientId,“DAY”)
elseif ucase(strarr(0)) = “SELL” then
Trade = 2
Exch = ucase(strarr(1))
Symbol = ucase(strarr(2))
TrdSymbol = ucase(strarr(3))
OrdType = ucase(strarr(4))
ProdType = ucase(strarr(5))
ClientId = ucase(strarr(6))
Qty = CInt(strarr(7))
call bridge.PlaceOrder (Exch, TrdSymbol ,Symbol,“TEST”, Trade ,Qty,0,0,0,OrdType , ProdType, ClientId,“DAY”)
else
end if
Loop
objFile.Close
set objFSO = Nothing
Set bridge = Nothing
’End Code
Now double click the file bridge.vbs. It will read all lines in the Order.txt File and Place order in Pi accordingly…You can check your Order Details in Generated Orders alerts window in Pi.
Ensure that Order.txt File and Bridge.vbs file are in same directory/Folder.
Post ur Comment