NexusFi: Find Your Edge


Home Menu

 





Swing high to swing high counter?


Discussion in MultiCharts

Updated
    1. trending_up 1,470 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?
Anyone Trading Equities using NT8?
NinjaTrader
convert to nt8
NinjaTrader
Top Pick Trading reviews?
Trading Reviews and Vendors
Time, Futures, Scalping, Treasurys
Treasury Notes and Bonds
What a Cool Draw/Markup Tool!
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Vinny E-Mini & Algobox Review TRADE ROOM
8 thanks
Futures spread trading grains education sources?
6 thanks
Just another trading journal: PA, Wyckoff & Trends
4 thanks
Wheres the videos?
3 thanks
Blue wave trading review
2 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,441 since Apr 2013
Thanks Given: 491
Thanks Received: 1,634


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 Twitter Reply With Quote
Thanked by:




Last Updated on July 28, 2022


© 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 - Sitemap - Downloads - Top
no new posts