Bars since last true Custom Column in Watchlist - futures io
futures io futures trading

Bars since last true Custom Column in Watchlist

Discussion in ThinkOrSwim

    1. trending_up 1,399 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 1 posts
    2. 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)

Search this Thread

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)

def TMA2 = 3*expAverage(TMA1,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

def HATMA1 = 3*expAverage(haclose,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 futures io?
Indicators for pair trading MES and M2K
Platforms and Indicators
NT8 indicator to simulate a Funding Evaluation where to …
COTbase for quant trading?
Elite Algorithmic NinjaTrader Trading
Volume Profile Indicator for Ninja Script in NT8
Trading Reviews and Vendors
Best Threads (Most Thanked)
in the last 7 days on futures io
Battlestations: Show us your trading desks!
137 thanks
Want your NinjaTrader indicator created, free?
32 thanks
Big Mike in Ecuador
30 thanks
Saturday Morning Market Replay!
20 thanks
Selling Options on Futures?
19 thanks
(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


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


Reply With Quote

futures io Trading Community Platforms and Indicators ThinkOrSwim > Bars since last true Custom Column in Watchlist

Last Updated on October 12, 2014

Upcoming Webinars and Events

NinjaTrader Indicator Challenge!


Battlestations! Show us your trading desk - $1,500 in prizes!


Importance of Finding Your Own Way w/Adam Grimes

Elite only

Journal Challenge w/Jigsaw


Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432,
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.
no new posts