Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I've coded several PaintBar indicators in MultiCharts. However, I'm running in to a problem with this code. The issue is the PaintBar colors ONLY 2 Bars after the condition = True on the second bar. Currently the code is painting every bar that meets the condition. Obviously I'm not coding the condition correctly.
See Screenshot for Visual which has the Rules that my code obviously isn't defining the rules correctly. I've never had to write code that only #1 PaintsBars Two Bars when the condition is true for current bar and bar[1]. #2 Only Paints 2 Bars when condition is True and no Additional bars until the condition becomes False....Then it should start over and paint the next two consecutive bars when the condition is true again.
Rule: If Low and Low[1] > than SMA Then PlotPaintBar for only those 2 Bars. The condition can't be True again until the Low of a bar is <= the SMA....after that the condition/Rule bocomes Valid again to plot the PaintBars if Two bars meet the criteria.
Code is Below....I took out a few conditions to keep code simple and I couldn't remember if the TRH and TRL needed to stay in...
Thanks SOO Much for Your Help!!!
Can you help answer these questions from other members on NexusFi?
you need to check for the number of bars you allow to plot. In your code you could start a counter when Condition1 is true and as long as the counter <= 2 (or any other input) the paintbars are allowed to plot.
When Condition1 = false you set the counter back to 0.
you need to check for the number of bars you allow to plot. In your code you could start a counter when Condition1 is true and as long as the counter <= 2 (or any other input) the paintbars are allowed to plot.
When Condition1 = false you set the counter back to 0.