Difference between revisions of "Buy"

From MultiCharts
Jump to navigation Jump to search
m (Reverted edits by 176.8.90.7 (talk) to last revision by 194.84.116.138)
Line 6: Line 6:
 
When a Buy order is filled, any open short positions will also be closed.  
 
When a Buy order is filled, any open short positions will also be closed.  
 
   
 
   
==== Usage ====
+
== Usage ==
<syntaxhighlight>Buy[("EntryLabel")][TradeSize]EntryType;</syntaxhighlight>  
+
<syntaxhighlight>Buy[("EntryLabel")] [TradeSize] EntryType;</syntaxhighlight>  
  
Parameters inside the square brackets are optional  
+
Parameters inside the square brackets are optional -if these aren't defined, the default is used.
  
==== Parameters ====
+
== Parameters ==
 +
:'''EntryLabel''' - an optional parameter; assigns a name that will be displayed in the name label below the entry, and can be used to identify the particular entry and to tie an exit to it.
 +
::An exit can only be tied to an entry within the same signal; for more information, see [[Sell]].
 +
::If '''EntryLabel''' is not specified, the name "Buy" will be used for the first entry, "Buy#2" for the second entry, "Buy#3" for the third entry, etc.
  
[[EntryLabel]] - an optional parameter; assigns a name that will be displayed in the name label below the entry, and can be used to identify the particular entry and to tie an exit to it.
+
:'''TradeSize''' - an optional parameter; a numerical expression, specifying the number of contracts or shares to buy; the expression must be followed by one of the following equivalent words: [[Share]], [[Shares]], [[Contract]] or [[Contracts]].
 +
::If '''TradeSize''' value equals 0 or is negative, a long position will not be entered but any open short positions will be closed.
 +
::If '''TradeSize''' is not specified, the trade size value set by the user in the Properties tab of the Strategy Properties window will be used.  
  
An exit can only be tied to an entry within the same signal; for more information, see [[Sell.]]
+
:'''EntryType''' - a required parameter; specifies the timing and price of entry.  
 
 
If [[EntryLabel]] is not specified, the name "Buy" will be used for the first entry, "Buy#2" for the second entry, "Buy#3" for the third entry, etc.
 
 
 
[[TradeSize]] - an optional parameter; a numerical expression, specifying the number of contracts or shares to buy; the expression must be followed by one of the following transposable words: [[Share, Shares, Contract]] or [[Contracts.]]
 
 
 
If [[TradeSize]] value equals 0 or is negative, a long position will not be entered but any open short positions will be closed.
 
 
 
If [[TradeSize]] is not specified, the trade size value set by the user in the Properties tab of the Strategy Properties window will be used.
 
 
 
[[EntryType]] - a required parameter; specifies the timing and price of entry.  
 
  
 +
== Entry types ==
 
There are four kinds of EntryType:  
 
There are four kinds of EntryType:  
  
<syntaxhighlight>This Bar[On]Close</syntaxhighlight>  
+
=== Enter this bar on close ==
 +
<syntaxhighlight>This Bar On Close</syntaxhighlight>  
  
Where: - [[On]] is a skip word and can be omitted
+
Where:  
 +
:'''On''' - is a [[:Category:Skip_Words|skip word]] and can be omitted.
  
 
A Buy Arrow will be placed at the current bar's [[Close]] tick.  
 
A Buy Arrow will be placed at the current bar's [[Close]] tick.  
  
<syntaxhighlight>Next Bar[At]Open or Next Bar[At]Market</syntaxhighlight>  
+
=== Buy next bar at open ===
 +
<syntaxhighlight>Next Bar At Open</syntaxhighlight
 +
or
 +
<syntaxhighlight>Next Bar At Market</syntaxhighlight>  
  
Where: - words [["Market"]] and [["Open"]] are transposable
+
Where:  
           
+
:Words '''"Market"''' and '''"Open"''' are interchangeable.
- [[At]] is a skip word and can be omitted
+
:'''At''' - is a [[:Category:Skip_Words|skip word]] and can be omitted.
  
 
A Buy Arrow will be placed at the next bar's [[Open]] tick.  
 
A Buy Arrow will be placed at the next bar's [[Open]] tick.  

Revision as of 15:29, 19 February 2012

Enters a long position as specified by the parameters. The entry point is visually indicated on a chart by an Arrow and a Tick. The Arrow identifies the time and the Tick identifies the price value of the entry point. Labels, displaying the entry name and the number of contracts or shares traded, are displayed below the Buy Arrow.

An order is executed at the point specified by the parameters; if the order is not filled within the specified bar, the order is cancelled.

When a Buy order is filled, any open short positions will also be closed.

Usage

Buy[("EntryLabel")] [TradeSize] EntryType;

Parameters inside the square brackets are optional -if these aren't defined, the default is used.

Parameters

EntryLabel - an optional parameter; assigns a name that will be displayed in the name label below the entry, and can be used to identify the particular entry and to tie an exit to it.
An exit can only be tied to an entry within the same signal; for more information, see Sell.
If EntryLabel is not specified, the name "Buy" will be used for the first entry, "Buy#2" for the second entry, "Buy#3" for the third entry, etc.
TradeSize - an optional parameter; a numerical expression, specifying the number of contracts or shares to buy; the expression must be followed by one of the following equivalent words: Share, Shares, Contract or Contracts.
If TradeSize value equals 0 or is negative, a long position will not be entered but any open short positions will be closed.
If TradeSize is not specified, the trade size value set by the user in the Properties tab of the Strategy Properties window will be used.
EntryType - a required parameter; specifies the timing and price of entry.

Entry types

There are four kinds of EntryType:

= Enter this bar on close

This Bar On Close

Where:

On - is a skip word and can be omitted.

A Buy Arrow will be placed at the current bar's Close tick.

Buy next bar at open

Next Bar At Open</syntaxhighlight
or
<syntaxhighlight>Next Bar At Market

Where:

Words "Market" and "Open" are interchangeable.
At - is a skip word and can be omitted.

A Buy Arrow will be placed at the next bar's Open tick.

Next Bar[At]Price  Limit

Where: - Price is a numerical expression, specifying the Limit Price

- At is a skip word and can be omitted

A Buy Arrow will be placed on the next bar at the first tick with a price value less than or equal to Price ; if there are no such ticks within the next bar, the order will be cancelled.

Next Bar[At]Price  Stop

Where: - Price is a numerical expression, specifying the Stop Price

- At is a skip word and can be omitted

A Buy Arrow will be placed on the next bar at the first tick with a price value equal to or greater than the Price ; if there are no such ticks within the next bar, the order will be cancelled.

Example

Buy a user-set number of shares at Market price on close of this bar:

Buy This Bar On Close;

Buy 1 share at Market price on open of next bar and label the entry "Entry":

Buy("Entry")1 Share Next Bar At Open;

Buy 1 contract at Market price on open of next bar and label the entry "Entry":

Buy("Entry")1 Contract Next Bar Market;

Buy 2 shares within the next bar on the first tick with a price of 100 or less:

Buy 2 Shares Next Bar At 100 Limit;

Buy 10 contracts within the next bar on the first tick with a price of 50 or more:

Buy 10 Contracts Next Bar 50 Stop;