https://www.multicharts.com/trading-software/api.php?action=feedcontributions&user=194.84.116.138&feedformat=atomMultiCharts - User contributions [en]2024-03-29T06:33:21ZUser contributionsMediaWiki 1.33.0https://www.multicharts.com/trading-software/index.php?title=GetUserName&diff=1610GetUserName2012-01-31T13:15:43Z<p>194.84.116.138: Created page with "Returns MultiCharts registration name (UserName) for MultiCharts installation on the PC that the study is being run on. UserName is used for study protection. ==== Usage ..."</p>
<hr />
<div>Returns MultiCharts registration name (UserName) for MultiCharts installation on the PC that the study is being run on. <br />
<br />
UserName is used for study protection. <br />
<br />
==== Usage ====<br />
<syntaxhighlight>GetUserName</syntaxhighlight> <br />
<br />
==== Example ====<br />
Assign a value, indicating the UserName, to UserName variable: <br />
<br />
<syntaxhighlight>var: UserName("");<br />
UserName = getUserName;</syntaxhighlight><br />
<br />
<br />
[[Category:Environment Information]]</div>194.84.116.138https://www.multicharts.com/trading-software/index.php?title=TL_SetEnd&diff=1400TL SetEnd2012-01-27T13:20:07Z<p>194.84.116.138: /* Example */</p>
<hr />
<div>Modifies the ending point location of a trendline with the specified ID number; returns a value of 0 if the ending point location was successfully modified, and a value of -2 if the specified trendline ID number is invalid. <br />
<br />
Of the two end points of a trendline, the point with the later date and time is always considered to be the ending point; if the trendline is vertical, the point with the higher price value is considered to be the ending point. <br />
<br />
==== Usage ====<br />
<syntaxhighlight>TL_SetEnd (TL_ID, eDate, eTime, ePriceValue)</syntaxhighlight> <br />
<br />
==== Parameters ====<br />
[[TL_ID]] - a numerical expression specifying the trendline ID number <br />
<br />
[[eDate]] - a numerical expression specifying the new ending point date; the date is indicated in the YYYMMdd format, where YYY is the number of years since 1900, MM is the month, and dd is the day of the month <br />
<br />
[[eTime]] - a numerical expression specifying the new ending point time; the time is indicated in the 24-hour HHmm format, where 1300 = 1:00 PM <br />
<br />
[[ePriceValue]] - a numerical expression specifying the new ending point price value (vertical position, corresponding to a value on the price scale of a chart) <br />
<br />
==== Notes ====<br />
A trendline-specific ID number is returned by [[TL_New]] when the trendline is created. <br />
<br />
==== Example ====<br />
Move the ending point of the trendline with an ID number of 3 to 14:15 PM on January 17th at a <br />
price value of 1350: <br />
<br />
<syntaxhighlight>Value1=TL_SetEnd(3,1080117,1415,1350);</syntaxhighlight> <br />
<br />
[[Category:Trendline Drawing]]</div>194.84.116.138https://www.multicharts.com/trading-software/index.php?title=TL_SetEnd_s&diff=1399TL SetEnd s2012-01-27T13:19:59Z<p>194.84.116.138: /* Example */</p>
<hr />
<div>Modifies the ending point location of a trendline with the specified ID number; returns a value of 0 if the ending point location was successfully modified, and a value of -2 if the specified trendline ID number is invalid. <br />
<br />
Of the two end points of a trendline, the point with the later date and time is always considered to be the ending point; if the trendline is vertical, the point with the higher price value is considered to be the ending point. <br />
<br />
==== Usage ====<br />
<syntaxhighlight>TL_SetEnd_s (TL_ID, eDate, eTime_s, ePriceValue)</syntaxhighlight> <br />
<br />
==== Parameters ==== <br />
[[TL_ID]] - a numerical expression specifying the trendline ID number <br />
<br />
[[eDate]] - a numerical expression specifying the new ending point date; the date is indicated in the YYYMMdd format, where YYY is the number of years since 1900, MM is the month, and dd is the day of the month <br />
<br />
[[eTime_s]] - a numerical expression specifying the new ending point time, including seconds; the time is indicated in the 24-hour HHmmss format, where 130000 = 1:00:00 PM <br />
<br />
[[ePriceValue]] - a numerical expression specifying the new ending point price value (vertical position, corresponding to a value on the price scale of a chart) <br />
<br />
==== Notes ==== <br />
A trendline-specific ID number is returned by [[TL_New_s]] when the trendline is created. <br />
<br />
==== Example ====<br />
Move the ending point of the trendline with an ID number of 3 to 14:15:00 PM on January 17th at a <br />
price value of 1350: <br />
<br />
<syntaxhighlight>Value1=TL_SetEnd_s(3,1080117,141500,1350);</syntaxhighlight> <br />
<br />
[[Category:Trendline Drawing]]</div>194.84.116.138https://www.multicharts.com/trading-software/index.php?title=TL_SetBegin_s&diff=1398TL SetBegin s2012-01-27T13:19:15Z<p>194.84.116.138: /* Example */</p>
<hr />
<div>Modifies the starting point location of a trendline with the specified ID number; returns a value of 0 if the starting point location was successfully modified, and a value of -2 if the specified trendline ID number is invalid. <br />
<br />
Of the two end points of a trendline, the point with the earlier date and time is always considered to be the starting point; if the trendline is vertical, the point with the lower price value is considered to be the starting point. <br />
<br />
==== Usage ====<br />
<syntaxhighlight>TL_SetBegin_s (TL_ID, sDate, sTime_s, sPriceValue)</syntaxhighlight> <br />
<br />
==== Parameters ==== <br />
[[TL_ID]] - a numerical expression specifying the trendline ID number <br />
<br />
[[sDate]] - a numerical expression specifying the new starting point date; the date is indicated in the YYYMMdd format, where YYY is the number of years since 1900, MM is the month, and dd is the day of the month <br />
<br />
[[sTime_s]] - a numerical expression specifying the new starting point time, including seconds; the time is indicated in the 24-hour HHmmss format, where 130000 = 1:00:00 PM <br />
<br />
[[sPriceValue]] - a numerical expression specifying the new starting point price value (vertical position, corresponding to a value on the price scale of a chart) <br />
<br />
==== Notes ==== <br />
A trendline-specific ID number is returned by [[TL_New_s]] when the trendline is created. <br />
<br />
==== Example ====<br />
Move the starting point of the trendline with an ID number of 3 to 10:00:00 AM on January 17th at a <br />
price value of 1365: <br />
<br />
<syntaxhighlight>Value1=TL_SetBegin_s(3,1080117,100000,1365);</syntaxhighlight> <br />
<br />
[[Category:Trendline Drawing]]</div>194.84.116.138https://www.multicharts.com/trading-software/index.php?title=TL_New_self&diff=1397TL New self2012-01-27T13:18:24Z<p>194.84.116.138: /* Example */</p>
<hr />
<div>Displays a trendline, with the specified starting and ending points, on the SubChart containing the study; returns a trendline-specific ID number, required to modify the trendline. <br />
<br />
==== Usage ====<br />
<syntaxhighlight>TL_New_self (sDate, sTime, sPriceValue, eDate, eTime, ePriceValue)</syntaxhighlight> <br />
<br />
==== Parameters ==== <br />
[[sDate]] - a numerical expression specifying the trendline starting point date; the date is indicated in the YYYMMdd format, where YYY is the number of years since 1900, MM is the month, and dd is the day of the month <br />
<br />
[[sTime]] - a numerical expression specifying the trendline starting point time; the time is indicated in the 24-hour HHmm format, where 1300 = 1:00 PM <br />
<br />
[[sPriceValue]] - a numerical expression specifying the trendline starting point price value (vertical position, corresponding to a value on the price scale of a chart) <br />
<br />
[[eDate]] - a numerical expression specifying the trendline ending point date <br />
<br />
[[eTime]] - a numerical expression specifying the trendline ending point time <br />
<br />
[[ePriceValue]] - a numerical expression specifying the trendline ending point price value <br />
<br />
==== Example ====<br />
Display a trendline, that begins at 9:00 AM at a price value of 1381, and ends at 3:00 PM at a price <br />
value of 1337, on January 17th, 2008, on the SubChart containing the study:<br />
<br />
<syntaxhighlight>Value1=TL_New_self(1080117,900,1381,1080117,1500,1337);</syntaxhighlight> <br />
<br />
[[Category:Trendline Drawing]]</div>194.84.116.138https://www.multicharts.com/trading-software/index.php?title=TL_SetBegin&diff=1396TL SetBegin2012-01-27T13:18:11Z<p>194.84.116.138: /* Example */</p>
<hr />
<div>Modifies the starting point location of a trendline with the specified ID number; returns a value of 0 if the starting point location was successfully modified, and a value of -2 if the specified trendline ID number is invalid. <br />
<br />
Of the two end points of a trendline, the point with the earlier date and time is always considered to be the starting point; if the trendline is vertical, the point with the lower price value is considered to be the starting point. <br />
<br />
==== Usage ====<br />
<syntaxhighlight>TL_SetBegin (TL_ID, sDate, sTime, sPriceValue)</syntaxhighlight> <br />
<br />
==== Parameters ==== <br />
[[TL_ID]] - a numerical expression specifying the trendline ID number <br />
<br />
[[sDate]] - a numerical expression specifying the new starting point date; the date is indicated in the YYYMMdd format, where YYY is the number of years since 1900, MM is the month, and dd is the day of the month <br />
<br />
[[sTime]] - a numerical expression specifying the new starting point time; the time is indicated in the 24-hour HHmm format, where 1300 = 1:00 PM <br />
<br />
[[sPriceValue]] - a numerical expression specifying the new starting point price value (vertical position, corresponding to a value on the price scale of a chart) <br />
<br />
==== Notes ==== <br />
A trendline-specific ID number is returned by [[TL_New]] when the trendline is created. <br />
<br />
==== Example ====<br />
Move the starting point of the trendline with an ID number of 3 to 10:00 AM on January 17th at a <br />
price value of 1365: <br />
<br />
<syntaxhighlight>Value1=TL_SetBegin(3,1080117,1000,1365);</syntaxhighlight> <br />
<br />
<br />
<br />
[[Category:Trendline Drawing]]</div>194.84.116.138https://www.multicharts.com/trading-software/index.php?title=TL_SetAlert&diff=1395TL SetAlert2012-01-27T13:17:33Z<p>194.84.116.138: /* Example */</p>
<hr />
<div>Sets the alert status for a trendline with the specified ID number; returns a value of 0 if alert status was successfully modified, and a value of -2 if the specified trendline ID number is invalid. <br />
<br />
==== Usage ====<br />
<syntaxhighlight>TL_SetAlert(TL_ID,AlertStatus)</syntaxhighlight> <br />
<br />
==== Parameters ==== <br />
[[TL_ID]] - a numerical expression specifying the trendline ID number<br />
<br />
[[AlertStatus]] - a numerical expression specifying the alert status for the trendline: <br />
<br />
0 - Alert disabled<br />
<br />
1 - Breakout intra-bar <br />
<br />
An alert is triggered if the High crosses over the trendline or the Low crosses under the trendline. Alert triggering conditions are evaluated intra-bar.<br />
<br />
2 - Breakout on close <br />
<br />
An alert is triggered if the Close of the previous bar was below the trendline and the Close of the current bar is above the trendline, or if the Close of the previous bar was above the trendline and the Close of the current bar is below the trendline. Alert triggering conditions are evaluated at Close of a bar. <br />
<br />
==== Notes ==== <br />
A trendline-specific ID number is returned by [[TL_New]] when the trendline is created. <br />
<br />
==== Example ====<br />
Set alert status to "Breakout on close" for a trendline with the ID number of 3: <br />
<br />
<syntaxhighlight>Value1=TL_SetAlert(3,2);</syntaxhighlight><br />
<br />
[[Category:Trendline Drawing]]</div>194.84.116.138https://www.multicharts.com/trading-software/index.php?title=TL_New_Self_s&diff=1394TL New Self s2012-01-27T13:16:46Z<p>194.84.116.138: /* Example */</p>
<hr />
<div>Displays a trendline, with the specified starting and ending points, on the SubChart containing the study; returns a trendline-specific ID number, required to modify the trendline. <br />
<br />
==== Usage ====<br />
<syntaxhighlight>TL_New_s (sDate, sTime_s, sPriceValue, eDate, eTime_s, ePriceValue)</syntaxhighlight> <br />
<br />
==== Parameters ====<br />
[[sDate]] - a numerical expression specifying the trendline starting point date; the date is indicated in the YYYMMdd format, where YYY is the number of years since 1900, MM is the month, and dd is the day of the month <br />
<br />
[[sTime_s]] - a numerical expression specifying the trendline starting point time, including seconds; the time is indicated in the 24-hour HHmmss format, where 130000 = 1:00:00 PM <br />
<br />
[[sPriceValue]] - a numerical expression specifying the trendline starting point price value (vertical position, corresponding to a value on the price scale of a chart) <br />
<br />
[[eDate]] - a numerical expression specifying the trendline ending point date <br />
<br />
[[eTime_s]] - a numerical expression specifying the trendline ending point time, including seconds <br />
<br />
[[ePriceValue]] - a numerical expression specifying the trendline ending point price value <br />
<br />
==== Example ====<br />
Display a trendline, that begins at 9:00:00 AM at a price value of 1381, and ends at 3:00:00 PM at a <br />
price value of 1337, on January 17th, 2008, on the SubChart containing the study: <br />
<br />
<syntaxhighlight>Value1=TL_New_s(1080117,90000,1381,1080117,150000,1337);</syntaxhighlight> <br />
<br />
[[Category:Trendline Drawing]]</div>194.84.116.138https://www.multicharts.com/trading-software/index.php?title=Spaces&diff=1393Spaces2012-01-27T13:11:04Z<p>194.84.116.138: /* Example */</p>
<hr />
<div>Returns a string expression consisting of a specified number of spaces. <br />
<br />
==== Usage ====<br />
<syntaxhighlight>Spaces(Num)</syntaxhighlight> <br />
<br />
Where: [[Num]] - a numerical expression specifying the number of spaces <br />
<br />
==== Example ====<br />
The example inserts two blank spaces between the letters "a" and "b":<br />
<br />
<br />
<syntaxhighlight>Print("a"+Spaces(2)+"b");</syntaxhighlight><br />
<br />
<br />
[[Category:Text Manipulation]]</div>194.84.116.138https://www.multicharts.com/trading-software/index.php?title=PosTradeExitCategory&diff=1389PosTradeExitCategory2012-01-27T12:57:05Z<p>194.84.116.138: </p>
<hr />
<div>Returns an absolute numerical value, indicating trade exit order category. <br />
<br />
The following types are possible: <br />
<br />
1 = Stop order (buy next bar at close - 1 point stop) <br />
<br />
2 = Limit order (buy next bar at close + 1 point limit) <br />
<br />
3 = Market order (buy next bar market) <br />
<br />
4 = Market at Close order (buy this bar at close) <br />
<br />
5 = Market at Open order (buy next bar open) <br />
<br />
8 = StopLimit order (buy 1 contracts next bar at close - 2 point stop close + 2 point limit) <br />
<br />
==== Usage ====<br />
<syntaxhighlight>PosTradeExitCategory(PosAgo,TradeNumber)</syntaxhighlight> <br />
<br />
Where: [[PosAgo]] - a numerical expression, specifying the position: <br />
<br />
[[0]] - open position; <br />
<br />
[[1]] - one position back (the last position closed); <br />
<br />
[[2]] - two positions back, etc. <br />
<br />
[[TradeNumber]] - a numerical expression, specifying the number of trade (zero-based). <br />
<br />
==== Notes ==== <br />
This function can only be used in signals. <br />
<br />
To retrieve the total number of trades in specified position use [[PosTradeCount]] <br />
<br />
==== Example ==== <br />
<syntaxhighlight>PosTradeExitCategory(0,1) will return a value of 3 for the second trade of the open position, <br />
if the closing order type was Market Order.</syntaxhighlight> <br />
<br />
[[Category:Strategy Position Trades]]</div>194.84.116.138https://www.multicharts.com/trading-software/index.php?title=PosTradeEntryCategory&diff=1388PosTradeEntryCategory2012-01-27T12:55:06Z<p>194.84.116.138: </p>
<hr />
<div>Returns an absolute numerical value, indicating trade entry order category. <br />
<br />
The following types are possible: <br />
<br />
1 = Stop order (buy next bar at close - 1 point stop) <br />
<br />
2 = Limit order (buy next bar at close + 1 point limit) <br />
<br />
3 = Market order (buy next bar market) <br />
<br />
4 = Market at Close order (buy this bar at close) <br />
<br />
5 = Market at Open order (buy next bar open) <br />
<br />
8 = StopLimit order (buy 1 contracts next bar at close - 2 point stop close + 2 point limit) <br />
<br />
==== Usage ====<br />
<syntaxhighlight>PosTradeEntryCategory(PosAgo,TradeNumber)</syntaxhighlight> <br />
<br />
Where: [[PosAgo]] - a numerical expression, specifying the position: <br />
<br />
[[0]] - open position; <br />
<br />
[[1]] - one position back (the last position closed); <br />
<br />
[[2]] - two positions back, etc. <br />
<br />
[[TradeNumber]] - a numerical expression, specifying the number of trade (zero-based). <br />
<br />
==== Notes ==== <br />
This function can only be used in signals. <br />
<br />
To retrieve the total number of trades in specified position use [[PosTradeCount]] <br />
<br />
==== Example ==== <br />
<syntaxhighlight>PosTradeEntryCategory(0,1) will return a value of 1 for the second trade of the open position, <br />
if the order type was Stop Order.</syntaxhighlight> <br />
<br />
[[Category:Strategy Position Trades]]</div>194.84.116.138https://www.multicharts.com/trading-software/index.php?title=AvgEntryPrice_at_Broker_for_The_Strategy&diff=1383AvgEntryPrice at Broker for The Strategy2012-01-27T12:45:06Z<p>194.84.116.138: </p>
<hr />
<div>Returns a numerical value, indicating the average entry price at the broker for the strategy. <br />
A positive value indicates a long position and a negative value indicates a short position. <br />
<br />
A zero ('0') is returned when the current position is flat, or if Automated Trading is not turned on. <br />
<br />
==== Usage ====<br />
<syntaxhighlight>AvgEntryPrice_at_Broker_for_The_Strategy</syntaxhighlight> <br />
<br />
==== Notes ==== <br />
This function can only be used in signals and functions. <br />
<br />
==== Important ==== <br />
If Automated Trading was manually turned off by the user, the value returned by the keyword stops changing, and may remain unequal to '0'. <br />
<br />
==== Example ==== <br />
<br />
<br />
[[Category:Strategy Performance]]</div>194.84.116.138https://www.multicharts.com/trading-software/index.php?title=AvgEntryPrice_at_Broker&diff=1382AvgEntryPrice at Broker2012-01-27T12:43:35Z<p>194.84.116.138: </p>
<hr />
<div>Returns a numerical value, indicating the average entry price at the broker for the symbol. <br />
<br />
A positive value indicates a long position and a negative value indicates a short position. <br />
<br />
A zero ('0') is returned when the current position is flat, or if Automated Trading is not turned on. <br />
<br />
==== Usage ====<br />
<syntaxhighlight>AvgEntryPrice_at_Broker</syntaxhighlight> <br />
<br />
==== Notes ====<br />
This function can only be used in signals and functions. <br />
<br />
This function can only be used with Interactive Brokers, Patsystems, and Zen-Fire. <br />
<br />
==== Important ==== <br />
If Automated Trading was manually turned off by the user, the value returned by the keyword stops changing, and may remain unequal to '0'. <br />
<br />
==== Example ==== <br />
<br />
[[Category:Strategy Performance]]</div>194.84.116.138https://www.multicharts.com/trading-software/index.php?title=Total&diff=1380Total2012-01-27T12:38:41Z<p>194.84.116.138: /* Example */</p>
<hr />
<div>Used in strategy exit statements, following a numerical expression and the words [[Shares]] or [[Contracts,]] to indicate that only the number of contracts or shares specified by the numerical expression is to be sold or covered in total, regardless of the number of open entries. The contracts or shares will be sold or covered in the same order they were bought or shorted: First In, First Out. <br />
<br />
If the word [[Total]] is not used, the number of contracts or shares specified by the numerical expression will be sold or covered for each one of the open entries. <br />
<br />
==== Usage ====<br />
<syntaxhighlight>TradeSize Shares Total</syntaxhighlight> <br />
<br />
Where: [[TradeSize]] - a numerical expression, specifying the number of shares or contracts <br />
<br />
==== Example ====<br />
Sell a total of 2 contracts, regardless of the number of open long entries, at Market price on open <br />
of next bar: <br />
<br />
<syntaxhighlight>Sell 2 Contracts Total Next Bar At Market;</syntaxhighlight><br />
<br />
[[Category:Strategy Orders]]</div>194.84.116.138https://www.multicharts.com/trading-software/index.php?title=Stop&diff=1379Stop2012-01-27T12:38:11Z<p>194.84.116.138: /* Example */</p>
<hr />
<div>Used in strategy entry or exit statements to specify a Stop price for an entry or an exit. <br />
A Stop order will execute at the specified price or worse. A worse price is a higher price for Buy and Buy to cover orders, and a lower price for Sell and Sell short orders. <br />
<br />
==== Usage ====<br />
<syntaxhighlight>At Price Stop</syntaxhighlight> <br />
<br />
Where: [[Price]] - a numerical expression, specifying the Limit Price <br />
<br />
[[At]] - a skip word and can be omitted <br />
<br />
==== Example ====<br />
Sell within the next bar on the first tick with a price of 100 or less: <br />
<br />
<syntaxhighlight>Sell Next Bar 100 Stop;</syntaxhighlight> <br />
<br />
<br />
Cover within the next bar on the first tick with a price of 50 or more: <br />
<br />
<syntaxhighlight>BuyToCover Next Bar At 50 Stop;</syntaxhighlight> <br />
<br />
[[Category:Strategy Orders]]</div>194.84.116.138https://www.multicharts.com/trading-software/index.php?title=Shares&diff=1378Shares2012-01-27T12:37:54Z<p>194.84.116.138: /* Example */</p>
<hr />
<div>Used in strategy entry or exit statements in combination with a numerical expression to specify the number of shares or contracts to trade. <br />
<br />
==== Usage ====<br />
<syntaxhighlight>TradeSize Shares</syntaxhighlight> <br />
<br />
Where: [[TradeSize]] - a numerical expression, specifying the number of shares or contracts <br />
<br />
==== Example ====<br />
Buy 2 shares at Market price on open of next bar: <br />
<br />
<syntaxhighlight>Buy 2 Shares Next Bar At Market;</syntaxhighlight> <br />
<br />
[[Category:Strategy Orders]]</div>194.84.116.138https://www.multicharts.com/trading-software/index.php?title=SetStopPosition&diff=1377SetStopPosition2012-01-27T12:37:05Z<p>194.84.116.138: /* Example */</p>
<hr />
<div>Forces the built-in strategy exit functions to be applied on the entire position basis. <br />
<br />
The built-in strategy exit functions are: [[SetStopLoss , SetProfitTarget , SetBreakEven , SetDollarTrailing ,]] and [[SetPercentTrailing.]] <br />
<br />
==== Usage ====<br />
<syntaxhighlight>SetStopPosition</syntaxhighlight> <br />
<br />
==== Notes ==== <br />
If [[SetStopPositon, SetStopContract,]] and [[SetStopShare]] were not used, the exit functions will be applied on the entire position basis as a default. <br />
<br />
If [[SetStopPositon, SetStopContract,]] and [[SetStopShare]] were used in multiple instances or in different signals applied to the same chart, the last instance will be controlling. <br />
<br />
==== Example ====<br />
Force SetStopLoss strategy exit function to be applied on the entire position basis: <br />
<br />
<syntaxhighlight>SetStopPosition; <br />
<br />
SetStopLoss(100);</syntaxhighlight> <br />
<br />
An exit order for the entire position will be generated if the position loss reaches $100.<br />
<br />
<br />
[[Category:Strategy Orders]]</div>194.84.116.138https://www.multicharts.com/trading-software/index.php?title=SetStopLoss&diff=1376SetStopLoss2012-01-27T12:36:49Z<p>194.84.116.138: /* Example */</p>
<hr />
<div>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. <br />
<br />
[[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. <br />
<br />
SetStopLoss function is evaluated intra-bar and not only on close of a bar, and can exit within the same bar as the entry. <br />
<br />
==== Usage ====<br />
<syntaxhighlight>SetStopLoss(Amount)</syntaxhighlight> <br />
<br />
Where: [[Amount]] - a numerical expression, specifying the stop loss amount <br />
<br />
==== Notes ==== <br />
This function can only be used in signals. <br />
<br />
==== Example ====<br />
Generate an exit order for the entire position if the position loss reaches $100: <br />
<br />
<syntaxhighlight>SetStopPosition; <br />
<br />
SetStopLoss(100);</syntaxhighlight> <br />
<br />
<br />
Generate an exit order for the entry if the loss per contract reaches $10: <br />
<br />
<syntaxhighlight>SetStopContract; <br />
<br />
SetStopLoss(10);</syntaxhighlight> <br />
<br />
[[Category:Strategy Orders]]</div>194.84.116.138https://www.multicharts.com/trading-software/index.php?title=SetStopContract&diff=1375SetStopContract2012-01-27T12:36:06Z<p>194.84.116.138: /* Example */</p>
<hr />
<div>Forces the built-in strategy exit functions to be applied on per contract or share basis. <br />
The built-in strategy exit functions are: [[SetStopLoss , SetProfitTarget , SetBreakEven , SetDollarTrailing ,]] and [[SetPercentTrailing.]] <br />
<br />
==== Usage ====<br />
<syntaxhighlight>SetStopContract</syntaxhighlight> <br />
<br />
==== Notes ==== <br />
If [[SetStopPositon, SetStopContract,]] and [[SetStopShare]] were not used, the exit functions will be applied on the entire position basis as a default. <br />
<br />
[[If SetStopPositon, SetStopContract,]] and [[SetStopShare]] were used in multiple instances or in different signals applied to the same chart, the last instance will be controlling. <br />
<br />
==== Example ====<br />
Force the SetStopLoss strategy exit function to be applied on per contract basis: <br />
<br />
<br />
<syntaxhighlight>SetStopContract; <br />
<br />
SetStopLoss(10);</syntaxhighlight> <br />
<br />
<br />
An exit order for the entry will be generated if the loss per contract reaches $10. <br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
[[Category:Strategy Orders]]</div>194.84.116.138https://www.multicharts.com/trading-software/index.php?title=SetProfitTarget&diff=1374SetProfitTarget2012-01-27T12:35:29Z<p>194.84.116.138: /* Example */</p>
<hr />
<div>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. <br />
<br />
[[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.<br />
<br />
SetProfitTarget function is evaluated intra-bar and not only on close of a bar, and can exit within the same bar as the entry. <br />
<br />
==== Usage ====<br />
<syntaxhighlight>SetProfitTarget(Amount)</syntaxhighlight> <br />
<br />
Where: [[Amount]] - a numerical expression, specifying the profit target amount <br />
<br />
==== Notes ==== <br />
This function can only be used in signals. <br />
<br />
==== Example ====<br />
Generate an exit order for the entire position if the position profit reaches $100: <br />
<br />
<syntaxhighlight>SetStopPosition; <br />
<br />
SetProfitTarget(100);</syntaxhighlight> <br />
<br />
<br />
Generate an exit order for the entry if the profit per contract reaches $10: <br />
<br />
<syntaxhighlight>SetStopContract; <br />
<br />
SetProfitTarget(10);</syntaxhighlight> <br />
<br />
<br />
<br />
[[Category:Strategy Orders]]</div>194.84.116.138https://www.multicharts.com/trading-software/index.php?title=SetPercentTrailing&diff=1373SetPercentTrailing2012-01-27T12:34:49Z<p>194.84.116.138: /* Example */</p>
<hr />
<div>Closes out the entire position or the entry if the specified percentage of the maximum profit is lost after the profit has reached the specified value; generates the appropriate Stop order depending on whether the position is long or short. <br />
<br />
For example, if the specified profit is $100 and the specified percentage is 50, and the profit has reached the maximum of $120, the position will be closed once the profit falls back to $60. <br />
<br />
[[SetStopPosition]] and [[SetStopContract]] or [[SetStopShare]] functions determine whether SetPercentTrailing will be applied to the entire position or each contract or share individually; by default, SetPercentTrailing is applied to the entire position.<br />
<br />
SetPercentTrailing function is evaluated intra-bar and not only on close of a bar, and can exit within the same bar as the entry. <br />
<br />
==== Usage ====<br />
<syntaxhighlight>SetPercentTrailing(Profit,Percentage)</syntaxhighlight> <br />
<br />
Where: [[Profit]] - a numerical expression, specifying the currency value of the profit that must be reached first <br />
<br />
[[Percentage]] - a numerical expression, specifying the maximum loss of profit in percent <br />
<br />
==== Notes ==== <br />
This function can only be used in signals. <br />
<br />
==== Example ====<br />
Generate an exit order for the entire position if 50 percent of maximum position profit is lost <br />
after the profit has reached $25: <br />
<br />
<syntaxhighlight>SetStopPosition; <br />
<br />
SetPercentTrailing(25,50);</syntaxhighlight> <br />
<br />
Generate an exit order for the entry if 25 percent of maximum per share profit is lost after the<br />
profit has reached $5: <br />
<br />
<syntaxhighlight>SetStopShare; <br />
<br />
SetPercentTrailing(5,25);</syntaxhighlight> <br />
<br />
<br />
<br />
<br />
<br />
[[Category:Strategy Orders]]</div>194.84.116.138https://www.multicharts.com/trading-software/index.php?title=SetExitOnClose&diff=1372SetExitOnClose2012-01-27T12:34:15Z<p>194.84.116.138: /* Example */</p>
<hr />
<div>Closes out the current position at the Close tick of the last bar of the trading session on an intra-day chart; generates the appropriate Market exit order depending on whether the position is long or short. <br />
SetExitOnClose function uses the session closing time specified in the session settings for the symbol in the QuoteManager. <br />
<br />
==== Usage ====<br />
<syntaxhighlight>SetExitOnClose</syntaxhighlight> <br />
<br />
==== Notes ==== <br />
This function can only be used in signals. <br />
<br />
==== Example ====<br />
Generate an exit order at the Close tick of the last bar of the trading session: <br />
<br />
<syntaxhighlight>SetExitOnClose;</syntaxhighlight> <br />
<br />
<br />
[[Category:Strategy Orders]]</div>194.84.116.138https://www.multicharts.com/trading-software/index.php?title=SetDollarTrailing&diff=1371SetDollarTrailing2012-01-27T12:33:57Z<p>194.84.116.138: /* Example */</p>
<hr />
<div>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. <br />
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. <br />
<br />
[[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.<br />
<br />
SetDollarTrailing function is evaluated intra-bar and not only on close of a bar, and can exit within the same bar as the entry. <br />
<br />
==== Usage ====<br />
<syntaxhighlight>SetDollarTrailing(Amount)</syntaxhighlight> <br />
<br />
Where: [[Amount]] - a numerical expression, specifying the currency value of the maximum loss of profit <br />
<br />
==== Notes ==== <br />
This function can only be used in signals. <br />
<br />
==== Example ====<br />
Generate an exit order for the entire position if position profit drops by $50: <br />
<br />
<syntaxhighlight>SetStopPosition; <br />
<br />
SetDollarTrailing(50);</syntaxhighlight> <br />
<br />
Generate an exit order for the entry if per contract profit drops by $10: <br />
<br />
<syntaxhighlight>SetStopContract; <br />
<br />
SetDollarTrailing(10);</syntaxhighlight> <br />
<br />
[[Category:Strategy Orders]]</div>194.84.116.138https://www.multicharts.com/trading-software/index.php?title=SetBreakEven&diff=1370SetBreakEven2012-01-27T12:33:37Z<p>194.84.116.138: /* Example */</p>
<hr />
<div>Closes out the entire position or the entry if it is at the breakeven point after the profit has reached the specified value; generates the appropriate Stop order depending on whether the position is long or short. <br />
<br />
[[SetStopPosition]] and [[SetStopContract]] or [[SetStopShare]] functions determine whether SetBreakEven will be applied to the entire position or to each contract or share individually; by default, SetBreakEven is applied to the entire position. <br />
<br />
SetBreakEven function is evaluated intra-bar and not only on close of a bar, and can exit within the same bar as the entry. <br />
<br />
==== Usage ====<br />
<syntaxhighlight>SetBreakEven(Profit)</syntaxhighlight> <br />
<br />
Where: [[Profit]] - a numerical expression, specifying the currency value of the profit that must be reached first <br />
<br />
==== Notes ==== <br />
This function can only be used in signals. <br />
<br />
SetBreakEven function does not factor in commissions or slippage. <br />
<br />
==== Example ====<br />
Generate an exit order for the entire position if it is at the breakeven point after position profit <br />
has reached $50: <br />
<br />
<syntaxhighlight>SetStopPosition; <br />
<br />
SetBreakEven(50);</syntaxhighlight> <br />
<br />
Generate an exit order for the entry if it is at the breakeven point after per contract profit has<br />
reached $10: <br />
<br />
<syntaxhighlight>SetStopContract; <br />
<br />
SetBreakEven(10);</syntaxhighlight> <br />
<br />
<br />
[[Category:Strategy Orders]]</div>194.84.116.138https://www.multicharts.com/trading-software/index.php?title=Market&diff=1369Market2012-01-27T12:31:46Z<p>194.84.116.138: </p>
<hr />
<div>Used in strategy entry or exit statements to specify a Market price for an entry or an exit. <br />
A Market Buy order will execute at the current ask price and a Maret Sell order will execute at the current bid price. <br />
<br />
==== Usage ====<br />
<syntaxhighlight>At Market</syntaxhighlight> <br />
<br />
Where: [[At]] is a skip word and can be omitted <br />
<br />
==== Example ====<br />
Buy a user-set number of shares at Market price on open of next bar: <br />
<br />
<syntaxhighlight>Buy Next Bar At Market;</syntaxhighlight> <br />
<br />
[[Category:Strategy Orders]]</div>194.84.116.138https://www.multicharts.com/trading-software/index.php?title=Entry&diff=1368Entry2012-01-27T12:31:01Z<p>194.84.116.138: /* Example */</p>
<hr />
<div>Used in strategy exit statements to tie an exit to the particular entry that was assigned the [[EntryLabel]] name. <br />
An exit can only be tied to an entry within the same signal; for more information, see [[Buy]] or [[SellShort.]] <br />
<br />
==== Usage ====<br />
<syntaxhighlight>From Entry("EntryLabel")</syntaxhighlight> <br />
<br />
Where: [[EntryLabel]] - the name that was assigned to the entry that the exit is to be tied to<br />
<br />
[[From]] - a skip word and can be omitted <br />
<br />
==== Example ====<br />
Completely exit from the long position established by the entry labeled "Original Entry", at Market <br />
price on open of next bar: <br />
<br />
<syntaxhighlight>Sell From Entry("Original Entry")Next Bar At Open;</syntaxhighlight> <br />
<br />
[[Category:Strategy Orders]]</div>194.84.116.138https://www.multicharts.com/trading-software/index.php?title=Contracts&diff=1367Contracts2012-01-27T12:30:23Z<p>194.84.116.138: /* Example */</p>
<hr />
<div>Used in strategy entry or exit statements in combination with a numerical expression to specify the number of contracts or shares to trade. <br />
<br />
==== Usage ====<br />
<syntaxhighlight>TradeSize Contracts</syntaxhighlight> <br />
<br />
Where: [[TradeSize]] - a numerical expression, specifying the number of contracts or shares <br />
<br />
==== Example ====<br />
Buy 2 contracts at Market price on open of next bar: <br />
<br />
<syntaxhighlight>Buy 2 Contracts Next Bar At Market;</syntaxhighlight> <br />
<br />
<br />
[[Category:Strategy Orders]]</div>194.84.116.138https://www.multicharts.com/trading-software/index.php?title=All&diff=1366All2012-01-27T12:29:56Z<p>194.84.116.138: /* Example */</p>
<hr />
<div>Used in strategy exit statements in place of a numerical expression, preceding the words [[Shares]] or [[Contracts,]] to denote all of the shares or all of the contracts held without specifying the actual number of shares or contracts. <br />
<br />
==== Usage ====<br />
<syntaxhighlight>All Contracts</syntaxhighlight> <br />
<br />
==== Example ====<br />
Sell all of the shares held at market price on open of next bar: <br />
<br />
<syntaxhighlight>Sell All Shares Next Bar At Market;</syntaxhighlight> <br />
<br />
[[Category:Strategy Orders]]</div>194.84.116.138https://www.multicharts.com/trading-software/index.php?title=Was&diff=1365Was2012-01-27T12:26:47Z<p>194.84.116.138: /* Example */</p>
<hr />
<div>A Skip Word. Skip Words serve solely to improve the readability of PowerLanguage code and are skipped (ignored) during the compilation and execution. <br />
The use of Skip Words is optional; they can be inserted anywhere within the PL code and will appear in red in PowerLanguage Editor. <br />
<br />
==== Example ====<br />
The Skip Words in the example below are colored in red: <br />
<br />
<syntaxhighlight>If an Open is < than Close of 4 Bars Ago was Then Buy This Bar on Close;<br />
If Plot1 does Cross Above a 1350 Then Sell From Entry("My Entry")Next Bar at the Market;</syntaxhighlight> <br />
<br />
[[Category:Skip Words]]</div>194.84.116.138https://www.multicharts.com/trading-software/index.php?title=The&diff=1364The2012-01-27T12:26:34Z<p>194.84.116.138: /* Example */</p>
<hr />
<div>A Skip Word. Skip Words serve solely to improve the readability of PowerLanguage code and are skipped (ignored) during the compilation and execution. <br />
The use of Skip Words is optional; they can be inserted anywhere within the PL code and will appear in red in PowerLanguage Editor. <br />
<br />
==== Example ====<br />
The Skip Words in the example below are colored in red: <br />
<br />
<syntaxhighlight>If an Open is < than Close of 4 Bars Ago was Then Buy This Bar on Close;<br />
If Plot1 does Cross Above a 1350 Then Sell From Entry("My Entry")Next Bar at the Market;</syntaxhighlight> <br />
<br />
<br />
[[Category:Skip Words]]</div>194.84.116.138https://www.multicharts.com/trading-software/index.php?title=Than&diff=1363Than2012-01-27T12:26:21Z<p>194.84.116.138: /* Example */</p>
<hr />
<div>A Skip Word. Skip Words serve solely to improve the readability of PowerLanguage code and are skipped (ignored) during the compilation and execution. <br />
The use of Skip Words is optional; they can be inserted anywhere within the PL code and will appear in red in PowerLanguage Editor. <br />
<br />
==== Example ====<br />
The Skip Words in the example below are colored in red:<br />
<br />
<syntaxhighlight>If an Open is < than Close of 4 Bars Ago was Then Buy This Bar on Close;<br />
If Plot1 does Cross Above a 1350 Then Sell From Entry("My Entry")Next Bar at the Market;</syntaxhighlight> <br />
<br />
[[Category:Skip Words]]</div>194.84.116.138https://www.multicharts.com/trading-software/index.php?title=Place&diff=1362Place2012-01-27T12:26:14Z<p>194.84.116.138: /* Example */</p>
<hr />
<div>A Skip Word retained for backward compatibility. Skip Words serve solely to improve the readability of PowerLanguage code and are skipped (ignored) during the compilation and execution. <br />
The use of Skip Words is optional; they can be inserted anywhere within the PL code and will appear in red in PowerLanguage Editor. <br />
<br />
==== Example ====<br />
The Skip Words in the example below are colored in red: <br />
<br />
<syntaxhighlight>If an Open is < than Close of 4 Bars Ago was Then Buy This Bar on Close;<br />
If Plot1 does Cross Above a 1350 Then Sell From Entry("My Entry")Next Bar at the Market;</syntaxhighlight> <br />
<br />
[[Category:Skip Words]]</div>194.84.116.138https://www.multicharts.com/trading-software/index.php?title=On&diff=1361On2012-01-27T12:25:55Z<p>194.84.116.138: /* Example */</p>
<hr />
<div>A Skip Word. Skip Words serve solely to improve the readability of PowerLanguage code and are skipped (ignored) during the compilation and execution. <br />
The use of Skip Words is optional; they can be inserted anywhere within the PL code and will appear in red in PowerLanguage Editor. <br />
<br />
==== Example ====<br />
The Skip Words in the example below are colored in red: <br />
<br />
<syntaxhighlight>If an Open is < than Close of 4 Bars Ago was Then Buy This Bar on Close;<br />
If Plot1 does Cross Above a 1350 Then Sell From Entry("My Entry")Next Bar at the Market;</syntaxhighlight> <br />
<br />
[[Category:Skip Words]]</div>194.84.116.138https://www.multicharts.com/trading-software/index.php?title=Of&diff=1360Of2012-01-27T12:25:11Z<p>194.84.116.138: /* Example */</p>
<hr />
<div>A Skip Word. Skip Words serve solely to improve the readability of PowerLanguage code and are skipped (ignored) during the compilation and execution. <br />
The use of Skip Words is optional; they can be inserted anywhere within the PL code and will appear in red in PowerLanguage Editor. <br />
<br />
==== Example ====<br />
The Skip Words in the example below are colored in red: <br />
<br />
<syntaxhighlight>If an Open is < than Close of 4 Bars Ago was Then Buy This Bar on Close;<br />
If Plot1 does Cross Above a 1350 Then Sell From Entry("My Entry")Next Bar at the Market;</syntaxhighlight> <br />
<br />
[[Category:Skip Words]]</div>194.84.116.138https://www.multicharts.com/trading-software/index.php?title=Is&diff=1359Is2012-01-27T12:24:59Z<p>194.84.116.138: /* Example */</p>
<hr />
<div>A Skip Word. Skip Words serve solely to improve the readability of PowerLanguage code and are skipped (ignored) during the compilation and execution. <br />
The use of Skip Words is optional; they can be inserted anywhere within the PL code and will appear in red in PowerLanguage Editor. <br />
<br />
==== Example ====<br />
The Skip Words in the example below are colored in red: <br />
<br />
<syntaxhighlight>If an Open is < than Close of 4 Bars Ago was Then Buy This Bar on Close;<br />
If Plot1 does Cross Above a 1350 Then Sell From Entry("My Entry")Next Bar at the Market;</syntaxhighlight> <br />
<br />
[[Category:Skip Words]]</div>194.84.116.138https://www.multicharts.com/trading-software/index.php?title=From&diff=1358From2012-01-27T12:24:35Z<p>194.84.116.138: /* Example */</p>
<hr />
<div>A skip word; used in strategy exit statements in combination with [[Entry]] word that ties an exit to the particular entry that was assigned the [[EntryLabel name.]] <br />
<br />
An exit can only be tied to an entry within the same signal; for more information, see [[Buy]] or [[SellShort.]] <br />
<br />
Skip Words serve solely to improve the readability of PowerLanguage code and are skipped (ignored) during the compilation and execution. <br />
<br />
The use of Skip Words is optional; they can be inserted anywhere within the PL code and will appear in red in PowerLanguage Editor. <br />
<br />
==== Usage ====<br />
<syntaxhighlight>From Entry("EntryLabel")</syntaxhighlight><br />
<br />
Where: [[EntryLabel]] - the name that was assigned to the entry that the exit is to be tied to<br />
<br />
[[From]] - a skip word and can be omitted <br />
<br />
==== Example ====<br />
Completely exit from the long position established by the entry labeled "Original Entry", at Market<br />
price on open of next bar:<br />
<br />
<syntaxhighlight>Sell From Entry("Original Entry")Next Bar at Open;</syntaxhighlight> <br />
<br />
[[Category:Skip Words]]</div>194.84.116.138https://www.multicharts.com/trading-software/index.php?title=Does&diff=1357Does2012-01-27T12:24:15Z<p>194.84.116.138: /* Example */</p>
<hr />
<div>A Skip Word. Skip Words serve solely to improve the readability of PowerLanguage code and are skipped (ignored) during the compilation and execution. <br />
The use of Skip Words is optional; they can be inserted anywhere within the PL code and will appear in red in PowerLanguage Editor. <br />
<br />
==== Example ====<br />
The Skip Words in the example below are colored in red: <br />
<br />
<syntaxhighlight>If an Open is < than Close of 4 Bars Ago was Then Buy This Bar on Close;<br />
If Plot1 does Cross Above a 1350 Then Sell From Entry("My Entry")Next Bar at the Market;</syntaxhighlight> <br />
<br />
<br />
[[Category:Skip Words]]</div>194.84.116.138https://www.multicharts.com/trading-software/index.php?title=By&diff=1356By2012-01-27T12:24:03Z<p>194.84.116.138: /* Example */</p>
<hr />
<div>A Skip Word. Skip Words serve solely to improve the readability of PowerLanguage code and are skipped (ignored) during the compilation and execution. <br />
The use of Skip Words is optional; they can be inserted anywhere within the PL code and will appear in red in PowerLanguage Editor. <br />
<br />
==== Example ====<br />
The Skip Words in the example below are colored in red: <br />
<br />
<syntaxhighlight>If an Open is < than Close of 4 Bars Ago was Then Buy This Bar on Close;<br />
If Plot1 does Cross Above a 1350 Then Sell From Entry("My Entry")Next Bar at the Market;</syntaxhighlight> <br />
<br />
<br />
[[Category:Skip Words]]</div>194.84.116.138https://www.multicharts.com/trading-software/index.php?title=Based&diff=1355Based2012-01-27T12:23:44Z<p>194.84.116.138: /* Example */</p>
<hr />
<div>A Skip Word. Skip Words serve solely to improve the readability of PowerLanguage code and are skipped (ignored) during the compilation and execution. <br />
The use of Skip Words is optional; they can be inserted anywhere within the PL code and will appear in red in PowerLanguage Editor. <br />
<br />
==== Example ====<br />
The Skip Words in the example below are colored in red: <br />
<br />
<syntaxhighlight>If an Open is < than Close of 4 Bars Ago was Then Buy This Bar on Close;<br />
If Plot1 does Cross Above a 1350 Then Sell From Entry("My Entry")Next Bar at the Market;</syntaxhighlight> <br />
<br />
[[Category:Skip Words]]</div>194.84.116.138https://www.multicharts.com/trading-software/index.php?title=At&diff=1354At2012-01-27T12:23:25Z<p>194.84.116.138: /* Example */</p>
<hr />
<div>A Skip Word. Skip Words serve solely to improve the readability of PowerLanguage code and are skipped (ignored) during the compilation and execution. <br />
The use of Skip Words is optional; they can be inserted anywhere within the PL code and will appear in red in PowerLanguage Editor. <br />
<br />
==== Example ====<br />
The Skip Words in the example below are colored in red: <br />
<br />
<syntaxhighlight>If an Open is < than Close of 4 Bars Ago was Then Buy This Bar on Close;<br />
If Plot1 does Cross Above a 1350 Then Sell From Entry("My Entry")Next Bar at the Market;</syntaxhighlight> <br />
<br />
[[Category:Skip Words]]</div>194.84.116.138https://www.multicharts.com/trading-software/index.php?title=An&diff=1353An2012-01-27T12:22:58Z<p>194.84.116.138: /* Example */</p>
<hr />
<div>A Skip Word. Skip Words serve solely to improve the readability of PowerLanguage code and are skipped (ignored) during the compilation and execution. <br />
The use of Skip Words is optional; they can be inserted anywhere within the PL code and will appear in red in PowerLanguage Editor. <br />
<br />
==== Example ====<br />
The Skip Words in the example below are colored in red:<br />
<br />
<syntaxhighlight>If an Open is < than Close of 4 Bars Ago was Then Buy This Bar on Close;<br />
If Plot1 does Cross Above a 1350 Then Sell From Entry("My Entry")Next Bar at the Market;</syntaxhighlight><br />
<br />
[[Category:Skip Words]]</div>194.84.116.138https://www.multicharts.com/trading-software/index.php?title=A&diff=1352A2012-01-27T12:22:40Z<p>194.84.116.138: /* Example */</p>
<hr />
<div>A Skip Word. Skip Words serve solely to improve the readability of PowerLanguage code and are skipped (ignored) during the compilation and execution. <br />
The use of Skip Words is optional; they can be inserted anywhere within the PL code and will appear in red in PowerLanguage Editor. <br />
<br />
==== Example ====<br />
The Skip Words in the example below are colored in red: <br />
<br />
<syntaxhighlight>If an Open is < than Close of 4 Bars Ago was Then Buy This Bar on Close;<br />
If Plot1 does Cross Above a 1350 Then Sell From Entry("My Entry") Next Bar at the Market;</syntaxhighlight> <br />
<br />
[[Category:Skip Words]]</div>194.84.116.138https://www.multicharts.com/trading-software/index.php?title=PositionProfit&diff=1349PositionProfit2012-01-27T11:57:12Z<p>194.84.116.138: </p>
<hr />
<div>Returns a numerical value, indicating the profit or loss for the specified position. <br />
<br />
==== Usage ====<br />
<syntaxhighlight>PositionProfit(PosBack)</syntaxhighlight> <br />
<br />
Where: [[PosBack]] - a numerical expression, specifying the position: <br />
<br />
0 - open position; <br />
<br />
1 - one position back (the last position closed); <br />
<br />
2 - two positions back, etc. <br />
<br />
If [[PosBack]] is not specified, a value for the open position will be returned. <br />
<br />
==== Notes ==== <br />
This function can only be used in signals. <br />
<br />
==== Example ====<br />
<syntaxhighlight>PositionProfit will return a value of 0 if the current position is flat <br />
<br />
PositionProfit (0) will return a value of 5 if the value of the open position has increased by $5<br />
since it was entered <br />
<br />
PositionProfit (1) will return a value of -5 if the most recently closed position has generated <br />
a loss of $5</syntaxhighlight> <br />
<br />
[[Category:Strategy Position]]</div>194.84.116.138https://www.multicharts.com/trading-software/index.php?title=PositionProfit&diff=1348PositionProfit2012-01-27T11:56:25Z<p>194.84.116.138: Created page with "Returns a numerical value, indicating the profit or loss for the specified position. ==== Usage ==== <syntaxhighlight>PositionProfit(PosBack)</syntaxhighlight> Where: [[P..."</p>
<hr />
<div>Returns a numerical value, indicating the profit or loss for the specified position. <br />
<br />
==== Usage ====<br />
<syntaxhighlight>PositionProfit(PosBack)</syntaxhighlight> <br />
<br />
Where: [[PosBack]] - a numerical expression, specifying the position: <br />
<br />
0 - open position; <br />
<br />
1 - one position back (the last position closed); <br />
<br />
2 - two positions back, etc. <br />
<br />
If [[PosBack]] is not specified, a value for the open position will be returned. <br />
<br />
==== Notes ==== <br />
This function can only be used in signals. <br />
<br />
==== Example ====<br />
PositionProfit will return a value of 0 if the current position is flat <br />
<br />
PositionProfit (0) will return a value of 5 if the value of the open position has increased by $5 since it was entered <br />
<br />
PositionProfit (1) will return a value of -5 if the most recently closed position has generated a loss of $5 <br />
<br />
[[Category:Strategy Position]]</div>194.84.116.138https://www.multicharts.com/trading-software/index.php?title=OpenPositionProfit&diff=1347OpenPositionProfit2012-01-27T11:54:33Z<p>194.84.116.138: Created page with "Returns a numerical value, indicating the current profit or loss for the open position. ==== Usage ==== <syntaxhighlight>OpenPositionProfit</syntaxhighlight> ==== Notes ..."</p>
<hr />
<div>Returns a numerical value, indicating the current profit or loss for the open position. <br />
<br />
==== Usage ====<br />
<syntaxhighlight>OpenPositionProfit</syntaxhighlight> <br />
<br />
==== Notes ==== <br />
This function can only be used in signals. <br />
<br />
==== Example ====<br />
<syntaxhighlight>OpenPositionProfit will return a value of 0 if the current position is flat <br />
<br />
OpenPositionProfit will return a value of 10 if the value of the open position has increased by $10<br />
since it was entered <br />
<br />
OpenPositionProfit will return a value of -5 if the value of the open position has decreased by $5<br />
since it was entered</syntaxhighlight> <br />
<br />
[[Category:Strategy Position]]</div>194.84.116.138https://www.multicharts.com/trading-software/index.php?title=MaxShares&diff=1346MaxShares2012-01-27T11:53:08Z<p>194.84.116.138: Created page with "Same as MaxContracts Category:Strategy Position"</p>
<hr />
<div>Same as [[MaxContracts]] <br />
<br />
<br />
[[Category:Strategy Position]]</div>194.84.116.138https://www.multicharts.com/trading-software/index.php?title=MaxPositionProfit&diff=1345MaxPositionProfit2012-01-27T11:52:36Z<p>194.84.116.138: /* Example */</p>
<hr />
<div>Returns a numerical value, indicating the largest gain reached while the specified position was held. <br />
<br />
==== Usage ====<br />
<syntaxhighlight>MaxPositionProfit(PosBack)</syntaxhighlight> <br />
<br />
Where: [[PosBack]] - a numerical expression, specifying the position: <br />
<br />
0 - open position; <br />
<br />
1 - one position back (the last position closed); <br />
<br />
2 - two positions back, etc. <br />
<br />
If [[PosBack]] is not specified, a value for the open position will be returned. <br />
<br />
==== Notes ====<br />
This function can only be used in signals. <br />
<br />
==== Example ====<br />
<syntaxhighlight>MaxPositionProfit will return a value of 0 if the value of the open position has not increased at <br />
any time while it was held <br />
<br />
MaxPositionProfit (1) will return a value of 10 if the most recently closed position has gained in<br />
value as much as $10 while it was held</syntaxhighlight> <br />
<br />
<br />
<br />
[[Category:Strategy Position]]</div>194.84.116.138https://www.multicharts.com/trading-software/index.php?title=MaxPositionProfit&diff=1344MaxPositionProfit2012-01-27T11:52:04Z<p>194.84.116.138: Created page with "Returns a numerical value, indicating the largest gain reached while the specified position was held. ==== Usage ==== <syntaxhighlight>MaxPositionProfit(PosBack)</syntaxhig..."</p>
<hr />
<div>Returns a numerical value, indicating the largest gain reached while the specified position was held. <br />
<br />
==== Usage ====<br />
<syntaxhighlight>MaxPositionProfit(PosBack)</syntaxhighlight> <br />
<br />
Where: [[PosBack]] - a numerical expression, specifying the position: <br />
<br />
0 - open position; <br />
<br />
1 - one position back (the last position closed); <br />
<br />
2 - two positions back, etc. <br />
<br />
If [[PosBack]] is not specified, a value for the open position will be returned. <br />
<br />
==== Notes ====<br />
This function can only be used in signals. <br />
<br />
==== Example ====<br />
<syntaxhighlight>MaxPositionProfit will return a value of 0 if the value of the open position has not increased at any time while it was held <br />
<br />
MaxPositionProfit (1) will return a value of 10 if the most recently closed position has gained in value as much as $10 while it was held</syntaxhighlight> <br />
<br />
<br />
<br />
[[Category:Strategy Position]]</div>194.84.116.138https://www.multicharts.com/trading-software/index.php?title=MaxPositionLoss&diff=1343MaxPositionLoss2012-01-27T11:50:25Z<p>194.84.116.138: /* Example */</p>
<hr />
<div>Returns a negative numerical value, indicating the largest loss reached while the specified position was held. <br />
<br />
==== Usage ====<br />
<syntaxhighlight>MaxPositionLoss(PosBack)</syntaxhighlight> <br />
<br />
Where: [[PosBack]] - a numerical expression, specifying the position: <br />
<br />
0 - open position; <br />
<br />
1 - one position back (the last position closed); <br />
<br />
2 - two positions back, etc. <br />
<br />
If PosBack is not specified, a value for the open position will be returned. <br />
<br />
==== Notes ==== <br />
This function can only be used in signals. <br />
<br />
==== Example ====<br />
<syntaxhighlight>MaxPositionLoss will return a value of 0 if the value of the open position has not dropped below <br />
the entry price at any time while it was held <br />
<br />
MaxPositionLoss (1) will return a value of -10 if the most recently closed position has dropped in<br />
value as much as $10 while it was held</syntaxhighlight> <br />
<br />
[[Category:Strategy Position]]</div>194.84.116.138https://www.multicharts.com/trading-software/index.php?title=MaxPositionLoss&diff=1342MaxPositionLoss2012-01-27T11:50:05Z<p>194.84.116.138: Created page with "Returns a negative numerical value, indicating the largest loss reached while the specified position was held. ==== Usage ==== <syntaxhighlight>MaxPositionLoss(PosBack)</sy..."</p>
<hr />
<div>Returns a negative numerical value, indicating the largest loss reached while the specified position was held. <br />
<br />
==== Usage ====<br />
<syntaxhighlight>MaxPositionLoss(PosBack)</syntaxhighlight> <br />
<br />
Where: [[PosBack]] - a numerical expression, specifying the position: <br />
<br />
0 - open position; <br />
<br />
1 - one position back (the last position closed); <br />
<br />
2 - two positions back, etc. <br />
<br />
If PosBack is not specified, a value for the open position will be returned. <br />
<br />
==== Notes ==== <br />
This function can only be used in signals. <br />
<br />
==== Example ====<br />
<syntaxhighlight>MaxPositionLoss will return a value of 0 if the value of the open position has not dropped below the entry price at any time while it was held <br />
<br />
MaxPositionLoss (1) will return a value of -10 if the most recently closed position has dropped in value as much as $10 while it was held</syntaxhighlight> <br />
<br />
[[Category:Strategy Position]]</div>194.84.116.138