Modify Order Expand / Collapse
Author
Message
Posted 8/25/2010 4:02:39 AM
Forum Member

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member

Group: Forum Members
Last Login: 7/16/2011 9:47:02 AM
Posts: 34, Visits: 192
Hi ,

I have tried to use the example in the Manual for modify order but it show me a pop up with the message << Compilation Error: ')' expected Line : 15 , Column 55

I make the modify but the message come again !!

const

 StrategyName = 'Orders';

procedure OnStart;

var i: Integer;

begin

for i:=0 to OrderList.Count-1 do

      OrderList.Get(i).Modify(OrderList.Get(i).Rate – 2*OrderList.Get(i).Instrument.PointSize, 3);

end;

Post #1891
Posted 8/25/2010 3:36:21 PM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 2/7/2012 10:15:57 AM
Posts: 445, Visits: 818
const
StrategyName = 'Orders';

var
    i: Integer;

procedure OnStart;
begin

for i:=OrderList.Count-1 downto 0 do
    OrderList.Get(i).Modify((OrderList.Get(i).Rate – 2)*OrderList.Get(i).Instrument.PointSize, 3);
end;

end;
Post #1895
Posted 8/25/2010 4:38:38 PM
Forum Member

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member

Group: Forum Members
Last Login: 7/16/2011 9:47:02 AM
Posts: 34, Visits: 192
Hi,

thank you very much, but I have try your version with the same problem.... Error Line 11, Column 54: ')' expected

I don't understand why....

Post #1896
Posted 8/26/2010 12:08:05 AM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 2/7/2012 10:15:57 AM
Posts: 445, Visits: 818
medebaby (8/25/2010)
Hi,

thank you very much, but I have try your version with the same problem.... Error Line 11, Column 54: ')' expected

I don't understand why....


Your Problem is the minus sign in the formula. It is not a minus sign. It is a hyphen. There is a difference. Change it to a minus sign.

OrderList.Get(i).Modify((OrderList.Get(i).Rate – 2)*OrderList.Get(i).Instrument.PointSize, 3);

Below is the corrected script.

-----------------------------------------

const
  StrategyName = 'Orders';

var
  i: Integer;

procedure OnStart;
begin

  for i:=OrderList.Count-1 downto 0 do
  begin
    OrderList.Get(i).Modify((OrderList.Get(i).Rate - 2)*OrderList.Get(i).Instrument.PointSize, 3);
  end;

end;


Edited: 8/26/2010 1:11:11 AM by black
Post #1898
Posted 8/26/2010 6:26:57 AM
Forum Member

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member

Group: Forum Members
Last Login: 7/16/2011 9:47:02 AM
Posts: 34, Visits: 192
Ok.. Thank you

but There's an other problem when I'm starting it. The details are :

EXCEPTION
ESmartException in TTraderDataProvider
CODE
2290
MESSAGE
Exception at trading strategy "Orders" in routine OnStart at Line:Column 11:5
check constraint (EDFOREX118.OPNORDR_RATE_CHECK) violated
DETAILS
ORA-02290: check constraint (EDFOREX118.OPNORDR_RATE_CHECK) violated
ORA-06512: at "EDFOREX118.FRONTEND", line 1261
ORA-06512: at line 18


CALL STACK
fx_client.exe=>BasicDataProvider.pas=>TBasicDataProvider.GetData=>112
fx_client.exe=>TraderDataProvider.pas=>TTraderDataProvider.ChangeOrder=>868
fx_client.exe=>TraderDataProvider.pas=>TTraderDataProvider.ChangeOrder=>859
fx_client.exe=>StrategyProcessor.pas=>TStrategyProcessor.ModifyOrder=>643
fx_client.exe=>StrategyProcessor.pas=>TStrategyProcessor.ModifyOrder=>636
fx_client.exe=>StrategiesCallMethods.pas=>TStrategiesCallMethods.CM_Order=>893
fx_client.exe=>fs_iinterpreter.pas=>TfsMethodHelper.GetValue=>1279
fx_client.exe=>fs_iinterpreter.pas=>TfsDesignator.DoCalc=>1855
fx_client.exe=>fs_iinterpreter.pas=>TfsDesignator.DoCalc=>1799
fx_client.exe=>fs_iinterpreter.pas=>TfsDesignator.GetValue=>1896
fx_client.exe=>fs_iinterpreter.pas=>TfsCallStmt.Execute=>2764
fx_client.exe=>fs_iinterpreter.pas=>TfsStatement.Execute=>2681
fx_client.exe=>fs_iinterpreter.pas=>TfsStatement.Execute=>2677
fx_client.exe=>fs_iinterpreter.pas=>TfsForStmt.Execute=>2868
fx_client.exe=>fs_iinterpreter.pas=>TfsStatement.Execute=>2681
fx_client.exe=>fs_iinterpreter.pas=>TfsProcVariable.GetValue=>1073
fx_client.exe=>fs_iinterpreter.pas=>TfsScript.CallFunction=>2458
fx_client.exe=>fs_iinterpreter.pas=>TfsScript.CallFunction=>2449
fx_client.exe=>StrategyProcessor.pas=>TStrategyProcessor.CallFSFunction=>488
fx_client.exe=>StrategyProcessor.pas=>TStrategyProcessor.CallFSFunction=>483
fx_client.exe=>StrategyProcessor.pas=>TStrategyProcessor.Execute=>535

May you help me again ?

Best regards

Post #1899
Posted 8/26/2010 1:57:14 PM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 2/7/2012 10:15:57 AM
Posts: 445, Visits: 818
Sorry, but I don't read Delphi code that well. This may or may not help. It is a check to see if there is an open trade for the "for" loop to work with. If there isn't, an error will be generated. This script will bypass the "for" loop if there aren't any open trades available.

-----------------------------------------

const
  StrategyName = 'Orders';

var
  i: Integer;

procedure OnStart;
begin

  if (TradeList.Count>0) then
  begin

    for i:=OrderList.Count-1 downto 0 do
    begin
      OrderList.Get(i).Modify((OrderList.Get(i).Rate - 2)*OrderList.Get(i).Instrument.PointSize, 3);
    end;

  end;

end;
Post #1901
Posted 8/27/2010 8:21:55 AM
Forum Member

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member

Group: Forum Members
Last Login: 7/16/2011 9:47:02 AM
Posts: 34, Visits: 192
Ok,

It is working now, with no error !!

Thank you

Now I am waiting to understand what modify it does in this setting and try some different solution.

For the first 30' any orders are modify

... hope it is right now

thanks again and

best regards

Post #1904
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Admin

All times are GMT -5:00, Time now is 12:04pm


© 2009 Actforex.com Terms of Use