Forex Forum - EarnForex
Serving Traders Since 2005
 

Go Back   Forex Forum - EarnForex > MetaTrader > MetaTrader 5

MetaTrader 5 MT5 is already out of its beta stage, but the development is ongoing. Some brokers already offer real accounts and the interest of traders is growing. You can discuss anything related to MetaTrader 5 in this forum.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 1st November 2011, 00:15
Default Avatar
Senior Member
 
Join Date: Aug 2011
Posts: 115
Thanks: 0
Thanked 0 Times in 0 Posts
Default custom indicator

Hi

A custom indicator I built plots the correct line data on the screen but plots random values in the rest of the chart where I do not expect it to plot any thing.
How can this be fixed?

many thx
Reply With Quote
  #2 (permalink)  
Old 1st November 2011, 11:07
Enivid's Avatar
Administrator
 
Join Date: Nov 2008
Posts: 1,545
Thanks: 18
Thanked 20 Times in 16 Posts
Default

Do you initialize indicator plot with EMPTY_VALUE?
__________________
Please, read the Forum Rules and the Signature Rules to avoid termination of your account.
Reply With Quote
  #3 (permalink)  
Old 1st November 2011, 14:12
Default Avatar
Senior Member
 
Join Date: Aug 2011
Posts: 115
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Enivid View Post
Do you initialize indicator plot with EMPTY_VALUE?
MQL5 Code:
int OnInit()
  {

   SetIndexBuffer(0,myInd,INDICATOR_DATA);
   PlotIndexSetDouble(0,PLOT_EMPTY_VALUE,EMPTY_VALUE);  
}

as well as and in addition to;

MQL5 Code:
int OnCalculate(const int rates_total,
                const int ...

   PlotIndexSetDouble(0,PLOT_EMPTY_VALUE,EMPTY_VALUE);

for no avail.
Reply With Quote
  #4 (permalink)  
Old 1st November 2011, 16:39
Enivid's Avatar
Administrator
 
Join Date: Nov 2008
Posts: 1,545
Thanks: 18
Thanked 20 Times in 16 Posts
Default

I don't think that adding PlotIndexSetDouble(0,PLOT_EMPTY_VALUE,EMPTY_VALUE) ; to OnCalculate() is a good idea. Again, seeing the whole code would help here.
__________________
Please, read the Forum Rules and the Signature Rules to avoid termination of your account.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Try my custom EA for free! silvrmoon1 Advertisements 0 27th July 2010 08:00
Custom MovingAverage for MT5 fxwalb MetaTrader Indicators 3 31st January 2010 08:12
RSI Signal (Buy\Sell Indicator) - GREAT signal indicator MechXTrader MetaTrader Indicators 0 25th September 2009 08:34


All times are GMT. The time now is 10:57.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Inactive Reminders By Icora Web Design

SEO by vBSEO 3.3.2