NexusFi: Find Your Edge


Home Menu

 





John Carter's close below 21 day high


Discussion in ThinkOrSwim

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




 
Search this Thread
  #1 (permalink)
Beamsplitter
Fayetteville,Arkansas
 
Posts: 4 since Jul 2016
Thanks Given: 5
Thanks Received: 1

Hello
Im new to the TOS platform and ThinkScript. I come over from Tradstation and Easylanguage.
I wonder if anyone can help me properly code this study.
Im trying to duplicate John Carters close below the 21 day high study.
The english for this would be to mark the bar that closes below the low of the highest high bar of the last 21 days.
Ive tried to find examples of simular studies to work off of to no avail.
Any help would be appreciated.
Thanks.
Here is what I tried to do so far.

declare upper;

def hiday = Highest(high, 21);

plot sigday = ( hiday[1] and close < low[1]) or ( hiday[2] and close < low[2]) ;

sigday.SetPaintingStrategy(PaintingStrategy.Boolean_ARROW_DOWN);

sigday.SetDefaultColor(Color.GREEN);

As written, the code produces arrows on days closing below
any higher day not just the 21 day high.

Thanks


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
CFTC Requests Tag 50 Trader Identity Data From CME and I …
Traders Hideout
Iran Fired a Missile at Israel Last Night. The $8M June …
Prediction Markets & Event Contracts
Six Days to Kickoff: World Cup Prediction Markets Hit $1 …
Prediction Markets & Event Contracts
Saylors 41-Month HODL Breaks: Strategy Sells 32 BTC as $ …
Prediction Markets & Event Contracts
Trump Lands in Beijing on CPI Day: Iran Peace Expires To …
Prediction Markets & Event Contracts
 
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)
Beamsplitter
Fayetteville,Arkansas
 
Posts: 4 since Jul 2016
Thanks Given: 5
Thanks Received: 1

I figured it out. Thanks for all your help and input.


Reply With Quote
  #3 (permalink)
 greekbroker 
Asheville, NC
 
Experience: Advanced
Platform: TS, IB, NinjaTrader
Trading: Stocks
Posts: 3 since Nov 2014
Thanks Given: 0
Thanks Received: 0


Hello, I purchased this indicator from John Carter, and it works great in both TradeStation and NinjaTrader; however, it will not give any signals in Bloodhound; any ideas? I'd like to pay someone to code it for me, unless it already exists somewhere for free! Thanks very much!


Reply With Quote
  #4 (permalink)
TW10
Denver CP/USA
 
Posts: 2 since Apr 2016
Thanks Given: 0
Thanks Received: 0

Can you share & post how you fixed your code?


Reply With Quote
  #5 (permalink)
Beamsplitter
Fayetteville,Arkansas
 
Posts: 4 since Jul 2016
Thanks Given: 5
Thanks Received: 1

low 21
declare upper;

def loday = lowest(low, 21 );



plot sigday = if( loday[1] == low[1] and close > high[1] ) or ( loday[2] == low[2] and close > high[2] ) or ( loday[3] == low[3] and close > high[3] ) or ( loday[4] == low[4] and close > high[4] ) then yes else Double.nan;
##

sigday.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);


sigday.SetDefaultColor(Color.GREEN);

****************************************************************************************
Hi 21


declare upper;
#input displace = 0;
def hiday = Highest(high, 21 );


#plot sigday = ( hiday[1] and close < low[1]) or ( hiday[2] and close < low[2]) ;
plot sigday = if( hiday[1] == high[1] and close < low[1] ) or ( hiday[2] == high[2] and close < low[2] ) or ( hiday[3] == high[3] and close < low[3] ) or ( hiday[4] == high[4] and close < low[4] ) then yes else Double.nan;
##

sigday.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);


sigday.SetDefaultColor(Color.GREEN);

This is the best I could do.


Reply With Quote




Last Updated on September 24, 2017


© 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