molanis.com/forum - Tools for MetaTrader : The place to ask about the best expert advisor builder, expert advisor downloads, and expert advisor programming

AFTER YOU REGISTER SEND US AN EMAIL TO ACTIVATE YOUR ACCOUNT - Before posting:-1- Please read the user guide -2- Try the examples -3- Search in the forum
It is currently Tue May 14, 2024 9:23 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: calculation that divides one indicator by another
PostPosted: Fri Mar 23, 2012 6:45 pm 
Offline

Joined: Fri Mar 23, 2012 6:36 pm
Posts: 2
Hi

I am trying the demo

1. I am trying to create an indicator using something like the following calculation
iATR(NULL,0,100,i)/iATR(NULL,0,240,i) as a histogram in the lower panel but am getting no output

when i use just one iATR [i.e. iATR(NULL,0,240,i)] the histogram shows fine

am I doing something obvious wrong.

2. ultimately I would like to be able to color the histogram so that if the result of the calculation is below a certain level it would be one color and if above that level it woudl be a different color. Is it possible to code this in this software.

Thanks


Top
 Profile  
 
 Post subject: Re: calculation that divides one indicator by another
PostPosted: Mon Mar 26, 2012 4:28 pm 
Offline
Site Admin

Joined: Fri Oct 16, 2009 3:40 pm
Posts: 451
You may be getting errors since atr can take 0 values so you cannot divide by zero
Try this
iATR(NULL,0,100,i)/(iATR(NULL,0,240,i)+0.0000000001) - it won't affect the calculation and will fix the issue

You cannot color code one signal. In MT4 you cannot change the color of a signal (It's possible in mt5)
You think that the indicators change color because you see them changing. Metatrader uses a trick, it uses 2 signals with different colors and shows one or the other - this is the way you get two colors.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by Molanis © 2009