Difference between revisions of "SetProfitTarget"

From MultiCharts
Jump to navigation Jump to search
Line 1: Line 1:
Closes out the entire position or the entry if profit reaches the specified currency value; generates the appropriate Limit exit order depending on whether the position is long or short.  
+
Closes out the entire position or the entry if profit reaches the specified currency value; generates the appropriate [[Limit]] exit order depending on whether the position is long or short.  
  
[[SetStopPosition]] and [[SetStopContract]] or [[SetStopShare]] functions determine whether the profit target will be applied to the entire position or to each contract or share individualy; by default, profit target is applied to the entire position.
+
[[SetStopPosition]] and [[SetStopContract]] or [[SetStopShare]] functions determine whether the profit target will be applied to the entire position or to each contract or share individually; by default, profit target is applied to the '''entire''' position.
  
SetProfitTarget function is evaluated intra-bar and not only on close of a bar, and can exit within the same bar as the entry.  
+
<div style="background-color: #C1FFC1;margin-bottom:10px;">The SetProfitTarget 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>SetProfitTarget(Amount)</syntaxhighlight>  
 
<syntaxhighlight>SetProfitTarget(Amount)</syntaxhighlight>  
  
Where: [[Amount]] - a numerical expression, specifying the profit target amount  
+
Where:  
 +
 
 +
:'''Amount''' - a numerical expression, specifying the profit target amount.
 
   
 
   
==== Notes ====  
+
== Notes ==
This function can only be used in signals.  
+
* This function can only be used in signals.
 +
* Use [[SetStopLoss]] to set a stop-loss for a position.
 +
* Use [[SetPercentTrailing]] to set a percentage trailing stop loss, or use [[SetDollarTrailing]] for a fixed-amount currency trailing stop.
 
   
 
   
==== Example ====
+
== Examples ==
 
Generate an exit order for the entire position if the position profit reaches $100:  
 
Generate an exit order for the entire position if the position profit reaches $100:  
  
Line 19: Line 23:
  
 
SetProfitTarget(100);</syntaxhighlight>  
 
SetProfitTarget(100);</syntaxhighlight>  
 
  
 
Generate an exit order for the entry if the profit per contract reaches $10:  
 
Generate an exit order for the entry if the profit per contract reaches $10:  
Line 27: Line 30:
 
SetProfitTarget(10);</syntaxhighlight>  
 
SetProfitTarget(10);</syntaxhighlight>  
 
   
 
   
 
 
 
[[Category:Strategy Orders]]
 
[[Category:Strategy Orders]]

Revision as of 16:34, 19 February 2012

Closes out the entire position or the entry if profit reaches the specified currency value; generates the appropriate Limit exit order depending on whether the position is long or short.

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

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

Usage

SetProfitTarget(Amount)

Where:

Amount - a numerical expression, specifying the profit target amount.

Notes

Examples

Generate an exit order for the entire position if the position profit reaches $100:

SetStopPosition; 

SetProfitTarget(100);

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

SetStopContract; 

SetProfitTarget(10);