Forex



Go Back   Forex Trading > Training > Metatrader > Metatrader 4 mql 4 - Development course > Questions
Forex Forum Register More recent Blogs Calendar Advertising Others Help






Register
Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.

From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.

Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
  • Elite Section
    Get access to private discussions, specialized support, indicators and trading systems reported every week.
  • Advanced Elite Section
    For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
See more

Reply
 
Thread Tools Display Modes
  #531 (permalink)  
Old 03-21-2007, 07:12 PM
iscuba11's Avatar
Senior Member
 
Join Date: May 2006
Location: Houston
Posts: 398
iscuba11 is on a distinguished road
Smile

Found my error!

Dave

Last edited by iscuba11; 03-21-2007 at 07:16 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #532 (permalink)  
Old 03-21-2007, 09:00 PM
iscuba11's Avatar
Senior Member
 
Join Date: May 2006
Location: Houston
Posts: 398
iscuba11 is on a distinguished road
Thumbs up

PHP Code:
double lowestFG=9999highestFG=-9999;
int currentBar=0;
int lastBar=4;
for(
currentBar=0;currentBar<lastBarcurrentBar++)
lowestFG=MathMin(lowestFGiCustom(NULL,0,"Forex-Grail Trade Indicator",period,PRICE_CLOSE,currentBar));
Print (
"Low  =",lowestFG); 
This reads from buffer ' 0 ' of the indicator [0.00 to positive] (Works OK!). How do I get it to read from buffer ' 1 ' of the indicator [0.00 to negative]?

Statement definition: double iCustom( string symbol, int timeframe, string name, ..., int mode, int shift) - No where does it call for a buffer number?????????????? PLEASE HELP!!!! It seems to be locked into buffer ' 0 '.


Please enlighten me!!

Dave

Last edited by iscuba11; 03-21-2007 at 11:20 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #533 (permalink)  
Old 03-21-2007, 11:09 PM
iscuba11's Avatar
Senior Member
 
Join Date: May 2006
Location: Houston
Posts: 398
iscuba11 is on a distinguished road
Smile Too many decimal places!! - Please advise.

How do I limit the amount of decimal places a comment statement shows on the graph. Right now it shows a variable result as .00347892, and I want it only to show .0035 (Rounded to the next number)??

Appreciate your input!

Dave
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #534 (permalink)  
Old 03-21-2007, 11:55 PM
Member
 
Join Date: Dec 2005
Posts: 68
asmdev is on a distinguished road
iCustom( string symbol, int timeframe, string name, ..., int mode, int shift)

'mode' is your buffer
iCustom( ... ...indicator parameters here ... , 0, currentBar) - will read from 0 buffer
iCustom( ... ...indicator parameters here ... , 1, currentBar) - will read from 1st buffer

some info here http://docs.mql4.com/indicators/iCustom


lowestFG=9999 should be OK but to be sure can write
lowestFG = iCustom(NULL,0,"Forex-Grail Trade Indicator",period,PRICE_CLOSE,1,currentBar) instead


DoubleToStr function(http://docs.mql4.com/convert/DoubleToStr) will limit # of decimal places, mostly used to get nice looking # fro Print or Alert function. The function will not round but simply cut off unneeded decimal places.

If you use your this double # to compare with another # you still have bunch of # after decimal point

use NormalizeDouble (http://docs.mql4.com/convert/NormalizeDouble) to limit number if decimal places permanently

according to your iCustom your indicator have 2 parameters period and price(PRICE_CLOSE), check if thats correct

Last edited by asmdev; 03-22-2007 at 12:06 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #535 (permalink)  
Old 03-22-2007, 12:18 AM
Member
 
Join Date: Dec 2005
Posts: 68
asmdev is on a distinguished road
Quote:
Originally Posted by iscuba11
This reads from buffer ' 0 ' of the indicator [0.00 to positive] (Works OK!).
it is coincidence that it works ok, If your FG indicator has 2 pameters (period & price) you need to add 1 more param in the iCustom like in prev post, if your FG indicator has 1 param(period) then replace PRICE_CLOSE with buffer #(0 or 1 or 2 or ...)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #536 (permalink)  
Old 03-22-2007, 12:27 AM
Member
 
Join Date: Dec 2005
Posts: 68
asmdev is on a distinguished road
possible solution for 0 buffer:

int currentBar=0;
double lowestFG=iCustom(NULL,0,"Forex-Grail Trade Indicator",period,PRICE_CLOSE,0, currentBar);
double highestFG = lowestFG;

for(;currentBar<4; currentBar++) lowestFG=MathMin(lowestFG, iCustom(NULL,0,"Forex-Grail Trade Indicator",period,PRICE_CLOSE,0,currentBar));

for(currentBar=0;currentBar<4; currentBar++) highestFG =MathMax(highestFG , iCustom(NULL,0,"Forex-Grail Trade Indicator",period,PRICE_CLOSE,0,currentBar));

you need to do all over again for buffer # 1
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #537 (permalink)  
Old 03-22-2007, 01:24 AM
Member
 
Join Date: Dec 2005
Posts: 68
asmdev is on a distinguished road
Quote:
Originally Posted by iscuba11
How do I limit the amount of decimal places a comment statement shows on the graph. Right now it shows a variable result as .00347892, and I want it only to show .0035 (Rounded to the next number)??

Appreciate your input!

Dave
function IndicatorDigits
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #538 (permalink)  
Old 03-22-2007, 02:29 AM
iscuba11's Avatar
Senior Member
 
Join Date: May 2006
Location: Houston
Posts: 398
iscuba11 is on a distinguished road
Smile

First of all, I would like to thank all of you for helping me. I believe I can now put my new EA on line for testing.

I still have a question on decimal places.

The comment statement is being generated from the EA and not the indicator. The function indicatordigits, I believe, is used in the indicator itself and not the ea. Is there not a simple rounding off up to x places of a variable that I could use. Why they make this language so complicated. Even basic language could probably do this!

As always appreciated, feedback of knowledge and wisdom is welcome. Please help if you can.

Thanks a bunch!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #539 (permalink)  
Old 03-22-2007, 03:01 AM
Member
 
Join Date: Dec 2005
Posts: 68
asmdev is on a distinguished road
I finally read your post correctly, try Comment(DoubleToStr(doubleVariable, 4));
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #540 (permalink)  
Old 03-22-2007, 03:42 AM
iscuba11's Avatar
Senior Member
 
Join Date: May 2006
Location: Houston
Posts: 398
iscuba11 is on a distinguished road
Smile

That did it! Now to tweak and test. You all blessed me - Thanks!

Peace and Love to all, in Jesus Name!

Reverend Dave
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
Reply

Bookmarks

Tags
forex, histogram, JMASlope, ToR 1.20, ZUP_v1.mq4


Currently Active Users Viewing This Thread: 2 (1 members and 1 guests)
mrdavid
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 Off
Forum Jump


All times are GMT. The time now is 01:07 PM.



Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.