truthntrading
New member
Hello All,
I need some help fleshing out an indicator that then can be added as a strategy for forward testing.
Parameters
I limit the time it operates in and i want a visual aid to make it easily actionable.
Based on a mashup of other peoples work on here i have the very rough framework but need some assistance adding things. and getting it working.
Currently i don't know how to reference the reversal bar high, low or mid. it gives me a class error when i try to do so.
In addition to coloring the reversal bar as i already have i would like to add horizontal lines at high,low and mid as well as a cloud between them , exactly like PAM
Depending on Timeframe there may be more than one bar highlighted, so bonus points for being able to toggle highlight 1. the highest reversal bar 2. the lowest 3. both highest n lowest 4. all
Thank you in advance to anyone who can help point me in the right direction. @Chemmy @SleepyZ @mashume @halcyonguy
I need some help fleshing out an indicator that then can be added as a strategy for forward testing.
Parameters
I limit the time it operates in and i want a visual aid to make it easily actionable.
Based on a mashup of other peoples work on here i have the very rough framework but need some assistance adding things. and getting it working.
Currently i don't know how to reference the reversal bar high, low or mid. it gives me a class error when i try to do so.
In addition to coloring the reversal bar as i already have i would like to add horizontal lines at high,low and mid as well as a cloud between them , exactly like PAM
Depending on Timeframe there may be more than one bar highlighted, so bonus points for being able to toggle highlight 1. the highest reversal bar 2. the lowest 3. both highest n lowest 4. all
Thank you in advance to anyone who can help point me in the right direction. @Chemmy @SleepyZ @mashume @halcyonguy
Code:
def H = high;
def L = low;
def reversalbar = if high > high[1] and
low < low[1]
then 1
else Double.NaN;
input pricecolor = yes;
AssignPriceColor(if !pricecolor
then color.current else
if !isNaN(reversalbar) then color.orange ;
def closeh = close(period=aggregationperiod.hour);
def RBH = high(reversalbar);
def IB = if SecondsFromTime(1031) > 0 and SecondsTillTime(1140) > 0 then 1 else 0;
def MPeriod = if secondsTillTime(1600) < 1800 and secondsTillTime(1600)[1] > 1800 then 1 else 0;
def price = close;
#buy condition
def buyc = h crosses above RBH;
def sellc = h crosses above closeh[-1];
AddOrder(OrderType.BUY_to_OPEN,buyc and IB==1, name="BTOFADE", yes);
AddOrder(OrderType.SELL_to_cLOSE, sellc or MPeriod==1, name="STCFADE", yes);
Last edited: