Login Page - Create Account

Support Board


Date/Time: Mon, 23 Dec 2024 00:16:12 +0000



Post From: ACSIL REPLAY PROBLEM

[2015-08-29 11:53:58]
Marek F - Posts: 244
during the period of a bar i would like to be able to draw the signal while it's true but the moment after it's no longer true i would like to remove the signal

You need to set to 0 the Subgraphs of signal if both sma cross is not true.

This your code from post #1:
if ((MovSlope7[sc.Index - 1] > MovSlope8[sc.Index - 1]) && (MovSlope7[sc.Index] < MovSlope8[sc.Index]))
{
MovSlope5[sc.Index] = mov1 + 8.5f;
MovSlope5.DataColor[sc.Index] = sc.Input[1].GetColor();
}
else if ((MovSlope7[sc.Index - 1] < MovSlope8[sc.Index - 1]) && (MovSlope7[sc.Index] > MovSlope8[sc.Index]))
{
MovSlope6[sc.Index] = mov1 - 8.5f;
MovSlope6.DataColor[sc.Index] = sc.Input[2].GetColor();
}

change to:
if ((MovSlope7[sc.Index - 1] > MovSlope8[sc.Index - 1]) && (MovSlope7[sc.Index] < MovSlope8[sc.Index]))
{
  MovSlope5[sc.Index] = mov1 + 8.5f;
  MovSlope5.DataColor[sc.Index] = sc.Input[1].GetColor();
}
else
{
  MovSlope5[sc.Index] = 0;
  MovSlope5.DataColor[sc.Index] = RGB(0,0,0);
}  

if ((MovSlope7[sc.Index - 1] < MovSlope8[sc.Index - 1]) && (MovSlope7[sc.Index] > MovSlope8[sc.Index]))
{
  MovSlope6[sc.Index] = mov1 - 8.5f;
  MovSlope6.DataColor[sc.Index] = sc.Input[2].GetColor();
}
else
{
  MovSlope6[sc.Index] = 0;
  MovSlope6.DataColor[sc.Index] = RGB(0,0,0);
}

Marek