Difference between revisions of "SetStopLoss"

From MultiCharts
Jump to navigation Jump to search
(Created page with "Closes out the entire position or the entry if the loss reaches the specified currency value; generates the appropriate Stop order depending on whether the position is long or...")
 
Line 14: Line 14:
 
   
 
   
 
==== Example ====
 
==== Example ====
<syntaxhighlight>Generate an exit order for the entire position if the position loss reaches $100:  
+
Generate an exit order for the entire position if the position loss reaches $100:  
  
SetStopPosition;  
+
<syntaxhighlight>SetStopPosition;  
  
SetStopLoss(100);  
+
SetStopLoss(100);</syntaxhighlight>
  
  
 
Generate an exit order for the entry if the loss per contract reaches $10:  
 
Generate an exit order for the entry if the loss per contract reaches $10:  
  
SetStopContract;  
+
<syntaxhighlight>SetStopContract;  
  
 
SetStopLoss(10);</syntaxhighlight>  
 
SetStopLoss(10);</syntaxhighlight>  
 
   
 
   
 
[[Category:Strategy Orders]]
 
[[Category:Strategy Orders]]

Revision as of 12:36, 27 January 2012

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

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

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

Usage

SetStopLoss(Amount)

Where: Amount - a numerical expression, specifying the stop loss amount

Notes

This function can only be used in signals.

Example

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

SetStopPosition; 

SetStopLoss(100);


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

SetStopContract; 

SetStopLoss(10);