### .PointandFigure command example Source: https://help.tradestation.com/10_00/eng/tradestationhelp/popup_commands/pointandfigure_command.htm Example usage of the .PointandFigure command with parameters for box size, reversal, interval, basis, and one-step-back setting. ```text .PF".5,3,5 min, C, off" ``` -------------------------------- ### Example: .macro1 ;; .action1 ;; .macro2 Source: https://help.tradestation.com/10_00/eng/tradestationhelp/cl/macro_command_rules.htm Illustrates how to combine multiple commands in a macro using two semi-colons as separators. ```plaintext .macro1 ;; .action1 ;; .macro2 ``` -------------------------------- ### Calling .PlaceOrder from a Command Line Macro Source: https://help.tradestation.com/10_00/eng/tradestationhelp/tb/placeorder_command.htm Example of using the .PlaceOrder command with specific parameters for a limit buy order. ```text .PlaceOrder "Action='Buy', Symbol='MSFT', SymbolCategory='Equity', OrderType='Limit', LimitPrice=25.00, Quantity=500, Duration='Day', Account='12345' " ``` -------------------------------- ### .ReversePosition command example Source: https://help.tradestation.com/10_00/eng/tradestationhelp/popup_commands/reverseposition_command.htm Example usage of the .ReversePosition command. Replace SYMBOL with the desired symbol. The command includes the account number and an optional OSO template name enclosed in quotes. ```text .ReversePosition SYMBOL, 1234567, "Exit - Brk - 1L/1S" ``` -------------------------------- ### .KaseBar command usage Source: https://help.tradestation.com/10_00/eng/tradestationhelp/popup_commands/kasebar_command.htm Example of the .KaseBar command with a target range of 2 and an interval of 1 minute. ```text .KaseBar "2,1 min" ``` -------------------------------- ### PlaceOrder command line string with advanced parameters Source: https://help.tradestation.com/10_00/eng/tradestationhelp/tb/placeorder_advanced_parameters.htm Example of a PlaceOrder command string including advanced parameters like OCOGroupName, StartTime, and ActivationPrices. ```text .PlaceOrder "Symbol='SPY', SymbolCategory='Equity', account='SIM99999', action='Buy', Duration='Day', LimitPrice='28', OrderType='Limit', Quantity='100', OrderName='1stOrder', OCOGroupName='MyOCOGroup', StartTime='2:30:00 PM', ActivationPrices='IBM>=100.00(STT)&CSCO<24.00(STTN)|MSFT>25(DTT)', MustBeUnique='TRUE'" ``` -------------------------------- ### PlaceOrder command for second order with advanced parameters Source: https://help.tradestation.com/10_00/eng/tradestationhelp/tb/placeorder_advanced_parameters.htm Example of a PlaceOrder command string for a second order with advanced parameters and OCO grouping. ```text .PlaceOrder "Symbol='SPY', SymbolCategory='Equity', account='SIM99999', action='Buy', Duration='Day', OrderType='Stop Market', Quantity='100', StopPrice='32', OrderName='2ndOrder', OCOGroupName='MyOCOGroup', StartTime='2:30:00 PM', ActivationPrices='IBM>=100.00(STT)&CSCO<24.00(STTN)|MSFT>25(DTT)', MustBeUnique='TRUE'" ``` -------------------------------- ### PlaceOrder command for staged market order Source: https://help.tradestation.com/10_00/eng/tradestationhelp/tb/placeorder_advanced_parameters.htm Example of a PlaceOrder command string for a staged market order. ```text .PlaceOrder "Symbol='SPY', SymbolCategory='Equity', account='SIM99999', action='Sell', Duration='Day', OrderType='Market', Quantity='100', Stage='TRUE'" ``` -------------------------------- ### PlaceOrder with Advanced Parameters Source: https://help.tradestation.com/10_00/eng/tradestationhelp/tb/placeorder_advanced_parameters.htm Example command line strings for PlaceOrder with advanced parameters including OCOGroupName, OSOTriggerBy, ActivationPrices, MustBeUnique, and Stage. ```APIDOC ## PlaceOrder Command Line String ### Description Constructs and issues a PlaceOrder command string to the macro command line via the EasyLanguage RunCommand reserved word. Supports advanced parameters for OCO groups, OSO brackets, activation prices, and staging. ### Syntax .PlaceOrder "Parameter1='Value1', Parameter2='Value2', ..." ### Parameters - **Symbol** (string) - Required - The symbol for the order. - **SymbolCategory** (string) - Required - The category of the symbol (e.g., 'Equity'). - **account** (string) - Required - The account identifier. - **action** (string) - Required - The order action (e.g., 'Buy', 'Sell'). - **Duration** (string) - Required - The order duration (e.g., 'Day'). - **LimitPrice** (string) - Optional - The limit price for limit orders. - **OrderType** (string) - Required - The type of order (e.g., 'Limit', 'Stop Market', 'Market'). - **Quantity** (string) - Required - The quantity of shares. - **OrderName** (string) - Optional - A name for the order. - **OCOGroupName** (string) - Optional - The name of the OCO group. - **StartTime** (string) - Optional - The start time for the order. - **ActivationPrices** (string) - Optional - Activation price conditions (e.g., 'IBM>=100.00(STT)&CSCO<24.00(STTN)|MSFT>25(DTT)'). - **MustBeUnique** (string) - Optional - Indicates if the order must be unique (e.g., 'TRUE'). - **OCOBracketName** (string) - Optional - The name of the OCO bracket. - **OSOTriggerBy** (string) - Optional - The name of the order that triggers this order. - **StopPrice** (string) - Optional - The stop price for stop orders. - **Stage** (string) - Optional - Indicates if the order is staged (e.g., 'TRUE'). ### Examples #### Example 1: Limit Order with OCO Group and Activation Prices .PlaceOrder "Symbol='SPY', SymbolCategory='Equity', account='SIM99999', action='Buy', Duration='Day', LimitPrice='28', OrderType='Limit', Quantity='100', OrderName='1stOrder', OCOGroupName='MyOCOGroup', StartTime='2:30:00 PM', ActivationPrices='IBM>=100.00(STT)&CSCO<24.00(STTN)|MSFT>25(DTT)', MustBeUnique='TRUE'" #### Example 2: Limit Order with OSO Trigger .PlaceOrder "Symbol='SPY', SymbolCategory='Equity', account='SIM99999', action='Sell', Duration='Day', LimitPrice='30', OrderType='Limit', Quantity='100', OCOBracketName='1stBracket', OSOTriggerBy='1stOrder'" #### Example 3: Stop Market Order with OSO Trigger .PlaceOrder "Symbol='SPY', SymbolCategory='Equity', account='SIM99999', action='Sell', Duration='Day', OrderType='Stop Market', Quantity='100', StopPrice='26', OCOBracketName='1stBracket', OSOTriggerBy='1stOrder'" #### Example 4: Stop Market Order with OCO Group and Activation Prices .PlaceOrder "Symbol='SPY', SymbolCategory='Equity', account='SIM99999', action='Buy', Duration='Day', OrderType='Stop Market', Quantity='100', StopPrice='32', OrderName='2ndOrder', OCOGroupName='MyOCOGroup', StartTime='2:30:00 PM', ActivationPrices='IBM>=100.00(STT)&CSCO<24.00(STTN)|MSFT>25(DTT)', MustBeUnique='TRUE'" #### Example 5: Limit Order with OSO Trigger .PlaceOrder "Symbol='SPY', SymbolCategory='Equity', account='SIM99999', action='Sell', Duration='Day', LimitPrice='34', OrderType='Limit', Quantity='100', OCOBracketName='2ndBracket', OSOTriggerBy='2ndOrder'" #### Example 6: Stop Market Order with OSO Trigger .PlaceOrder "Symbol='SPY', SymbolCategory='Equity', account='SIM99999', action='Sell', Duration='Day', OrderType='Stop Market', Quantity='100', StopPrice='30', OCOBracketName='2ndBracket', OSOTriggerBy='2ndOrder'" #### Example 7: Market Order with Stage .PlaceOrder "Symbol='SPY', SymbolCategory='Equity', account='SIM99999', action='Sell', Duration='Day', OrderType='Market', Quantity='100', Stage='TRUE'" ``` -------------------------------- ### PlaceOrder command for second bracket limit order Source: https://help.tradestation.com/10_00/eng/tradestationhelp/tb/placeorder_advanced_parameters.htm Example of a PlaceOrder command string for a limit order in the second bracket. ```text .PlaceOrder "Symbol='SPY', SymbolCategory='Equity', account='SIM99999', action='Sell', Duration='Day', LimitPrice='34', OrderType='Limit', Quantity='100', OCOBracketName='2ndBracket', OSOTriggerBy='2ndOrder'" ``` -------------------------------- ### Execute .Kagi command Source: https://help.tradestation.com/10_00/eng/tradestationhelp/popup_commands/kagi_command.htm Example of the .Kagi command syntax using a reversal amount of 2, price reversal type, and a 1-minute interval. ```text .Kagi "2,price, 1 min" ``` -------------------------------- ### PlaceOrder command for OSO bracket order Source: https://help.tradestation.com/10_00/eng/tradestationhelp/tb/placeorder_advanced_parameters.htm Example of a PlaceOrder command string used to establish an OSO bracket relationship. ```text .PlaceOrder "Symbol='SPY', SymbolCategory='Equity', account='SIM99999', action='Sell', Duration='Day', LimitPrice='30', OrderType='Limit', Quantity='100', OCOBracketName='1stBracket', OSOTriggerBy='1stOrder'" ``` -------------------------------- ### .LineBreak command example Source: https://help.tradestation.com/10_00/eng/tradestationhelp/popup_commands/linebreak_command.htm Sets the number of line breaks to 2 and the interval to 1 minute for the underlying data. ```plaintext .LineBreak "2, 1 min" ``` -------------------------------- ### Command Line Macro .Big5 Source: https://help.tradestation.com/10_00/eng/tradestationhelp/cl_macros/create_cl_macro.htm Example macro named .Big5 that creates a new 5 minute chart and loads it with 30 days of pre & post session data. Run by typing .Big5 on the Command Line and pressing ENTER, or by assigning a hot key. ```text .Newchart;; 5 min;; .Days 30;; .Session US Stock with Pre & Post Market;; ``` -------------------------------- ### Calling LimitOrder from EasyLanguage Source: https://help.tradestation.com/10_00/eng/tradestationhelp/tb/placeorder_command.htm Example of using the LimitOrder function in EasyLanguage to execute an order equivalent to the .PlaceOrder command. ```easylanguage Value1 = LimitOrder("Once","12345","Buy","Equity","MSFT",100,"Day","",25.00); ``` -------------------------------- ### RangeBar command example Source: https://help.tradestation.com/10_00/eng/tradestationhelp/popup_commands/rangebar_command.htm Creates a Range Bar chart with a range amount of 2 and an interval of 1 minute. The interval parameter specifies the underlying data interval. ```TradeStation .RangeBar "2, 1min" ``` -------------------------------- ### Using CurrentAsk and CurrentBid in EasyLanguage Source: https://help.tradestation.com/10_00/eng/tradestationhelp/charting/bidask_snapshot_price_chart.htm Two examples of using the CurrentAsk and CurrentBid functions in EasyLanguage. The first places a limit order at the current ask when Condition1 is true. The second calculates the spread between the current ask and bid. ```EasyLanguage if Condition1 then Buy ("Entry Name") next bar at CurrentAsk Limit; ``` ```EasyLanguage Value1 = CurrentAsk - CurrentBid; ``` -------------------------------- ### PlaceOrder command for second bracket stop market order Source: https://help.tradestation.com/10_00/eng/tradestationhelp/tb/placeorder_advanced_parameters.htm Example of a PlaceOrder command string for a stop market order in the second bracket. ```text .PlaceOrder "Symbol='SPY', SymbolCategory='Equity', account='SIM99999', action='Sell', Duration='Day', OrderType='Stop Market', Quantity='100', StopPrice='30', OCOBracketName='2ndBracket', OSOTriggerBy='2ndOrder'" ``` -------------------------------- ### PlaceOrder command for OSO stop market order Source: https://help.tradestation.com/10_00/eng/tradestationhelp/tb/placeorder_advanced_parameters.htm Example of a PlaceOrder command string for a stop market order within an OSO relationship. ```text .PlaceOrder "Symbol='SPY', SymbolCategory='Equity', account='SIM99999', action='Sell', Duration='Day', OrderType='Stop Market', Quantity='100', StopPrice='26', OCOBracketName='1stBracket', OSOTriggerBy='1stOrder'" ``` -------------------------------- ### CancelAllOrdersSymbolAccount command examples Source: https://help.tradestation.com/10_00/eng/tradestationhelp/popup_commands/cancelallorderssymbolaccount_command.htm Shows the full command and its shorthand alias. The first cancels all open orders for symbol MSFT in account 1234567; the second uses the alias .CAOSA with the AllAccounts keyword to cancel for all accounts. ```plaintext .CancelAllOrdersSymbolAccount MSFT, 1234567 ``` ```plaintext .CAOSA MSFT,AllAccounts ``` -------------------------------- ### FundDate Source: https://help.tradestation.com/10_00/eng/tradestationhelp/elanalysis/fundamental/about_fundamental_data_in_tradestation.htm Function to get the post date associated with a fundamental data field. Requires declaring a variable and using output parameters. Supports access to fundamental fields from other data streams. ```APIDOC ## FundDate ### Description Returns the post date associated with a fundamental data field. Requires declaring a variable and using output parameters. Supports access to fundamental fields from other data streams. ### Function Signature FundDate(...) ### Parameters - **variable** (output) - Required - Variable to receive the post date. - **fundamental field** - Required - The fundamental data field to retrieve. - **data stream** (optional) - Optional - Specify 'of Data2' to access fundamental fields from other data streams. ### Return Value Returns the post date and error status in one call. ### Example easylanguage // Example usage ``` -------------------------------- ### GetFundPostDate Source: https://help.tradestation.com/10_00/eng/tradestationhelp/elanalysis/fundamental/about_fundamental_data_in_tradestation.htm Reserved word to get the post date associated with a fundamental data field for Data1. Can be used as input with Custom 1, 2, 3, and 4 Line indicators to directly display values in charts and grids. ```APIDOC ## GetFundPostDate ### Description Gets the post date associated with a fundamental data field for Data1. Can be used as input with Custom 1, 2, 3, and 4 Line indicators to directly display values in charts and grids. ### Reserved Word GetFundPostDate ### Parameters - **fundamental field** - Required - The fundamental data field to retrieve. ### Return Value Returns the post date. ### Example easylanguage // Example usage ``` -------------------------------- ### FundPeriodEndDate Source: https://help.tradestation.com/10_00/eng/tradestationhelp/elanalysis/fundamental/about_fundamental_data_in_tradestation.htm Function to get the period end date associated with a fundamental data field. Requires declaring a variable and using output parameters. Supports access to fundamental fields from other data streams. ```APIDOC ## FundPeriodEndDate ### Description Returns the period end date associated with a fundamental data field. Requires declaring a variable and using output parameters. Supports access to fundamental fields from other data streams. ### Function Signature FundPeriodEndDate(...) ### Parameters - **variable** (output) - Required - Variable to receive the period end date. - **fundamental field** - Required - The fundamental data field to retrieve. - **data stream** (optional) - Optional - Specify 'of Data2' to access fundamental fields from other data streams. ### Return Value Returns the period end date and error status in one call. ### Example easylanguage // Example usage ``` -------------------------------- ### GetFundPeriodEndDate Source: https://help.tradestation.com/10_00/eng/tradestationhelp/elanalysis/fundamental/about_fundamental_data_in_tradestation.htm Reserved word to get the period end date associated with a fundamental data field for Data1. Can be used as input with Custom 1, 2, 3, and 4 Line indicators to directly display values in charts and grids. ```APIDOC ## GetFundPeriodEndDate ### Description Gets the period end date associated with a fundamental data field for Data1. Can be used as input with Custom 1, 2, 3, and 4 Line indicators to directly display values in charts and grids. ### Reserved Word GetFundPeriodEndDate ### Parameters - **fundamental field** - Required - The fundamental data field to retrieve. ### Return Value Returns the period end date. ### Example easylanguage // Example usage ``` -------------------------------- ### Create and save a multi-window workspace Source: https://help.tradestation.com/10_00/eng/tradestationhelp/cl/action_command_rules.htm Chains multiple commands to create a workspace containing a news window, a chart, and a RadarScreen, then saves it as 'MyWorkSpace'. ```text .nws ;; .newnews ;; .nc ;; .newradarscreen ;; saveas MyWorkSpace ``` -------------------------------- ### Create new desktop and toggle bars: .NewDesktop ;; .Desktop_Bars Source: https://help.tradestation.com/10_00/eng/tradestationhelp/cl/macro_command_rules.htm Runs a command to create a new desktop and runs a macro that toggles the Trade Bar, Position Graph Bar and Status Bar off. ```plaintext .NewDesktop ;; .Desktop_Bars ``` -------------------------------- ### .PlaceOrder Advanced Parameters Source: https://help.tradestation.com/10_00/eng/tradestationhelp/tb/placeorder_advanced_parameters.htm Reference for the .PlaceOrder macro advanced parameters, including parameter names, types, and usage notes. ```APIDOC ## .PlaceOrder Advanced Parameters ### Description Defines advanced parameters for the .PlaceOrder command line macro to support OCO/OSO order associations, order naming, activation rules, and order protection. ### Parameters #### OrderName - **Type**: String (limited to 15 characters) - **Required**: Optional - **Description**: Assigns a name to an active order for referencing in OSO triggers or cancellation via CancelOrder macro. #### OSOTriggerBy - **Type**: String (refers to OrderName of an existing open order) - **Required**: Optional - **Description**: Specifies the parent order (by OrderName) that triggers the OSO child order. #### OCOGroupName - **Type**: String - **Required**: Optional - **Description**: Tags the order with a group name to establish OCO relationships; filling one order cancels others in the group. #### OCOBracketName - **Type**: String - **Required**: Optional - **Description**: Tags the order for the TradeManager Group Name column with a "Brk " prefix; matching names create a Bracket OCO Order. #### StartTime - **Type**: String (hh:mm:ss AM/PM format) - **Required**: Optional - **Description**: Activation rule specifying a start time; can immediately activate if prior to order within an active session. #### ActivationPrices - **Type**: String - **Required**: Optional - **Description**: Activation rules encapsulated in a string without spaces, using & for And, | for Or, and parentheses for trigger type abbreviations (e.g., (SST)). ### Notes - CancelOrder cancels all orders with the same OrderName. - OSOTriggerBy links only to the most recent order with the specified OrderName. ``` -------------------------------- ### .PlaceOrder Source: https://help.tradestation.com/10_00/eng/tradestationhelp/tb/placeorder_command.htm Places an order using a macro command or with RunCommandOnLastBar from EasyLanguage. The command accepts a string of comma-separated parameters, each specifying a keyword and value. ```APIDOC ## .PlaceOrder ### Description Places an order using a macro command or with RunCommandOnLastBar from EasyLanguage. ### Syntax `.PlaceOrder` "< parameter='keyword' >, < parameter=number >... ,< parameter='string' > " ### Parameters #### Parameter Options - **** (String) - Required - Account identifier. - **** (String) - Required - Order action: Buy, Sell, SellShort, BuyToCover, BuyToOpen, SellToOpen, SellToClose, BuyToClose. - **** (String) - Optional - Activation prices. - **** (Boolean) - Optional - True or False. - **** (Boolean) - Optional - True or False. - **** (Number) - Optional - Number, 0 represents False. - **** (String) - Optional - Day, Day+, GTC, GTC+, GTD, GTD+, IOC, FOK, OPG, CLO, 1 Min, 3 Min, 5 Min. - **** (Boolean) - Optional - True or False. - **** (String) - Optional - Date in 'MM/DD/YY' format. - **** (Number) - Optional - Number, 0 represents False. - **** (Number) - Optional - Limit price. - **** (Boolean) - Optional - True or False. - **** (Boolean) - Optional - True or False. - **** (String) - Optional - OCO bracket name. - **** (String) - Optional - OCO group name. - **** (String) - Optional - Order Entry Macro Name. - **** (String) - Optional - Limited to 15 characters. - **** (String) - Optional - Market, Limit, Stop Market, Stop Limit. - **** (String) - Optional - Reference the OrderName of an existing open order. - **** (Boolean) - Optional - True or False. - **** (Number) - Optional - Quantity. - **** (String) - Optional - Shares or Currency. - **** (String) - Optional - Intelligent, AMEX, ARCX, AUTO, BATS, CDRG, EDGA, EDGX, Knight Link, NITE, NQBX, NSDQ, NYSE. - **** (Number) - Optional - Number, 0 represents False. - **** (Boolean) - Optional - True or False. - **** (String) - Optional - Time in hh:mm:ss AM/PM format. - **** (Number) - Optional - Stop price. - **** (String) - Required - Symbol. - **** (String) - Optional - Equity, Future, EquityOption, IndexOption. - **** (Number) - Optional - Number, 0 represents False. - **** (String) - Optional - pts, pct, minmove. ### Request Example Calling from a Command Line Macro: ``` .PlaceOrder "Action='Buy', Symbol='MSFT', SymbolCategory='Equity', OrderType='Limit', LimitPrice=25.00, Quantity=500, Duration='Day', Account='12345' " ``` Calling from EasyLanguage: ``` Value1 = LimitOrder("Once","12345","Buy","Equity","MSFT",100,"Day","",25.00); ``` ### Notes - It is required that character strings, macro names, and keyword values be enclosed in single quotes. - Advanced parameters are available as of TradeStation 8.5. See .PlaceOrder Advanced Parameters for more details. ``` -------------------------------- ### .PointandFigure Source: https://help.tradestation.com/10_00/eng/tradestationhelp/popup_commands/pointandfigure_command.htm Creates a Point & Figure chart with the specified parameters. The command accepts a comma-separated list of options for box size, reversal, interval, basis, and one-step-back. ```APIDOC ## .PointandFigure ### Description Creates a Point & Figure chart using the specified parameters. ### Syntax .PointandFigure ### Parameters - **** (BSize) - Box size amount. - **** (REV) - Amount of reversal. - **** (PFI) - Interval of the underlying data. - **** (PFB) - The method used to construct the Point & Figure chart. - **** (OSB) - Toggles the One-Step-Back setting. ### Example .PF".5,3,5 min, C, off" ``` -------------------------------- ### Create a new chart with specific symbol, duration, and interval Source: https://help.tradestation.com/10_00/eng/tradestationhelp/cl/action_command_rules.htm Executes the .newchart command with parameters to plot 10 days of MSFT data on a 5-minute interval. ```text .newchart ;; msft 10 days ;; 5 min ``` -------------------------------- ### Create a new chart with current symbol and interval Source: https://help.tradestation.com/10_00/eng/tradestationhelp/cl/action_command_rules.htm Executes the .newchart command to open a new chart using the current symbol and interval settings. ```text .newchart ``` -------------------------------- ### .ExecuteBasket , , , , , Source: https://help.tradestation.com/10_00/eng/tradestationhelp/popup_commands/executebasket_command.htm Executes the named basket from the Basket Order window based on user provided parameters. The command takes a trade list name, account, side, percent, route, and duration as parameters. ```APIDOC ## .ExecuteBasket , , , , , ### Description Executes the named basket from the Basket Order window based on user provided parameters. ### Method Command ### Syntax .ExecuteBasket , , , , , ### Parameters #### Required Parameters - **** (string) - Required - Name of the trade list to be executed. These are text files that contain one or more equities symbols and the execution information for the symbol. The files are created and saved by the Basket Order application and are stored in a sub directory named "Trade Lists" under the "TradeStation" directory. These files can also be created using a standard text editor. - **** (string) - Required - String representation of the account to execute in. - **** (string) - Required - Buy, Sell, Cover, Short for equities only. - **** (integer) - Required - Percent of shares to execute for each individual symbol. Can be any integer between 1 and 500. - **** (string) - Required - Route to send orders to. Intelligent, ARCX, BTRD, NSDQ for equities. - **** (string) - Required - Duration of order. Day, Day+, GTC, GTC+, IOC, FOK, OPG, 1, 3, 5 min for equities. ### Example **Calling from a Command Line Macro:** .ExecuteBasket MyTradeList.txt, 337071 Margin2, Buy, 100, Intelligent, Day **Calling from EasyLanguage:** Value1 = RunCommandOnLastBar(".ExecuteBasket MyTradeList.txt, 337071 Margin2, Buy, 100, Intelligent, Day") ; ``` -------------------------------- ### .Kagi Source: https://help.tradestation.com/10_00/eng/tradestationhelp/popup_commands/kagi_command.htm The .Kagi command creates a Kagi chart based on the specified reversal amount, reversal type, and interval. It is used in TradeStation's analysis techniques to display price movements with Kagi-style reversals. ```APIDOC ## .Kagi ### Description The .Kagi command creates a Kagi chart based on the specified reversal amount, reversal type, and interval. It is used in TradeStation's analysis techniques to display price movements with Kagi-style reversals. ### Syntax `.Kagi ` ### Parameters - **** (numeric) - Required - Amount of the reversal. - **** (string) - Required - Type of reversal (e.g., price, percentage, etc.). - **** (string) - Required - Interval of the underlying data (e.g., "1 min", "5 min", "daily"). ### Example `.Kagi "2,price, 1 min"` ### Notes - The command is used in TradeStation's EasyLanguage or RadarScreen to generate Kagi charts. - Parameters are comma-separated within quotes. ``` -------------------------------- ### Run order macro: .Buy_Improve Source: https://help.tradestation.com/10_00/eng/tradestationhelp/cl/macro_command_rules.htm Runs an order macro that places a limit order to Buy 500 shares at the inside bid + .01. ```plaintext .Buy_Improve ``` -------------------------------- ### Plot net commercial position using GetFundData with COTF-12 and COTF-13 Source: https://help.tradestation.com/10_00/eng/tradestationhelp/elanalysis/fundamental/cot_data_fields.htm Declares two numeric variables, assigns them the Commercial Long (COTF-12) and Commercial Short (COTF-13) values from the current reporting period using GetFundData, then plots their difference as the net commercial position. The second parameter 0 requests the current reporting period; using 2 would request values from two weekly periods ago. ```EasyLanguage vars: CommLong(0), CommShort(0); CommLong = GetFundData("COTF-12",0); CommShort = GetFundData("COTF-13",0); Plot1(CommLong - CommShort, "Comm"); ``` -------------------------------- ### Macro command syntax: .macroname ;; Source: https://help.tradestation.com/10_00/eng/tradestationhelp/cl/macro_command_rules.htm Shows the general syntax for a macro command. Macro commands must be preceded with a period and multiple commands are separated by two semi-colons. ```plaintext .macroname ;; ``` -------------------------------- ### Back-testing strategy for Kagi charts Source: https://help.tradestation.com/10_00/eng/tradestationhelp/charting/advanced_chart_st_backtest_auto.htm Kagi chart strategy that also shows 100% profitability in back-testing by using the reversal amount (MinMove/PriceScale) to place stop orders and this bar close orders. ```EasyLanguage Buy next bar High + Minmove / PriceScale stop ; Sell short next bar Low - MinMove / PriceScale stop ; Sell this bar Close ; Buy to cover this bar Close ; ``` -------------------------------- ### Back-testing strategy for P&F, Renko, or Line Break charts Source: https://help.tradestation.com/10_00/eng/tradestationhelp/charting/advanced_chart_st_backtest_auto.htm Strategy for P&F, Renko, or Line Break charts that exploits the guaranteed bar direction and size to show 100% profitability in back-testing. Uses next bar stop orders and this bar close orders. ```EasyLanguage Sell short next bar low stop ; Buy to cover this bar close ; Buy next bar high stop ; Sell this bar close ; ``` -------------------------------- ### .MomentumBar Source: https://help.tradestation.com/10_00/eng/tradestationhelp/popup_commands/momentum_bar_command.htm Sets the size and interval for Momentum Bars. The command takes a range amount and an interval parameter. ```APIDOC ## .MomentumBar ### Description Sets the size for the Momentum Bars and the interval of the underlying data. ### Syntax `.MomentumBar ` ### Parameters - **** (string) - Required - Sets the size for the Momentum Bars. - **** (string) - Required - Interval of the underlying data. ### Example `.MomentumBar "2,1 min"` ``` -------------------------------- ### .ClosePosition Command Source: https://help.tradestation.com/10_00/eng/tradestationhelp/popup_commands/closeposition_command.htm Closes all open positions for a specified account and symbol. Use 'AllSymbols' or 'AllAccounts' to apply to all symbols or accounts. ```APIDOC ## .ClosePosition Command ### Description Closes all open positions for a specific account and symbol. Use the keyword 'AllSymbols' to close positions for all symbols, and 'AllAccounts' to close positions for all accounts. ### Syntax `.ClosePosition Symbol, Account Number` ### Parameters - **Symbol** (string) - Required - Specify the exact symbol or enter the keyword 'AllSymbols' (without quotes). - **Account Number** (string) - Required - Specify the exact account number or enter the keyword 'AllAccounts' (without quotes). ``` -------------------------------- ### .KaseBar Source: https://help.tradestation.com/10_00/eng/tradestationhelp/popup_commands/kasebar_command.htm Sets the True Range target value and interval for Kase Bars. ```APIDOC ## .KaseBar ### Description Sets the True Range target value and interval for Kase Bars. ### Syntax `.KaseBar ` ### Parameters - **** - Sets the True Range target value for the Kase Bars. - **** - Interval of the underlying data. ### Example `.KaseBar "2,1 min"` ``` -------------------------------- ### .ReversePosition Source: https://help.tradestation.com/10_00/eng/tradestationhelp/popup_commands/reverseposition_command.htm Reverses a position for a specified account and symbol, optionally applying a Bracket OSO template. ```APIDOC ## .ReversePosition ### Description A Command Line Command that allows you to reverse a position for a specific account and symbol with an optional Bracket OSO template parameter. This is used from a Hot Key macro or via EasyLanguage. ### Syntax `.ReversePosition _Symbol, Account Number,**OSO Template Name**_` ### Parameters - **Symbol** - Specify the exact symbol or enter the keyword `_AllSymbols_` in place of a specific symbol. - **Account Number** - Specify the exact account number or enter the keyword `_AllAccounts_` in place of an account number. - **OSO Template Name** - Optional. Specify the exact name of the OSO template (included in "Quotes"). ### Example In this example, replace the word SYMBOL with the symbol you want to use: `.ReversePosition SYMBOL, 1234567, "Exit - Brk - 1L/1S"` ``` -------------------------------- ### .LineBreak Source: https://help.tradestation.com/10_00/eng/tradestationhelp/popup_commands/linebreak_command.htm Sets the number of line breaks and the interval of the underlying data. The command takes two parameters: the number of line breaks and the interval. ```APIDOC ## .LineBreak ### Description Sets the number of line breaks and the interval of the underlying data. ### Syntax .LineBreak ### Parameters - **** - Sets the number of line breaks - **** - Interval of the underlying data ### Example .LineBreak "2, 1 min" ``` -------------------------------- ### .RangeBar Source: https://help.tradestation.com/10_00/eng/tradestationhelp/popup_commands/rangebar_command.htm Sets the size of Range Bars and the interval of the underlying data. ```APIDOC ## .RangeBar ### Description Sets the size of the Range Bars and the interval of the underlying data. ### Syntax `.RangeBar ` ### Parameters - **** - Sets the size of the Range Bars. - **** - Interval of the underlying data. ### Example `.RangeBar "2, 1min"` ``` -------------------------------- ### GetLastFundDataError Source: https://help.tradestation.com/10_00/eng/tradestationhelp/elanalysis/fundamental/about_fundamental_data_in_tradestation.htm Reserved word to return the error status from the last 'GetFund' call. A status of 0 indicates successful retrieval; non-zero values correspond to error codes in the help topic. ```APIDOC ## GetLastFundDataError ### Description Returns the error status from the last 'GetFund' call. A status of 0 indicates that the last data value was retrieved successfully. For all non-zero status values, compare the returned value with the error code list in the help topic to identify the error type. ### Reserved Word GetLastFundDataError ### Parameters None. ### Return Value Returns an error status code (integer). 0 indicates success. ### Example easylanguage // Example usage ``` -------------------------------- ### GetFundData Source: https://help.tradestation.com/10_00/eng/tradestationhelp/elanalysis/fundamental/cot_data_fields.htm Reads fundamental data of type Numeric. Use this function to retrieve numeric COT data fields such as COTF-12 (Commercial Long) and COTF-13 (Commercial Short). The second parameter specifies the reporting period offset (0 for current, 2 for two weeks ago). ```APIDOC ## GetFundData ### Description Reads fundamental data of type Numeric. Use this function to retrieve numeric COT data fields such as COTF-12 (Commercial Long) and COTF-13 (Commercial Short). The second parameter specifies the reporting period offset (0 for current, 2 for two weeks ago). ### Method Function ### Signature GetFundData(Name, Offset) ### Parameters - **Name** (string) - Required - The COT data field name (e.g., "COTF-12"). - **Offset** (numeric) - Required - The number of reporting periods back (0 for current, 2 for two weeks ago). ### Return Value Numeric value of the specified COT data field. ### Example ``` vars: CommLong(0), CommShort(0); CommLong = GetFundData("COTF-12",0); CommShort = GetFundData("COTF-13",0); Plot1(CommLong - CommShort, "Comm"); ``` ``` -------------------------------- ### GetFundDataAsString Source: https://help.tradestation.com/10_00/eng/tradestationhelp/elanalysis/fundamental/cot_data_fields.htm Reads fundamental data of type String. Use this function to retrieve string COT data fields such as COTF-1 (Market and Exchange Names) or COTF-5 (CFTC Market Code in Initials). ```APIDOC ## GetFundDataAsString ### Description Reads fundamental data of type String. Use this function to retrieve string COT data fields such as COTF-1 (Market and Exchange Names) or COTF-5 (CFTC Market Code in Initials). ### Method Function ### Signature GetFundDataAsString(Name, Offset) ### Parameters - **Name** (string) - Required - The COT data field name (e.g., "COTF-1"). - **Offset** (numeric) - Required - The number of reporting periods back (0 for current). ### Return Value String value of the specified COT data field. ``` -------------------------------- ### FundString Source: https://help.tradestation.com/10_00/eng/tradestationhelp/elanalysis/fundamental/about_fundamental_data_in_tradestation.htm Function to return a fundamental data value of string type. Requires declaring a variable and using output parameters. Supports access to fundamental fields from other data streams. ```APIDOC ## FundString ### Description Returns a fundamental data value of string type. Requires declaring a variable and using output parameters. Supports access to fundamental fields from other data streams. ### Function Signature FundString(...) ### Parameters - **variable** (output) - Required - Variable to receive the fundamental data value. - **fundamental field** - Required - The fundamental data field to retrieve. - **data stream** (optional) - Optional - Specify 'of Data2' to access fundamental fields from other data streams. ### Return Value Returns the fundamental data value and error status in one call. ### Example easylanguage // Example usage ``` -------------------------------- ### GetFundData Source: https://help.tradestation.com/10_00/eng/tradestationhelp/elanalysis/fundamental/about_fundamental_data_in_tradestation.htm Reserved word to retrieve a fundamental data value of numeric type for Data1. Can be used as input with Custom 1, 2, 3, and 4 Line indicators to directly display values in charts and grids. ```APIDOC ## GetFundData ### Description Retrieves a fundamental data value of numeric type for Data1. Can be used as input with Custom 1, 2, 3, and 4 Line indicators to directly display values in charts and grids. ### Reserved Word GetFundData ### Parameters - **fundamental field** - Required - The fundamental data field to retrieve. ### Return Value Returns the fundamental data value. ### Example easylanguage // Example usage ``` -------------------------------- ### COT Data Functions Source: https://help.tradestation.com/10_00/eng/tradestationhelp/elanalysis/fundamental/about_cot_data_in_tradestation.htm Functions that return COT data values and error status in one call. These require declaring a variable and using output parameters. ```APIDOC ## COT Data Functions ### Description Functions that return COT data values and error status in one call. These require declaring a variable and using output parameters. ### Functions - **fundvalue** - Returns a numeric COT data field value. - **fundstring** - Returns a string COT data field value. - **FundBoolean** - Returns a boolean COT data field value. - **funddate** - Returns the post date associated with a data field. - **FundPeriodEndDate** - Returns the period end date associated with a data field. ### Usage These functions can be used in EasyLanguage statements. They require declaring a variable and understanding output parameters. They allow access to fundamental fields from other data streams, such as 'of Data2'. ### Parameters - **variable** (output) - Required - The variable to receive the data value. - **errorStatus** (output) - Required - The variable to receive the error status. - **dataField** (input) - Required - The COT data field to retrieve. ### Example ```easylanguage // Example usage (pseudo-code) var: myValue(0), myError(0); fundvalue(myValue, myError, COTDataField); ``` ``` -------------------------------- ### GetFundAsString Source: https://help.tradestation.com/10_00/eng/tradestationhelp/elanalysis/fundamental/about_fundamental_data_in_tradestation.htm Reserved word to retrieve a fundamental data value of string type for Data1. Can be used as input with Custom 1, 2, 3, and 4 Line indicators to directly display values in charts and grids. ```APIDOC ## GetFundAsString ### Description Retrieves a fundamental data value of string type for Data1. Can be used as input with Custom 1, 2, 3, and 4 Line indicators to directly display values in charts and grids. ### Reserved Word GetFundAsString ### Parameters - **fundamental field** - Required - The fundamental data field to retrieve. ### Return Value Returns the fundamental data value. ### Example easylanguage // Example usage ``` -------------------------------- ### GetFundBoolean Source: https://help.tradestation.com/10_00/eng/tradestationhelp/elanalysis/fundamental/about_fundamental_data_in_tradestation.htm Reserved word to retrieve a fundamental data value of boolean type for Data1. Can be used as input with Custom 1, 2, 3, and 4 Line indicators to directly display values in charts and grids. ```APIDOC ## GetFundBoolean ### Description Retrieves a fundamental data value of boolean type for Data1. Can be used as input with Custom 1, 2, 3, and 4 Line indicators to directly display values in charts and grids. ### Reserved Word GetFundBoolean ### Parameters - **fundamental field** - Required - The fundamental data field to retrieve. ### Return Value Returns the fundamental data value. ### Example easylanguage // Example usage ``` -------------------------------- ### GetFundDataAsBoolean Source: https://help.tradestation.com/10_00/eng/tradestationhelp/elanalysis/fundamental/cot_data_fields.htm Reads fundamental data of type Boolean. Use this function to retrieve boolean COT data fields if any exist. The documentation indicates this function is available for boolean data types. ```APIDOC ## GetFundDataAsBoolean ### Description Reads fundamental data of type Boolean. Use this function to retrieve boolean COT data fields if any exist. The documentation indicates this function is available for boolean data types. ### Method Function ### Signature GetFundDataAsBoolean(Name, Offset) ### Parameters - **Name** (string) - Required - The COT data field name. - **Offset** (numeric) - Required - The number of reporting periods back (0 for current). ### Return Value Boolean value of the specified COT data field. ``` -------------------------------- ### FundBoolean Source: https://help.tradestation.com/10_00/eng/tradestationhelp/elanalysis/fundamental/about_fundamental_data_in_tradestation.htm Function to return a fundamental data value of boolean type. Requires declaring a variable and using output parameters. Supports access to fundamental fields from other data streams. ```APIDOC ## FundBoolean ### Description Returns a fundamental data value of boolean type. Requires declaring a variable and using output parameters. Supports access to fundamental fields from other data streams. ### Function Signature FundBoolean(...) ### Parameters - **variable** (output) - Required - Variable to receive the fundamental data value. - **fundamental field** - Required - The fundamental data field to retrieve. - **data stream** (optional) - Optional - Specify 'of Data2' to access fundamental fields from other data streams. ### Return Value Returns the fundamental data value and error status in one call. ### Example easylanguage // Example usage ``` -------------------------------- ### COT Data Reserved Words Source: https://help.tradestation.com/10_00/eng/tradestationhelp/elanalysis/fundamental/about_cot_data_in_tradestation.htm Reserved words that retrieve COT data values and error status for Data1. These can be used as inputs with Custom 1, 2, 3, and 4 Line indicators or in EasyLanguage statements. ```APIDOC ## COT Data Reserved Words ### Description Reserved words that retrieve COT data values and error status for Data1. These can be used as inputs with Custom 1, 2, 3, and 4 Line indicators or in EasyLanguage statements. ### Reserved Words - **getfunddata** - Returns a numeric COT data field value. - **getfundasstring** - Returns a string COT data field value. - **GetFundBoolean** - Returns a boolean COT data field value. - **getfundpostdate** - Returns the post date associated with a data field. - **GetFundPeriodEndDate** - Returns the period end date associated with a data field. - **GetLastFundDataError** - Returns the error status from the last 'GetFund' call. A status of 0 indicates success; non-zero values correspond to error codes in the help topic. ### Usage These reserved words can be used directly in EasyLanguage statements or as inputs with Custom 1, 2, 3, and 4 Line indicators. ### Parameters - **dataField** (input) - Required - The COT data field to retrieve. ### Return Values - **getfunddata** - Numeric value of the data field. - **getfundasstring** - String value of the data field. - **GetFundBoolean** - Boolean value of the data field. - **getfundpostdate** - Post date of the data field. - **GetFundPeriodEndDate** - Period end date of the data field. - **GetLastFundDataError** - Error status (0 for success, non-zero for error codes). ### Example ```easylanguage // Example usage (pseudo-code) value1 = getfunddata(COTDataField); value2 = GetLastFundDataError; ``` ``` -------------------------------- ### FundValue Source: https://help.tradestation.com/10_00/eng/tradestationhelp/elanalysis/fundamental/about_fundamental_data_in_tradestation.htm Function to return a fundamental data value of numeric type. Requires declaring a variable and using output parameters. Supports access to fundamental fields from other data streams. ```APIDOC ## FundValue ### Description Returns a fundamental data value of numeric type. Requires declaring a variable and using output parameters. Supports access to fundamental fields from other data streams. ### Function Signature FundValue(...) ### Parameters - **variable** (output) - Required - Variable to receive the fundamental data value. - **fundamental field** - Required - The fundamental data field to retrieve. - **data stream** (optional) - Optional - Specify 'of Data2' to access fundamental fields from other data streams. ### Return Value Returns the fundamental data value and error status in one call. ### Example easylanguage // Example usage ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.