Trading Articles
Article Categories
Article Tools
Bars since last true Custom Column in Watchlist
Updated October 12, 2014
trending_up
1,399 views
thumb_up
0 thanks given
group
2 followers
forum
1 posts
attach_file
0 attachments
Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to
register in order to view the content of the threads and start contributing to our community.
It's free and simple.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Bars since last true Custom Column in Watchlist
(login for full post details)
#1 (permalink )
Abu Dhabi + United Arab Emirates
Posts: 2 since Oct 2013
Thanks: 0 given,
0
received
I'm using the Sylvain Vervoort Crossover Alert and wanted help in creating a column on my watchlist which shows the output for the number of bars since the condition was true . This is the code I'm using for my current column (it outputs the % difference between the current close and the the 8 EMA when the condition is true, I'm using this output to see if I'm too late to enter a position based on the move but it's kind of useless info. I'd prefer to see bars since last true). Appreciate any help on this!!!
input period = 55;
def price = (high+low+close)/3;
#-----Typical Price ZeroLag Triple Exponential Moving Average
def TMA1 = 3*expAverage(price,period)
-3*expAverage(expAverage(price,period),period)
+expAverage(expAverage(expAverage(price,period)
,period),period);
def TMA2 = 3*expAverage(TMA1,period)
-3*expAverage(expAverage(TMA1,period),period)
+expAverage(expAverage(expAverage(TMA1,period)
,period),period);
def difference = TMA1-TMA2;
def TypicalPriceZeroLagTEMA = TMA1+difference;
#------Heikin-Ashi Close ZeroLag Triple Exponential Moving Average
rec haopen = CompoundValue(1,((open[1]+high[1]
+low[1]+close[1])/4 + haopen[1])/2, hl2);
def haclose = ((open+high+low+close)/4+haopen
+max(high,haopen)+min(low,haopen))/4;
def HATMA1 = 3*expAverage(haclose,period)
-3*expAverage(expAverage(haclose,period),period)
+expAverage(expAverage(expAverage(haclose,period)
,period),period);
def HATMA2 = 3 * ExpAverage(HATMA1, period)
- 3 * ExpAverage(ExpAverage(HATMA1, period), period)
+ ExpAverage(ExpAverage(ExpAverage(HATMA1, period)
, period), period);
def HAdifference = HATMA1 - HATMA2;
def HeikinAshiZeroLagTEMA = HATMA1 + HAdifference;
def buySignal = if TypicalPriceZeroLagTEMA > HeikinAshiZeroLagTEMA and TypicalPriceZeroLagTEMA[1] <= HeikinAshiZeroLagTEMA[1] then 1 else 0;
def sellSignal = if TypicalPriceZeroLagTEMA < HeikinAshiZeroLagTEMA and TypicalPriceZeroLagTEMA[1] >= HeikinAshiZeroLagTEMA[1] then 1 else 0;
plot signalBuy = if buySignal then (Close - expAverage(Price,8))/ expAverage(Price,8) else double.nan;
Can you help answer these questions from other members on futures io?
Best Threads (Most Thanked) in the last 7 days on futures io
(login for full post details)
#2 (permalink )
London, UK
Experience: Intermediate
Platform: TOS
Trading: stocks
Posts: 5 since Mar 2013
Thanks: 3 given,
0
received
Hi
I'm trying to do the same. Were you able to find a solution?
Thanks
VB
Last Updated on October 12, 2014
Right now
Ongoing
Right now
March
Register to Attend
Elite only
Coming soon
April