NexusFi: Find Your Edge


Home Menu

 





Swing high to swing high counter?


Discussion in MultiCharts

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




 
Search this Thread

Swing high to swing high counter?

  #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?
Trade idea based off three indicators.
Traders Hideout
OrderFlow-Based Support/Resistance Levels
Emini and Emicro Index
MC PL editor upgrade
MultiCharts
Quantum physics & Trading dynamics
The Elite Circle
REcommedations for programming help
Sierra Chart
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
22 thanks
Funded Trader platforms
21 thanks
Trading with Intuition
17 thanks
ApexTraderFunding.com experience and review
12 thanks
GFIs1 1 DAX trade per day journal
9 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,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629


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