hi, does anyone know how to set floating pl for the day. i would like the floating pl to be reset to 0 every day. is this possible?
#
# TD Ameritrade IP Company, Inc. (c) 2012
#
declare lower;
plot FPL = FPL();
plot ZeroLine = 0;
FPL.SetPaintingStrategy(PaintingStrategy.SQUARED_HISTOGRAM);
FPL.DefineColor("Positive and Up", Color.GREEN);
FPL.DefineColor("Positive and Down", Color.DARK_GREEN);
FPL.DefineColor("Negative and Down", Color.RED);
FPL.DefineColor("Negative and Up", Color.DARK_RED);
FPL.AssignValueColor(if FPL >= 0 then if FPL > FPL[1] then FPL.Color("Positive and Up") else FPL.Color("Positive and Down") else if FPL < FPL[1] then FPL.Color("Negative and Down") else FPL.Color("Negative and Up"));
ZeroLine.SetDefaultColor(Color.GRAY);
hi, i am trying to get a floating pl with a reset to 0 for start of every day. is this possible?
here is what i got so far:
declare lower;
# Define variables
def reset = secondsfromtime(0000) >= 86400; # 86400 seconds = 24 hours
def fplvalue = fpl();
def FPLValue2 = if reset then 0 else fplvalue[1] + close - close[1];
plot FPL = fplvalue2;
plot ZeroLine = 0;
# Set painting strategy and colors
FPL.SetPaintingStrategy(PaintingStrategy.SQUARED_HISTOGRAM);
FPL.DefineColor("Positive and Up", Color.GREEN);
FPL.DefineColor("Positive and Down", Color.DARK_GREEN);
FPL.DefineColor("Negative and Down", Color.RED);
FPL.DefineColor("Negative and Up", Color.DARK_RED);
FPL.AssignValueColor(if FPL >= 0 then if FPL > FPL[1] then FPL.Color("Positive and Up") else FPL.Color("Positive and Down") else if FPL < FPL[1] then FPL.Color("Negative and Down") else FPL.Color("Negative and Up"));
ZeroLine.SetDefaultColor(Color.GRAY);
the fpl is supposed to reset to 0, but it does not seem to be working. can anyone help?
#
# TD Ameritrade IP Company, Inc. (c) 2012
#
declare lower;
plot FPL = FPL();
plot ZeroLine = 0;
FPL.SetPaintingStrategy(PaintingStrategy.SQUARED_HISTOGRAM);
FPL.DefineColor("Positive and Up", Color.GREEN);
FPL.DefineColor("Positive and Down", Color.DARK_GREEN);
FPL.DefineColor("Negative and Down", Color.RED);
FPL.DefineColor("Negative and Up", Color.DARK_RED);
FPL.AssignValueColor(if FPL >= 0 then if FPL > FPL[1] then FPL.Color("Positive and Up") else FPL.Color("Positive and Down") else if FPL < FPL[1] then FPL.Color("Negative and Down") else FPL.Color("Negative and Up"));
ZeroLine.SetDefaultColor(Color.GRAY);
hi, i am trying to get a floating pl with a reset to 0 for start of every day. is this possible?
here is what i got so far:
declare lower;
# Define variables
def reset = secondsfromtime(0000) >= 86400; # 86400 seconds = 24 hours
def fplvalue = fpl();
def FPLValue2 = if reset then 0 else fplvalue[1] + close - close[1];
plot FPL = fplvalue2;
plot ZeroLine = 0;
# Set painting strategy and colors
FPL.SetPaintingStrategy(PaintingStrategy.SQUARED_HISTOGRAM);
FPL.DefineColor("Positive and Up", Color.GREEN);
FPL.DefineColor("Positive and Down", Color.DARK_GREEN);
FPL.DefineColor("Negative and Down", Color.RED);
FPL.DefineColor("Negative and Up", Color.DARK_RED);
FPL.AssignValueColor(if FPL >= 0 then if FPL > FPL[1] then FPL.Color("Positive and Up") else FPL.Color("Positive and Down") else if FPL < FPL[1] then FPL.Color("Negative and Down") else FPL.Color("Negative and Up"));
ZeroLine.SetDefaultColor(Color.GRAY);
the fpl is supposed to reset to 0, but it does not seem to be working. can anyone help?