NexusFi: Find Your Edge


Home Menu

 





Bars since last true Custom Column in Watchlist


Discussion in ThinkOrSwim

Updated
    1. trending_up 2,353 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 1 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
kamisyed
Abu Dhabi + United Arab Emirates
 
Posts: 2 since Oct 2013
Thanks Given: 0
Thanks Received: 0

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;


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Strike Pause Holds, Oil Erases Monday Spike -- May CPI W …
Traders Hideout
CME Group Fee Schedule Changes Hit All Four Exchanges -- …
Traders Hideout
Iran Ceasefire Surges to 19.5% on US 15-Point Plan -- 82 …
Prediction Markets & Event Contracts
Fabrication or Framework? Irans Denied MOU Explains the …
Prediction Markets & Event Contracts
TradingView Deploys AI to Monitor SEC Filings in Real Ti …
TradingView
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Big Mike in Ecuador
205 thanks
Sober Journey With S&P
21 thanks
30 Sessions
20 thanks
Volume Indicators
8 thanks
Thanks Mike. Godspeed.
7 thanks
  #2 (permalink)
 Haggerstone8 
London, UK
 
Experience: Intermediate
Platform: TOS
Trading: stocks
Posts: 5 since Mar 2013
Thanks Given: 3
Thanks Received: 0

Hi

I'm trying to do the same. Were you able to find a solution?

Thanks
VB


Reply With Quote




Last Updated on October 12, 2014


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts