Jump to content

Recommended Posts

Posted

A SMAColors indicator has three lines color.

If (Rising(SMAColors(14))

PlotColors[0][0] = Color.Blue;

else if (Falling(SMAColors(14))

PlotColors[0][0] = Color.Red;

else

PlotColors[0][0] = Color.Yewllow;

 

My question is "can we use the PlotColors to trigger short or long trade in a strategy?"

Like

 

if (SMAColors(14).PlotColors[0][0] == Color.Red)

EnterShort();

Posted
A SMAColors indicator has three lines color.

If (Rising(SMAColors(14))

PlotColors[0][0] = Color.Blue;

else if (Falling(SMAColors(14))

PlotColors[0][0] = Color.Red;

else

PlotColors[0][0] = Color.Yewllow;

 

My question is "can we use the PlotColors to trigger short or long trade in a strategy?"

Like

 

if (SMAColors(14).PlotColors[0][0] == Color.Red)

EnterShort();

 

Declare a int in the variables section "private int signal = 0;"

 

If (Rising(SMAColors(14))

{

PlotColors[0][0] = Color.Blue;

signal = 1;

}

else if (Falling(SMAColors(14))

{

PlotColors[0][0] = Color.Red;

signal = 2;

}

else

{

PlotColors[0][0] = Color.Yewllow;

signal = 0;

}

 

if (signal == 2)

EnterShort();

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...