Question about an indicator error

Darth Tradicus

Member
VIP
Hello, found a heikin ashi ribbon indicator on the forums that I've enjoyed using. Problem is it seems to take an extremely long time to load up on the chart. The code doesn't flag it as a 'complex script' in the editor. But I have been getting an error warning on the chart in regards to it- I'm not sure what it means or how to fix it. Here is the error and the indicator code:

"Color parameter outside of expected range: Green"

Code:
#Converted MT4 HeikinAshi_EntryExit Indicator
#MikeLikesAnacottSteel
#8-27-2022
#MT4 indicator source: https://forex-station.com/app.php/attach/file/3349947

input MaMethod1 = AverageType.EXPONENTIAL;
input MaPeriod = 40;
input MaMethod2 = AverageType.EXPONENTIAL;
input MaPeriod2 = 1;

def maOpen = MovingAverage(MaMethod1, Open, MaPeriod);
def maClose = MovingAverage(MaMethod1, Close, MaPeriod);
def maLow = MovingAverage(MaMethod1, Low, MaPeriod);
def maHigh = MovingAverage(MaMethod1, High, MaPeriod);

def haClose=(maOpen+maHigh+maLow+maClose)/4;
def haOpen=(GetValue(haOpen, 1)+GetValue(haClose, 1))/2;
def haHigh=Max(maHigh, Max(haOpen, haClose));
def haLow=Min(maLow, Min(haOpen, haClose));

def ExtMapBuffer7;
def ExtMapBuffer8;

if(haOpen<haClose)
{
ExtMapBuffer7=haLow;
ExtMapBuffer8=haHigh;
}
else
{
ExtMapBuffer7=haHigh;
ExtMapBuffer8=haLow;
}

def ExtMapBuffer5=haOpen;
def ExtMapBuffer6=haClose;

Plot ExtMapBuffer1 = MovingAverage(MaMethod2, ExtMapBuffer7, MaPeriod2);
Plot ExtMapBuffer2 = MovingAverage(MaMethod2, ExtMapBuffer8, MaPeriod2);
Plot ExtMapBuffer3 = MovingAverage(MaMethod2, ExtMapBuffer5, MaPeriod2);
Plot ExtMapBuffer4 = MovingAverage(MaMethod2, ExtMapBuffer6, MaPeriod2);

ExtMapBuffer1.SetDefaultColor(Color.RED);
ExtMapBuffer1.SetPaintingStrategy(PaintingStrategy.LINE);
ExtMapBuffer1.SetLineWeight(1);

ExtMapBuffer2.SetDefaultColor(Color.BLUE);
ExtMapBuffer2.SetPaintingStrategy(PaintingStrategy.LINE);
ExtMapBuffer2.SetLineWeight(1);

ExtMapBuffer3.SetDefaultColor(Color.RED);
ExtMapBuffer3.SetPaintingStrategy(PaintingStrategy.LINE);
ExtMapBuffer3.SetLineWeight(1);

ExtMapBuffer4.SetDefaultColor(Color.BLUE);
ExtMapBuffer4.SetPaintingStrategy(PaintingStrategy.LINE);
ExtMapBuffer4.SetLineWeight(1);

AddCloud(ExtMapBuffer1, ExtMapBuffer2, CreateColor(255,0,102), CreateColor(0, 102, 255));
AddCloud(ExtMapBuffer1, ExtMapBuffer4, CreateColor(255,0,102), CreateColor(0, 102, 255));
AddCloud(ExtMapBuffer2, ExtMapBuffer1, CreateColor(0, 1-2, 255), CreateColor(255,0,102));
AddCloud(ExtMapBuffer2, ExtMapBuffer3, CreateColor(0, 102, 255), CreateColor(255,0,102));
AddCloud(ExtMapBuffer3, ExtMapBuffer4, CreateColor(255,0,102), CreateColor(0, 102, 255));
 
Solution
Hello, found a heikin ashi ribbon indicator on the forums that I've enjoyed using. Problem is it seems to take an extremely long time to load up on the chart. The code doesn't flag it as a 'complex script' in the editor. But I have been getting an error warning on the chart in regards to it- I'm not sure what it means or how to fix it. Here is the error and the indicator code:

"Color parameter outside of expected range: Green"

Code:
#Converted MT4 HeikinAshi_EntryExit Indicator
#MikeLikesAnacottSteel
#8-27-2022
#MT4 indicator source: https://forex-station.com/app.php/attach/file/3349947

input MaMethod1 = AverageType.EXPONENTIAL;
input MaPeriod = 40;
input MaMethod2 = AverageType.EXPONENTIAL;
input MaPeriod2 = 1;

