You didn't post a topic yet. Let us show you how to make your first topic and upload your favorite forex robot. Guide me

Skip to forum content

The latest topics with attached files (Forex robots, Forex Indicators, etc..)

1

Forums in this category with details of Replies, Views, last post

Yellow Free EA

by t76ahmed

 


Login with Facebook Username:  Password:  Login  |  Register

Download over 10,000 FREE Forex Robots!

Pages 1

You must login or register to post a reply

RSS topic feed

Posts: 2
Please rate this topic
Current rating: 0
Votes: 0

Embed topic to your site

Finding Max/Min Indicator Values in Given Range

Topic: Finding Max/Min Indicator Values in Given Range

Hey, I am currently customizing an RVI indicator for eventual use in an EA.  I figured it would be easier to check my work if I can actually see the results before moving on to back-testing.

The basic idea is to take the last 300 bars of the RVI (an indicator without fixed max/min's) and determine & draw lines at RviMax, RviMin, RviMid (middle), and some other calculated levels.  Essentially I want to establish a recent RVI range without changing how the indicator naturally calculates/displays. This range should update in real-time, only changing if a new max/min is established (on bar close), or if the existing max/min turns older than 300 bars.

I think I am pretty close to the desired result.  The indicator will find the MaxRVI when loaded and will display that value in the buffer correctly for all previous bars up to 300.  However after the Max/Min's the values get a little crazy.  It seems for the very recent candles (about 0-30) RviMax will be set to ANY local peak (even if clearly below the actual 300 bar max) and will continue to post lower and lower values until it reaches 0.00.  Once the RVI returns to positive territory, RviMax begins to follow RVI back up again.
 
I cannot see why the actual max/min values in the array are ignored in favor of less extreme values for the most recent bars. I suspect this has something to do with how I set up the array (RVIArray) or with how I used ArrayMaximum/ArrayMinimum, but I can't say for sure. Does anyone have any idea?

I have attached the mql4 file and picture outlining the issue.

Post's attachments

image__6.png 183.77 kb, 11 downloads since 2018-02-07 

R_RVI.mq4 13.16 kb, 9 downloads since 2018-02-07 

Share

Re: Finding Max/Min Indicator Values in Given Range

After a closer look, it looks like the output in the Experts tab where I have all the data printing shows the correct value (or very close to it).  But the Data window shows incorrect data for the most recent bars. So i guess the real question is will an EA use the data-window values, or the buffer values in the log? My gut tells me the buffer values will be used, but since the variables being given for both are exactly the same I cannot say for sure. Any thoughts?
  

Print("MAX BAR ", RviMax_Bar);  //This Block prints all values to log
   Print("MIN BAR ", RviMin_Bar); 
   Print("RVI MAX ", RviMax);
   Print("RVI MIN ", RviMin);
   Print("RVI Range ",RviRange);
   Print("RVI ULimit ",RVI_UL);
   Print("RVI LLimit ",RVI_LL);
   Print("RVI MidLevel ",RVI_Mid);
  
   ExtRVI_MinBar_Buffer[x]=RviMin_Bar;  //This Block passes calculated values to buffers (not plotted)
   ExtRVI_MaxBar_Buffer[x]=RviMax_Bar;  
   ExtRVI_Max_Buffer[x]=RviMax;   
   ExtRVI_Min_Buffer[x]=RviMin;
   ExtRVI_UL_Buffer[x]=RVI_UL;  
   ExtRVI_LL_Buffer[x]=RVI_LL;    
   ExtRVI_Mid_Buffer[x]=RVI_Mid;

Share

Posts: 2

Download profitable Forex robots with the MT4talk Chrome Extension! Install Now 

Pages 1

You must login or register to post a reply


Download profitable Forex robots with the MT4talk Chrome Extension! Install Now 

NOTE: Cracks or other illegal versions of copyrighted forex robots are highly prohibited on MT4talk.com. If you upload any illegal version of any copyrighted forex robot, your forum account will be banned. No exceptions.

Forum statistics

  • Total number of registered users: 14,668
  • Newest registered user: signalforexku
  • Total number of topics: 10,459
  • Total number of posts: 35,339

Copyright MT4talk.com Forum Rules - Privacy Policy.