1,501
edits
Line 131: | Line 131: | ||
{| class="wikitable" | {| class="wikitable" | ||
!colspan="6"|'''Order Execution Priority Table''' | |||
|- | |||
!colspan="6"|Higher value indicates greater priority | |||
|- | |||
|'''Position'''||'''Flat'''||'''Long'''||'''Short''' | |||
|- | |||
|'''Long Entry'''||'''1'''||'''1'''||'''2''' | |||
|- | |||
|'''Short Entry'''||'''1'''||'''2'''||'''1''' | |||
|- | |||
'''Long Exit'''||'''-'''||'''1'''||'''-''' | |||
|- | |||
'''Short Exit'''||'''-'''||'''-'''||'''1''' | |||
|} | |||
'''1''' | |||
'''1''' | |||
'''2''' | |||
'''1''' | |||
'''2''' | |||
'''1''' | |||
'''-''' | |||
'''1''' | |||
'''-''' | |||
'''-''' | |||
'''-''' | |||
'''1''' | |||
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 | 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. | ||
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. | 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. | 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. | ||
Line 177: | Line 158: | ||
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. | 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. | 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. | Any orders left that could not be executed are discarded. | ||
Line 184: | Line 167: | ||
'''Order Execution Priority example:''' | '''Order Execution Priority example:''' | ||
Multiple orders are generated, in the following order: Short | Multiple orders are generated, in the following order: Short Exit, Short Entry, Long Entry, Long Exit, and Long Entry. | ||
The current position is '''Short'''. | The current position is '''Short'''. |