Saturday, September 04, 2010

Commission Per Order [CPO]

Descripton
Summary:
This commission script calculates the constant commission paid for each executed order, denominated in the account currency.


Variables
TypeIdentifierDescription
Number_commissionPerOrderUse for the commission amount paid for each executed order.

OnInitialize
Function Parameters
TypeIdentifierDescription
NumbercommissionPerOrderUse for the commission amount paid for each executed order. [Default 10]
Implementation
	 ' Assign the parameter to a script variable.
	_commissionPerOrder = commissionPerOrder

OnCommission
Function Parameters
TypeIdentifierDescription
IntegerorderIndex
IntegerorderFillIndex
Numberquantity
Numberprice
Implementation
	 ' Return the commission being paid for the executed order.
	If (orderFillIndex = 0) Then
		Return _commissionPerOrder
	End If
	Return 0

Copyright © 2010 IQBroker, LLC. All rights reserved.