def maOpen =...
Hello, found a heikin ashi ribbon indicator on the forums that I've enjoyed using. Problem is it seems to take an extremely long time to load up on the chart. The code doesn't flag it as a 'complex script' in the editor. But I have been getting an error warning on the chart in regards to it- I'm not sure what it means or how to fix it. Here is the error and the indicator code:

"Color parameter outside of expected range: Green"

Code:
#Converted MT4 HeikinAshi_EntryExit Indicator
#MikeLikesAnacottSteel
#8-27-2022
#MT4 indicator source: https://forex-station.com/app.php/attach/file/3349947

input MaMethod1 = AverageType.EXPONENTIAL;
input MaPeriod = 40;
input MaMethod2 = AverageType.EXPONENTIAL;
input MaPeriod2 = 1;

def maOpen = MovingAverage(MaMethod1, Open, MaPeriod);
def maClose = MovingAverage(MaMethod1, Close, MaPeriod);
def maLow = MovingAverage(MaMethod1, Low, MaPeriod);
def maHigh = MovingAverage(MaMethod1, High, MaPeriod);

def haClose=(maOpen+maHigh+maLow+maClose)/4;
def haOpen=(GetValue(haOpen, 1)+GetValue(haClose, 1))/2;
def haHigh=Max(maHigh, Max(haOpen, haClose));
def haLow=Min(maLow, Min(haOpen, haClose));

def ExtMapBuffer7;
def ExtMapBuffer8;

if(haOpen<haClose)
{
ExtMapBuffer7=haLow;
ExtMapBuffer8=haHigh;
}
else
{
ExtMapBuffer7=haHigh;
ExtMapBuffer8=haLow;
}

def ExtMapBuffer5=haOpen;
def ExtMapBuffer6=haClose;

Plot ExtMapBuffer1 = MovingAverage(MaMethod2, ExtMapBuffer7, MaPeriod2);
Plot ExtMapBuffer2 = MovingAverage(MaMethod2, ExtMapBuffer8, MaPeriod2);
Plot ExtMapBuffer3 = MovingAverage(MaMethod2, ExtMapBuffer5, MaPeriod2);
Plot ExtMapBuffer4 = MovingAverage(MaMethod2, ExtMapBuffer6, MaPeriod2);

ExtMapBuffer1.SetDefaultColor(Color.RED);
ExtMapBuffer1.SetPaintingStrategy(PaintingStrategy.LINE);
ExtMapBuffer1.SetLineWeight(1);

ExtMapBuffer2.SetDefaultColor(Color.BLUE);
ExtMapBuffer2.SetPaintingStrategy(PaintingStrategy.LINE);
ExtMapBuffer2.SetLineWeight(1);

ExtMapBuffer3.SetDefaultColor(Color.RED);
ExtMapBuffer3.SetPaintingStrategy(PaintingStrategy.LINE);
ExtMapBuffer3.SetLineWeight(1);

ExtMapBuffer4.SetDefaultColor(Color.BLUE);
ExtMapBuffer4.SetPaintingStrategy(PaintingStrategy.LINE);
ExtMapBuffer4.SetLineWeight(1);

AddCloud(ExtMapBuffer1, ExtMapBuffer2, CreateColor(255,0,102), CreateColor(0, 102, 255));
AddCloud(ExtMapBuffer1, ExtMapBuffer4, CreateColor(255,0,102), CreateColor(0, 102, 255));
AddCloud(ExtMapBuffer2, ExtMapBuffer1, CreateColor(0, 1-2, 255), CreateColor(255,0,102));
AddCloud(ExtMapBuffer2, ExtMapBuffer3, CreateColor(0, 102, 255), CreateColor(255,0,102));
AddCloud(ExtMapBuffer3, ExtMapBuffer4, CreateColor(255,0,102), CreateColor(0, 102, 255));

Near the end of the script, there is an error in this line:
AddCloud(ExtMapBuffer2, ExtMapBuffer1, CreateColor(0, 1-2, 255), CreateColor(255,0,102));

1-2 is not an RGB number. Try making it 102 as per the other Cloud Colors. That should resolve your error.
 
Solution
Near the end of the script, there is an error in this line:
AddCloud(ExtMapBuffer2, ExtMapBuffer1, CreateColor(0, 1-2, 255), CreateColor(255,0,102));

1-2 is not an RGB number. Try making it 102 as per the other Cloud Colors. That should resolve your error.

Big thanks! I tested it and the chart loaded lightning fast, so that must have been what was bogging it down.
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
502 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top