NexusFi: Find Your Edge


Home Menu

 





Swing high to swing high counter?


Discussion in MultiCharts

Updated
    1. trending_up 1,973 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?
UCL Final Kicks Off at Noon ET: PSG at 56.5% as Iran May …
Prediction Markets & Event Contracts
One Wallet Made $200K in Hours: AP Probes Polymarket Cea …
Prediction Markets & Event Contracts
Iran and Israel Stand Down: What $9M in Peace Contracts …
Prediction Markets & Event Contracts
Al Arabiya: US-Iran Draft Deal Within Hours Contains Hor …
Prediction Markets & Event Contracts
GDP Day: The First Economic Reckoning -- Pahlavi at 6.55 …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
The Pivot Point 113.6³ — Navigating the Prediction of …
26 thanks
Sober Journey With S&P
17 thanks
The Confluence Meter: A Multi-Layered Signal Framework B …
11 thanks
NT8 color choices
10 thanks
Volume Indicators
7 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,447 since Apr 2013
Thanks Given: 493
Thanks Received: 1,639


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