[tos] Define bodyheight of green candles only? - futures io
futures io futures trading



[tos] Define bodyheight of green candles only?


Discussion in ThinkOrSwim

Updated
      Top Posters
    1. looks_one rmejia with 5 posts (4 thanks)
    2. looks_two Massive l with 4 posts (0 thanks)
    3. looks_3 growex with 4 posts (4 thanks)
    4. looks_4 givemethenews99 with 1 posts (0 thanks)
    1. trending_up 3,910 views
    2. thumb_up 8 thanks given
    3. group 3 followers
    1. forum 12 posts
    2. attach_file 7 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
 

[tos] Define bodyheight of green candles only?

(login for full post details)
  #1 (permalink)
Legendary Market Wizard
Portland, OR
 
Experience: None
 
Massive l's Avatar
 
Posts: 1,977 since Mar 2011
Thanks: 1,642 given, 3,993 received

Any ideas? I can't seem to nail it down. Seems simple enough though.

Visit my futures io Trade Journal Started this thread Reply With Quote

Can you help answer these questions
from other members on futures io?
Which kind of Blockvolume is visible? - order processing
Emini and Emicro Index
OFA (Order Flow Analytics) Licence
NinjaTrader
Indicators for pair trading MES and M2K
Platforms and Indicators
SimplerOptions
Trading Reviews and Vendors
NT8 indicator to simulate a Funding Evaluation where to …
NinjaTrader
 
 
(login for full post details)
  #2 (permalink)
Legendary Market Wizard
Portland, OR
 
Experience: None
 
Massive l's Avatar
 
Posts: 1,977 since Mar 2011
Thanks: 1,642 given, 3,993 received

@rmejia

Any thoughts on this?

Visit my futures io Trade Journal Started this thread Reply With Quote
 
(login for full post details)
  #3 (permalink)
Puerto Rico
 
Experience: Intermediate
Platform: thinkorswim
Broker: TD Ameritrade
Trading: ES
 
rmejia's Avatar
 
Posts: 377 since Oct 2010
Thanks: 3,600 given, 432 received


Is it only for the last candle or for a series of them; for the last one if close>open would be green then close-open should give the body size. Would need a [1] to go back but it would be moving so once another green one comes up it would change the last given green candle size data.

Reply With Quote
 
(login for full post details)
  #4 (permalink)
Legendary Market Wizard
Portland, OR
 
Experience: None
 
Massive l's Avatar
 
Posts: 1,977 since Mar 2011
Thanks: 1,642 given, 3,993 received

I want them added up over a period.

This is what I have. This is green - red.
I want total bodyheight of green for n periods divided by bodyheight of red for n periods

declare lower;
input length = 70;
def green = close > open;
def red = close < open;
def bodyheight = BodyHeight();
plot difference1 = sum(green, length) / Sum(red, length);
PLOT ZeroLine = 1;

Visit my futures io Trade Journal Started this thread Reply With Quote
 
(login for full post details)
  #5 (permalink)
Puerto Rico
 
Experience: Intermediate
Platform: thinkorswim
Broker: TD Ameritrade
Trading: ES
 
rmejia's Avatar
 
Posts: 377 since Oct 2010
Thanks: 3,600 given, 432 received

It's counting something, not sure what it is tho. Was looking for info on counting or series but not much in the thinkscript manual.

Maybe something on this thread can help:
Login | ThinkScripter

Have you looked in the yahoo thinkscript group? There is a crazy amount of info there, best free resource for thinkscript ideas imo.

Reply With Quote
The following user says Thank You to rmejia for this post:
 
(login for full post details)
  #6 (permalink)
Legendary Market Wizard
Portland, OR
 
Experience: None
 
Massive l's Avatar
 
Posts: 1,977 since Mar 2011
Thanks: 1,642 given, 3,993 received

It's just taking the sum of all the green candles and dividing it by the sum of the red.
I need the sum of the bodyheight of the green / red.

I'll check yahoo but probably not going to see much. I've already googled it many times.

Visit my futures io Trade Journal Started this thread Reply With Quote
 
(login for full post details)
  #7 (permalink)
Puerto Rico
 
Experience: Intermediate
Platform: thinkorswim
Broker: TD Ameritrade
Trading: ES
 
rmejia's Avatar
 
Posts: 377 since Oct 2010
Thanks: 3,600 given, 432 received

Tried something but it fails on an issue I don't know how, or if possible, with thinkorswim, which is to define specific bars:
plot GreenSum = if green then sum(bodyheight(), length) else double.nan;
plot RedSum = if red then sum(bodyheight(), length) else double.nan;

