|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 8/20/2010 11:00:34 AM
Posts: 6,
Visits: 23
|
|
Hi all!
May be smb knows how to write the script which only puts into the log when the entry order is executed but not popup the window?
In the manual I've found TSystemEvent class, but there are only 4 events: EventTradeNotFound, EventDuplicateCloseOrder, EventOrderCantBeRemoved and EventOrderCantBeModified...
What the event when the entry order is executed?
|
|
|
|
|
Supreme Being
      
Group: Forum Members
Last Login: 1/27/2012 12:53:25 PM
Posts: 201,
Visits: 295
|
|
Hi, vvj!
To identify an order executing you can use follow structure:
procedure OnStart;
begin
CreateEntryOrder(History.Instrument, Account, Amount, bsbuy, History.Instrument.buy+Point*Shift,
NullRate,NullRate, otEStop, 'Entrybuy');
CreateEntryOrder(History.Instrument, Account, Amount, bssell, History.Instrument.Sell-Point*Shift,
NullRate,NullRate, otEStop, 'Entrysell');
end;
procedure OnOrderChange(const Action: TDataModificationType; const Order: TOrder);
var i:integer;
begin
//output the order information into the log
if (Action=dmtInsert) then
begin
log('Entry order placed: '+order.tag);
log('Instrument: ' +Order.Instrument.Name);
log('Account: ' +Order.Account.ID);
log('Amount: ' +FloatToStr(Order.Amount));
log('Order rate: ' +FloatToStr(Order.Rate));
end;
end;
procedure OnTradeChange(const Action: TDataModificationType; const Trade: TTrade);
begin
// if a new trade opened
if Action=dmtInsert then
begin
if Trade.Tag='Entrysell' then
begin
log('Sell position has been placed');
end;
if Trade.Tag='Entrybuy' then
begin
log('Buy position has been placed');
end;
end;
end;
Best regards!
Edited: 8/20/2010 8:40:19 AM by eMoe
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 8/20/2010 11:00:34 AM
Posts: 6,
Visits: 23
|
|
Thank you, ё-моё! :-)
I'll try it.
Can you explain me what does the commands ordr:=2 and ordr:=2 mean?
Thanks in advance.
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 8/20/2010 11:00:34 AM
Posts: 6,
Visits: 23
|
|
| ...ordr:=1 and ordr:=2...
|
|
|
|
|
Supreme Being
      
Group: Forum Members
Last Login: 1/27/2012 12:53:25 PM
Posts: 201,
Visits: 295
|
|
Hi, vvj!
I've copied part of the program and forgotten to delete ordr and reverse strings.
It's just variable.
Best regards!
Edited: 8/20/2010 8:41:00 AM by eMoe
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 8/20/2010 11:00:34 AM
Posts: 6,
Visits: 23
|
|
Unfortunately in this case the problem is not resolved.
Because when the order is executed, immediately appears the window "your entry oder bla-bla-bla was executed at...".
I want to kill THIS window, because you must to push the button "OK", only after that you can continue to work with the platform.
I thought that exists any "Event command" for the order execution and I could write something like that: "EventOrderExecution.Reaction := serLog;" on the start procedure.
Or may be I need to change the preferences in my trading platform, but I didn't find where.
Edited: 8/20/2010 11:02:33 AM by vvj
|
|
|
|