Documentation>Application Documentation>XMIM Documentation>XMIM Examples>DO EVERY PERIOD Example

DO EVERY PERIOD Example

To add the Do Every Period query block, select Tools>Add Query Block>DO EVERY PERIOD from
the XMIM menu bar.

Example Query:

1: ORDER

1.1: Buy 1 contract of US

              Enter on the market with

              stop_loss at Low of US 1 day ago

              trail stop_loss at Low of US 1 day ago

              take profit at Close of US 1 day ago + 10 day average of range of US

              trail profit at Low of US 1 day ago

 

Do Every Units...

This block will be executed once per day, and on days that are Monday, and the DJIA closes higher
than it did on Friday, the variables sumMoves and numMoves will be updated to reflect the new data. 
This query answers the question ‘what is the average Monday up move in the DJIA’.
(Answer is 0.81% vs. 0.95% for down moves.)  Clearly, this set of conditions could have been in the
WHEN condition in a DO-SHOW-WHEN block, or an ORDER block.

The following options affect the DO-EVERY block.

  •  Execution Units

  • Attribute Units

  • Execution Options