RunCommand (Reserved Word)

image\trumpet2.gif Disclaimer

Allows you to run a Command Line instruction or Macro from within any EasyLanguage study.

EasyLanguage does not check the validity of the string that is specified for the keyword. If the command is not valid, a message will be displayed in the Events Log.

This command is intended for advanced users who understand how create EasyLanguage code for use in charting applications that utilize macros.

Syntax

RunCommand(CommandOrMacro);

Parameters

Name

Type

Description

CommandOrMacro

String

Sets a string value that is either a command line MACRO, or an actual command line instruction sequence.

See Command Line Reference for a list of supported command line strings.

Remarks

You cannot historically back-test the results of orders placed into the market with RunCommand.

If the Update value intra-bar check box is enabled in an study or strategy that calls the reserved word ’RunCommand’, it could execute the Command Line instructions or Macro on every tick causing unintended processing issues.

Examples

Run the ’.CustBuyMarket’ macro if time is 10:00am and the Close price is greater than the Open price.

If Time = 1000 AND Close > Open Then
Value1=
RunCommand
(".CustBuyMarket MSFT, 500");

Run the three command line instructions if Condition1 is TRUE. Each instruction set can contain one or more command sets.

If Condition1 Then Begin
Value1=
RunCommand
(".NWS");
Value1=RunCommand(".BuyLimit MSFT, 500 ;; .NewChart;; MSFT");

Value1=RunCommand(".BuyLimit DELL, 500 ;; .NewChart;; DELL");
End;

Related Topic

RunCommandOnLastBar Function