Hi
@BenTen @tomsk , or anyone else available to help, I was wondering if I could get some help to finish up this TOS code for watch-list that I was trying to complete, to show green when 9 ema crosses above vwap within last 3 bars, customizable for timeframes, and opposite as well, if 9 ema crosses below vwap within last 3 bars; Here is what I have gotten started:
Thank you
Papa
Just a follow up, as I previously did not state the issues I was having:
I am getting the messages invalid statements at the certain lines 2, 7 and 10.
If anyone could advise would be great, I am not a coder, but attempted to piece together what I could;
Thanks in advance @BenTen @tomsk @horserider @netarchitech or anyone else who can help me with this!
Invalid statement: input at 2:1
Invalid statement: def at 7:1
Invalid statement: AssignBackgroundC... at 10:1
@BenTen @tomsk , or anyone else available to help, I was wondering if I could get some help to finish up this TOS code for watch-list that I was trying to complete, to show green when 9 ema crosses above vwap within last 3 bars, customizable for timeframes, and opposite as well, if 9 ema crosses below vwap within last 3 bars; Here is what I have gotten started:
Code:
input maLengthOne = 9;
input maType=AverageType, EXPONENTIAL
input timeFrame = {default DAY, WEEK, MONTH};
def vwapValue = reference VWAP(-2, 2, timeFrame)."VWAP";
def ma = MovingAverage(maType, vwapValue, maLength);
inputbarsAfterCross = 3;
def crossAbove = maLengthOne > vwap
def crossBelow = maLengthOne < vwap
diff.AssignValueColor(if ma == vwap then Color.CURRENT else Color.BLACK);
AssignBackgroundColor(if diff > 0 then Color. GREEN else if diff < 0 then Color.RED else Color.CURRENT);
Thank you
Papa
Just a follow up, as I previously did not state the issues I was having:
I am getting the messages invalid statements at the certain lines 2, 7 and 10.
If anyone could advise would be great, I am not a coder, but attempted to piece together what I could;
Thanks in advance @BenTen @tomsk @horserider @netarchitech or anyone else who can help me with this!
Code:
input maLengthOne = 9;
input maType=AverageType, EXPONENTIAL
input timeFrame = {default DAY, WEEK, MONTH};
def vwapValue = reference VWAP(-2, 2, timeFrame)."VWAP";
def ma = MovingAverage(maType, vwapValue, maLength);
inputbarsAfterCross = 3;
def crossAbove = maLengthOne > vwap
def crossBelow = maLengthOne < vwap
diff.AssignValueColor(if ma == vwap then Color.CURRENT else Color.BLACK);
AssignBackgroundColor(if diff > 0 then Color. GREEN else if diff < 0 then Color.RED else Color.CURRENT)
Invalid statement: input at 2:1
Invalid statement: def at 7:1
Invalid statement: AssignBackgroundC... at 10:1