NexusFi: Find Your Edge


Home Menu

 





I was wondering if there is a way to do the following -- (End result should be labels


Discussion in ThinkOrSwim

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




 
Search this Thread

I was wondering if there is a way to do the following -- (End result should be labels

  #1 (permalink)
strategynode
Provo utah/usa
 
Posts: 4 since Sep 2014
Thanks Given: 0
Thanks Received: 0

I was wondering if there is a way to do the following -- (End result should be labels)

I want to calculate the % move of each candle for say 12 bars and then 3 labels based on that data

Label for All bars (The numbers below is just for example purposes)
Between 10% - 5% = 3 out of 12
Between 5% - 2% = 5 out of 12
Less Than 2% = 4 out of 12

The color of the bar or direction doesn't really matter if we could do another set of labels based on the direction on top of the cumulative that would be really cool

Label for Green Bar
Total Green Bars ( 5 out of 12)
Between 10% - 5% = 1 out of 5
Between 5% - 2% = 2 out of 5
Less Than 2% = 2 out of 5

Label for Red Bar
Total Red Bars ( 7 out of 12)
Between 10% - 5% = 2 out of 7
Between 5% - 2% = 2 out of 7
Less Than 2% = 3 out of 7

Any guidance will be very helpful. Thank You.

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
Deepmoney LLM
Elite Quantitative GenAI/LLM
NexusFi Journal Challenge - April 2024
Feedback and Announcements
Better Renko Gaps
The Elite Circle
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
59 thanks
Funded Trader platforms
37 thanks
NexusFi site changelog and issues/problem reporting
22 thanks
GFIs1 1 DAX trade per day journal
22 thanks
The Program
19 thanks
  #2 (permalink)
 JayC 
San Diego, CA
 
Experience: Beginner
Platform: TOS, Sierra
Trading: Emini ES, Crude CL
Posts: 55 since Mar 2019
Thanks Given: 9
Thanks Received: 43

Something like this might work...

Jay

 
Code
input lowerThreshold = .02;
input upperThreshold = .10;
input length = 12;

def pctMove = AbsValue((close/open) - 1);

def largeMoves = sum(if pctMove > upperThreshold then 1 else 0, length);
def mediumMoves = sum(if pctMove >= lowerThreshold and pctMove <= upperThreshold then 1 else 0, length);
def smallMoves = sum(if pctMove < lowerThreshold then 1 else 0, length);

AddChartBubble(yes, high, AsPercent(pctMove));
AddLabel(yes, "Sm: " + smallMoves + " Md: " + mediumMoves + " Lg: " + largeMoves, Color.CYAN);

Reply With Quote
Thanked by:




Last Updated on May 6, 2021


© 2024 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 - Privacy Policy - Downloads - Top
no new posts