Changes

Jump to navigation Jump to search

How Scripts Work

359 bytes removed, 17:00, 23 February 2012
{| class="wikitable"
<tr class="QMtr"><td !colspan="46" class="QMtd" align="center">|'''Order Execution Priority Table'''</tr><tr class="QMtr">|-<td !colspan="4" class="QMtd-odd" align="center6">|Higher value indicates greater priority</tr><tr class="QMtr">|-<td class="QMtd">|'''Position'''<td class="QMtd">||'''&nbsp;&nbsp;Flat&nbsp;&nbsp;'''<td class="QMtd">||'''Long'''<td class="QMtd">||'''Short'''</tr>|-<tr class="QMtr"><td class="QMtd">|'''Long Entry'''||'''1'''||'''1'''||'''2'''</tr><tr class="QMtr">|-<td class="QMtd">|'''Short Entry'''||'''1'''||'''2'''||'''1'''</tr>|-<tr class="QMtr"><td class="QMtd">'''Long Exit'''||'''-'''||'''1'''||'''-'''</tr>|-<tr class="QMtr"><td class="QMtd">'''Short Exit'''||'''-'''||'''-'''||'''1'''</tr></table>|}
Multiple same-direction orders are assigned priority relative to each other based on the order in which the order statements are listed in the signal script. When multiple signals are combined to create a strategy, same-direction orders generated by different signals are assigned priority relative to each other based on the order that the signals appear under the '''Signals''' tab in the '''Format Objects''' window.
When multiple signals are combined to create a strategy, same-direction orders generated by different signals are assigned priority relative to each other based on the order that the signals appear under the '''Signals''' tab in the '''Format Objects''' window. Once the orders are sorted, the order that has the highest priority is executed. It is important to note that an entry order in the direction, opposite to the current position, will not simply cover the position, but actually reverse it.  For example, a Long 1 order, executed for a Short 1 position, will result in a Long 1 and not in a Flat position.
Taking in to account the change in position, resulting from execution of the order, the remaining orders are sorted again, and the order that has the highest priority is executed.
This procedure is repeated until all the orders are executed, or until none of the orders left can be executed – for example, only Exit orders are left and the position is flat.
If the only Entry orders left are in the same direction as the current position, these orders will only be executed if '''Pyramiding''' is enabled.  Pyramiding settings allow the number of entries in the same direction to be limited to a set number.
Any orders left that could not be executed are discarded.
'''Order Execution Priority example:'''
Multiple orders are generated, in the following order: Short exitExit, Short entryEntry, Long entryEntry, Long exitExit, and Long entryEntry.
The current position is '''Short'''.

Navigation menu