• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • User/Email: Password:
  • 7:43pm
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 7:43pm
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

Need help, I can't get the value of the buffer using Icustom() 5 replies

Help on getting value from iCustom 5 replies

How to call value from H1 using iCustom ? 5 replies

icustom without indexbuffer value 4 replies

iCustom doesn't return correct value 12 replies

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe
Tags: iCustom Value with another value ?
Cancel

iCustom Value with another value ?

  • Post #1
  • Quote
  • First Post: Nov 1, 2011 11:23pm Nov 1, 2011 11:23pm
  •  wickedwin
  • | Joined Apr 2011 | Status: Member | 183 Posts
Hello there!

Quick question, I know there are a ton of these, but I hope someone cares enough to help me out.

My current EA logic looks like this;

Inserted Code
double signaldown=iCustom(Symbol(),0,"OS",2,1)
double signalup=iCustom(Symbol(),0,"OS",1,1)
(both value's 1 & 2 are a number).

Now;

- I only want signaldown to trigger if value 2 > 4

- I only want signalup not to trigger if value 1 > -4

How do I do this?

Sorry if i'm not clear enough, not typing in my mother-tongue.
  • Post #2
  • Quote
  • Nov 1, 2011 11:37pm Nov 1, 2011 11:37pm
  •  CodeMeister
  • Joined Sep 2009 | Status: Making Code While Making Pips | 1,672 Posts
1 and 2 in your iCustom() call refer to the indicator buffers 1 and 2. So just use

if (signaldown > 4) // do something

if (signalup <= -4) // do something
 
 
  • Post #3
  • Quote
  • Nov 2, 2011 10:04am Nov 2, 2011 10:04am
  •  wickedwin
  • | Joined Apr 2011 | Status: Member | 183 Posts
Quoting CodeMeister
Disliked
1 and 2 in your iCustom() call refer to the indicator buffers 1 and 2. So just use

if (signaldown > 4) // do something

if (signalup <= -4) // do something
Ignored
Thanks for the answer!

I tried this;

Inserted Code
int down=iCustom(Symbol(),0,"OS",2,1)
int up=iCustom(Symbol(),0,"OS",1,1)

if (down>4)
{double signaldown;
}

if (up<=-4)
{double signalup;
}

It doesn't give any errors when compiling, however it also doesn't trade (no errors in the log).

Is the code correct (should I look for the mistake elsewhere)?
 
 
  • Post #4
  • Quote
  • Nov 2, 2011 10:23am Nov 2, 2011 10:23am
  •  stevegee58
  • Joined Oct 2005 | Status: Pip Slappa Extrordinaire | 1,012 Posts
Are you positive that the values returned from iCustom are ever actually outside the range of -4 to +4?
You are in a maze of twisty little passages, all alike.
 
 
  • Post #5
  • Quote
  • Nov 2, 2011 10:28am Nov 2, 2011 10:28am
  •  wickedwin
  • | Joined Apr 2011 | Status: Member | 183 Posts
Quoting stevegee58
Disliked
Are you positive that the values returned from iCustom are ever actually outside the range of -4 to +4?
Ignored
Yes, I also tried lower values and tried using the current value (bar 0)
 
 
  • Post #6
  • Quote
  • Nov 2, 2011 10:47am Nov 2, 2011 10:47am
  •  CodeMeister
  • Joined Sep 2009 | Status: Making Code While Making Pips | 1,672 Posts
Exactly what values are returned?
 
 
  • Post #7
  • Quote
  • Nov 2, 2011 10:54am Nov 2, 2011 10:54am
  •  Lou G
  • Joined May 2006 | Status: Only one user name... | 1,367 Posts
Quoting wickedwin
Disliked
Thanks for the answer!

I tried this;

Inserted Code
int down=iCustom(Symbol(),0,"OS",2,1)
int up=iCustom(Symbol(),0,"OS",1,1)

if (down>4)
{double signaldown;
}

if (up<=-4)
{double signalup;
}
It doesn't give any errors when compiling, however it also doesn't trade (no errors in the log).

Is the code correct (should I look for the mistake elsewhere)?
Ignored
You are not assigning any values to signalup or signaldown...
Old Benjamin was right
 
 
  • Post #8
  • Quote
  • Nov 2, 2011 12:09pm Nov 2, 2011 12:09pm
  •  wickedwin
  • | Joined Apr 2011 | Status: Member | 183 Posts
You are right guys, the logic itself was all wrong.

Works like a charm now, thanks for the help!

Also congrats with the 1000 posts CodeMeister.
 
 
  • Post #9
  • Quote
  • Last Post: Edited 7:39pm Nov 2, 2011 3:39pm | Edited 7:39pm
  •  wickedwin
  • | Joined Apr 2011 | Status: Member | 183 Posts
-nvm-
 
 
  • Platform Tech
  • /
  • iCustom Value with another value ?
  • Reply to Thread
0 traders viewing now
Top of Page
  • Facebook
  • Twitter
About FF
  • Mission
  • Products
  • User Guide
  • Media Kit
  • Blog
  • Contact
FF Products
  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer
FF Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow FF
  • Facebook
  • Twitter

FF Sister Sites:

  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Forex Factory® is a brand of Fair Economy, Inc.

Terms of Service / ©2023