Saint Paul, Minnesota, United States
Experience: Beginner
Platform: MultiCharts
Broker: Edge Clear
Trading: Micros
Posts: 98 since Jun 2019
Thanks Given: 1,118
Thanks Received: 115
|
This is from TradeStation. You will have to compile it in MC.
Moderators. If this is not allowed, please remove it.
inputs:
int PositiveClosedEquityColor( UpColorDefault ) [
DisplayName = "PositiveClosedEquityColor",
ToolTip = "Enter the color to use when the closed equity is greater than zero."],
int PositiveOpenEquityColor( UpColorDefault ) [
DisplayName = "PositiveOpenEquityColor",
ToolTip = "Enter the color to use when the open equity is greater than zero."],
int NegativeClosedEquityColor( DownColorDefault ) [
DisplayName = "NegativeClosedEquityColor",
ToolTip = "Enter the color to use when the closed equity is less than or equal to zero."],
int NegativeOpenEquityColor( DownColorDefault ) [
DisplayName = "NegativeOpenEquityColor",
ToolTip = "Enter the color to use when the open equity is less than or equal to zero."];
variables:
double OpenEquity( 0 ),
double ClosedEquity( 0 );
OpenEquity = I_OpenEquity;
ClosedEquity = I_ClosedEquity;
Plot1( OpenEquity, !( "OpenEquity" ), IFF( OpenEquity > 0,
PositiveOpenEquityColor, NegativeOpenEquityColor) );
Plot2( ClosedEquity, !( "ClosedEquity" ), IFF( ClosedEquity > 0,
PositiveClosedEquityColor, NegativeClosedEquityColor) );
Plot3( 0, !( "ZeroLine" ) );
{
set "connector" color (color plotted from the prior bar to the current bar) for
cases where open equity crosses zero or goes from zero to a non-zero value; the
connector color will be determined by the current bar open equity value
}
if OpenEquity[1] <= 0 and OpenEquity > 0 then
SetPlotColor[1]( 1, PositiveOpenEquityColor )
else if OpenEquity[1] >= 0 and OpenEquity < 0 then
SetPlotColor[1]( 1, NegativeOpenEquityColor );
|