NexusFi: Find Your Edge


Home Menu

 





Swing high to swing high counter?


Discussion in MultiCharts

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




 
Search this Thread
  #1 (permalink)
 olobay 
Montreal
 
Experience: Intermediate
Platform: MultiCharts
Broker: DeepDiscountTrading.com
Trading: CL
Posts: 364 since Jul 2011

Does anyone have an indicator that plots the number of bars from swing high to swing high and from swing low to swing low? Or anything similar like that? Some type of bar counter?

Thanks.


Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
requesting .nrd replay files from 2026 spy and qqq
The Elite Circle
My Rant with AMP Futures
Trading Reviews and Vendors
Datafeed for Atas
Platforms and Indicators
No book, only a stair: journaling fills where price move …
Cryptocurrency
Trump Media to sell instant access to market-moving soci …
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
BERN ALGOS algo trading journal
3 thanks
NexusFi site changelog and issues/problem reporting
2 thanks
TopStep Trader disappointment
2 thanks
Want your NinjaTrader indicator created, free?
1 thanks
Running trading strategies on a VPS
1 thanks
  #2 (permalink)
 olobay 
Montreal
 
Experience: Intermediate
Platform: MultiCharts
Broker: DeepDiscountTrading.com
Trading: CL
Posts: 364 since Jul 2011

I found this code and modified it to plot the bar numbers. How can I get it to plot the difference between the bar numbers from swing high to swing high and swing low to swing low rather than the bar numbers?

 
Code
INPUTS: 
STR(3),
TXT(TRUE),
DEC(2);


VARS: check1(10);

IF CURRENTBAR >-1 THEN BEGIN
   check1 = 2 * str + 2;
   IF SWINGHIGHBAR(1,TRUEHIGH,str, check1) = str THEN BEGIN
        IF TXT then BEGIN
            VALUE1 = Text_New(D[str],T[str],H[str]+.25*truerange,
            NUMTOSTR(BarNumber[str],DEC));                                                                        
            VALUE2 = Text_SetStyle(VALUE1,2,1); 
        END;
    END;

    IF SWINGLOWBAR(1,TRUELOW, str,check1)=str THEN BEGIN
        IF TXT THEN BEGIN
            VALUE1 = Text_New(D[str],T[str],L[str]-.25*truerange,
            NUMTOSTR(BarNumber[str],DEC));
            VALUE2 = Text_SetStyle(VALUE1,2,0); 
        END;
       END; 
       END;


Started this thread Reply With Quote
  #3 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,448 since Apr 2013
Thanks Given: 494
Thanks Received: 1,643


Hi olobay,

you could for example store the bar number when you are detecting a new swing high/low and at the next swing high/low you can compute the difference using the value stored in the variable (just make sure to overwrite the value only after you computed the difference).
Another approach could be calling the functions again, but setting the Instance parameter to 2. Then you can compute the difference between the two function return values.

Regards,

ABCTG


olobay View Post
I found this code and modified it to plot the bar numbers. How can I get it to plot the difference between the bar numbers from swing high to swing high and swing low to swing low rather than the bar numbers?

 
Code
INPUTS: 
STR(3),
TXT(TRUE),
DEC(2);


VARS: check1(10);

IF CURRENTBAR >-1 THEN BEGIN
   check1 = 2 * str + 2;
   IF SWINGHIGHBAR(1,TRUEHIGH,str, check1) = str THEN BEGIN
        IF TXT then BEGIN
            VALUE1 = Text_New(D[str],T[str],H[str]+.25*truerange,
            NUMTOSTR(BarNumber[str],DEC));                                                                        
            VALUE2 = Text_SetStyle(VALUE1,2,1); 
        END;
    END;

    IF SWINGLOWBAR(1,TRUELOW, str,check1)=str THEN BEGIN
        IF TXT THEN BEGIN
            VALUE1 = Text_New(D[str],T[str],L[str]-.25*truerange,
            NUMTOSTR(BarNumber[str],DEC));
            VALUE2 = Text_SetStyle(VALUE1,2,0); 
        END;
       END; 
       END;


Follow me on X Reply With Quote
Thanked by:




Last Updated on July 28, 2022


© 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