NexusFi: Find Your Edge


Home Menu

 





barssinceentry equivalent


Discussion in MultiCharts

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




 
Search this Thread

barssinceentry equivalent

  #1 (permalink)
 
tradingest's Avatar
 tradingest 
Milan, Italy
 
Experience: Master
Platform: NT8
Trading: Futures, Forex
Posts: 111 since Dec 2014
Thanks Given: 9
Thanks Received: 11

Hi all,

what is the equivalent function to count the bar in the indicator?
The barssinceentry is valid only for signal.

Thanks

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
How to apply profiles
Traders Hideout
ZombieSqueeze
Platforms and Indicators
Increase in trading performance by 75%
The Elite Circle
Trade idea based off three indicators.
Traders Hideout
PowerLanguage & EasyLanguage. How to get the platfor …
EasyLanguage Programming
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
30 thanks
Spoo-nalysis ES e-mini futures S&P 500
28 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
20 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #2 (permalink)
 tpredictor 
North Carolina
 
Experience: Beginner
Platform: NinjaTrader, Tradestation
Trading: es
Posts: 644 since Nov 2011

Try array referencing CurrentBar? or use array references i.e. Close[x]. I'm not using Powerlanguage at the moment. So, this may not be exactly correct.

If you have a signal then you can use Highest(Close,5) >= 1 for example to look for a signal or something like Highest(MyIndi, 5) >=1. This would tell you if had a signal within the most recent 5 bars. If you wanted the actual bar you might try something like HighestBar.

Reply With Quote
  #3 (permalink)
 
tradingest's Avatar
 tradingest 
Milan, Italy
 
Experience: Master
Platform: NT8
Trading: Futures, Forex
Posts: 111 since Dec 2014
Thanks Given: 9
Thanks Received: 11


It's no correct sorry...I want to count the bar for an indicator and not signal.

Started this thread Reply With Quote
  #4 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,433 since Apr 2013
Thanks Given: 481
Thanks Received: 1,627

tradingest,

I am afraid your description doesn't really explain what you want to count exactly. Going by your question the correct answer would be "use currentbar". However I suppose you want to count the bars since the indicator did something, but without knowing that, it's hard to help you.

I would suggest to describe what you want the code to do with more detail and include screenshots showing what you are looking for, too. This should make it possible for other to understand what you have in mind.

Regards,

ABCTG

Follow me on Twitter Reply With Quote
  #5 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,433 since Apr 2013
Thanks Given: 481
Thanks Received: 1,627

Seeing that you asked the same question here https://www.multicharts.com/discussion/viewtopic.php?t=50448,
it might make sense to concentrate on just one thread.

Regards,

ABCTG

Follow me on Twitter Reply With Quote
  #6 (permalink)
 
tradingest's Avatar
 tradingest 
Milan, Italy
 
Experience: Master
Platform: NT8
Trading: Futures, Forex
Posts: 111 since Dec 2014
Thanks Given: 9
Thanks Received: 11


ABCTG View Post
tradingest,

I am afraid your description doesn't really explain what you want to count exactly. Going by your question the correct answer would be "use currentbar". However I suppose you want to count the bars since the indicator did something, but without knowing that, it's hard to help you.

I would suggest to describe what you want the code to do with more detail and include screenshots showing what you are looking for, too. This should make it possible for other to understand what you have in mind.

Regards,

ABCTG

for example begin to count when the sma cross above the price until the sma cross below the price. How many bars there are?

How I can to count?

thx

Sent using the NexusFi mobile app

Started this thread Reply With Quote
  #7 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,433 since Apr 2013
Thanks Given: 481
Thanks Received: 1,627

tradingest,

use a variable that you reset to 0 (or 1) everytime the SMA crosses above the price and increment the variable on every new bar (or at the end of every bar) until the SMA crosses below price.
Now this variable will hold the number of bars that the SMA was above the price for this swing.

Another approach would be to store the bar number (using CurrentBar for example) in a variable when the SMA crosses above the price and when the SMA crosses below price you compute the difference between CurrenBar and the value of the variable.

Regards,

ABCTG

Follow me on Twitter Reply With Quote
  #8 (permalink)
 
tradingest's Avatar
 tradingest 
Milan, Italy
 
Experience: Master
Platform: NT8
Trading: Futures, Forex
Posts: 111 since Dec 2014
Thanks Given: 9
Thanks Received: 11

thanks so much ABCTG. I try to second approach

Sent using the NexusFi mobile app

Started this thread Reply With Quote
Thanked by:
  #9 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,433 since Apr 2013
Thanks Given: 481
Thanks Received: 1,627

tradingest,

you are welcome.

Regards,

ABCTG

Follow me on Twitter Reply With Quote




Last Updated on January 18, 2017


© 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