The issue is the:
def green = close > open;
def red = close < open;

Is checking for the actual live price, so the condition is if right now price is green then plot. Don't know how to reference back historical green and red bars.

Reply With Quote
The following user says Thank You to rmejia for this post:
 
(login for full post details)
  #8 (permalink)
Trubchevsk
 
Experience: Beginner
Platform: tos
Trading: stocks
 
Posts: 61 since May 2011
Thanks: 38 given, 79 received

As i'm russian, i can't have a thinkorswim account anymore...my one was banned totally two days ago...
Ok mates...i can not test it but try this recursive fold statement.

input length = 70;
def green = fold i=0 to length with n = 0 do if getvalue(close-open,i length-1)>0 then n+close-open else n;
def red = fold j=0 to length with k = 0 do if getvalue(close-open,j length-1)<0 then k+open-close else k;
plot ratio = green/red;

Please let me know if it works

Follow me on Twitter Reply With Quote
The following user says Thank You to growex for this post:
 
(login for full post details)
  #9 (permalink)
Puerto Rico
 
Experience: Intermediate
Platform: thinkorswim
Broker: TD Ameritrade
Trading: ES
 
rmejia's Avatar
 
Posts: 377 since Oct 2010
Thanks: 3,600 given, 432 received

Sorry to hear they are not letting you log into your thinkorswim account.

Pasted the code but getting this:

Reply With Quote
 
(login for full post details)
  #10 (permalink)
Trubchevsk
 
Experience: Beginner
Platform: tos
Trading: stocks
 
Posts: 61 since May 2011
Thanks: 38 given, 79 received



rmejia View Post
Sorry to hear they are not letting you log into your thinkorswim account.

Pasted the code but getting this:



ok...got it...
getvalue(close-open,i,length-1)

there's a comma missed after "i" and "j" in getvalue function

Follow me on Twitter Reply With Quote
The following user says Thank You to growex for this post:
 
(login for full post details)
  #11 (permalink)
Puerto Rico
 
Experience: Intermediate
Platform: thinkorswim
Broker: TD Ameritrade
Trading: ES
 
rmejia's Avatar
 
Posts: 377 since Oct 2010
Thanks: 3,600 given, 432 received

I put in labels with the parameters, getting these results:

Attached Thumbnails
Click image for larger version

Name:	1.png
Views:	73
Size:	62.4 KB
ID:	141333   Click image for larger version

Name:	2.png
Views:	60
Size:	71.7 KB
ID:	141334   Click image for larger version

Name:	3.png
Views:	65
Size:	73.6 KB
ID:	141335   Click image for larger version

Name:	4.png
Views:	48
Size:	71.4 KB
ID:	141336   Click image for larger version

Name:	5.png
Views:	64
Size:	70.3 KB
ID:	141337   Click image for larger version

Name:	6.png
Views:	61
Size:	71.1 KB
ID:	141338  
Reply With Quote
The following 2 users say Thank You to rmejia for this post:
 
(login for full post details)
  #12 (permalink)
Trubchevsk
 
Experience: Beginner
Platform: tos
Trading: stocks
 
Posts: 61 since May 2011
Thanks: 38 given, 79 received

input length = 70;
def green = fold i=0 to length with n = 0 do if getvalue(close-open,i, length)>0 then n+(close-open) else green[1];
def red = fold j=0 to length with k = 0 do if getvalue(open-close,j, length)<0 then k+(open-close) else red[1];
plot ratio =(green-red);

Follow me on Twitter Reply With Quote
The following 2 users say Thank You to growex for this post:
 
(login for full post details)
  #13 (permalink)
New Zealand
 
 
Posts: 2 since Dec 2020
Thanks: 0 given, 0 received

Hi

I am new to this forum.

I am using this script to locate candles 15 cent or greater in size with volume over 100 shares per minute.

input cents = 15;
input volpermin=100;

def green = close > open;
def today = GetDay() == GetLastDay();
def count = if green and today and high - low >= (cents / 100) then count[1] + 1 else count[1];
def con= green and today and high - low >= (cents / 100) and volume>=volpermin;
plot scan=con[1] or con;

It does not correctly capture all candles of 15 cents in premarket scans.

How would you rewrite this using the bodyheight command identitfying candles of 15 cents or more?

Cheers

Reply With Quote


futures io Trading Community Platforms and Indicators ThinkOrSwim > [tos] Define bodyheight of green candles only?


Last Updated on December 30, 2020


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

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

March
 

Importance of Finding Your Own Way w/Adam Grimes

Elite only
 

Journal Challenge w/Jigsaw

April
     



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