Difference between revisions of "SetDollarTrailing"

From MultiCharts
Jump to navigation Jump to search
(Created page with "Closes out the entire position or the entry if the current profit is less than the maximum profit by the specified amount; generates the appropriate Stop order depending on wh...")
 
m
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Closes out the entire position or the entry if the current profit is less than the maximum profit by the specified amount; generates the appropriate Stop order depending on whether the position is long or short.
+
Closes out the entire position or the entry if the current profit is less than the maximum profit by the specified amount; generates the appropriate [[Stop]] order depending on whether the position is Long or Short.  
For example, if the specified ammount is $50 and the profit has reached the maximum of $120, the position will be closed once the profit drops to $70.  
 
  
[[SetStopPosition]] and [[SetStopContract]] or [[SetStopShare]] functions determine whether SetDollarTrailing will be applied to the entire position or to each contract or share individually; by default, SetDollarTrailing is applied to the entire position.
+
For example, if the specified amount is $50 and the profit has reached the maximum of $120, the position will be closed once the profit drops to $70.  
  
SetDollarTrailing function is evaluated intra-bar and not only on close of a bar, and can exit within the same bar as the entry.  
+
[[SetStopPosition]] and [[SetStopContract]] or [[SetStopShare]] functions determine whether '''SetDollarTrailing''' will be applied to the entire position or to each contract or share individually; by default, '''SetDollarTrailing''' is applied to the entire position.
 +
 
 +
<div style="background-color: #E3FBE5;margin-bottom:10px;">SetDollarTrailing function is evaluated intra-bar and not only on close of a bar, and can exit within the same bar as the entry.</div>
 
   
 
   
==== Usage ====
+
== Usage ==
 
<syntaxhighlight>SetDollarTrailing(Amount)</syntaxhighlight>  
 
<syntaxhighlight>SetDollarTrailing(Amount)</syntaxhighlight>  
  
Where: [[Amount]] - a numerical expression, specifying the currency value of the maximum loss of profit  
+
Where:  
 +
 
 +
:'''Amount''' - a numerical expression, specifying the currency value of the maximum loss of profit.
 
   
 
   
==== Notes ====  
+
== Notes ==
This function can only be used in signals.  
+
* This function can only be used in signals.
 +
* Use [[SetPercentTrailing]] to set a percentage trailing stop loss.
 
   
 
   
==== Example ====
+
== Examples ==
<syntaxhighlight>Generate an exit order for the entire position if position profit drops by $50:  
+
Generate an exit order for the entire position if position profit drops by $50:  
  
SetStopPosition;  
+
<syntaxhighlight>SetStopPosition;  
  
SetDollarTrailing(50);  
+
SetDollarTrailing(50);</syntaxhighlight>
  
 
Generate an exit order for the entry if per contract profit drops by $10:  
 
Generate an exit order for the entry if per contract profit drops by $10:  
  
SetStopContract;  
+
<syntaxhighlight>SetStopContract;  
  
 
SetDollarTrailing(10);</syntaxhighlight>  
 
SetDollarTrailing(10);</syntaxhighlight>  
 
   
 
   
 
[[Category:Strategy Orders]]
 
[[Category:Strategy Orders]]

Latest revision as of 16:46, 19 February 2012

Closes out the entire position or the entry if the current profit is less than the maximum profit by the specified amount; generates the appropriate Stop order depending on whether the position is Long or Short.

For example, if the specified amount is $50 and the profit has reached the maximum of $120, the position will be closed once the profit drops to $70.

SetStopPosition and SetStopContract or SetStopShare functions determine whether SetDollarTrailing will be applied to the entire position or to each contract or share individually; by default, SetDollarTrailing is applied to the entire position.

SetDollarTrailing function is evaluated intra-bar and not only on close of a bar, and can exit within the same bar as the entry.

Usage

SetDollarTrailing(Amount)

Where:

Amount - a numerical expression, specifying the currency value of the maximum loss of profit.

Notes

  • This function can only be used in signals.
  • Use SetPercentTrailing to set a percentage trailing stop loss.

Examples

Generate an exit order for the entire position if position profit drops by $50:

SetStopPosition; 

SetDollarTrailing(50);

Generate an exit order for the entry if per contract profit drops by $10:

SetStopContract; 

SetDollarTrailing(10);