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

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

Request for help with my dashboard indicator 2 replies

Help adding another line and the MA label in TMS 10 EMA dashboard 0 replies

help wanted with dashboard modification 5 replies

Need help from coders with Dashboard indicator 0 replies

Help with Arbitrage Dashboard 8 replies

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe
Tags: Help with dashboard style indicator
Cancel

Help with dashboard style indicator

  • Post #1
  • Quote
  • First Post: Nov 12, 2009 4:16am Nov 12, 2009 4:16am
  •  pipmyride
  • | Joined Jan 2009 | Status: Member | 1,067 Posts
I have a simple dashboard indi i'm using to learn mql - it basically shows each pair and a comment whether price has crossed over a moving average.
Nothing rocket surgery about it, but i was using the following code and getting incorrect results with some pairs and i figured its probably because i'm using "Bid" and that expression takes the Bid on the current chart - not the pair that its using.

Inserted Code
double aMA  = iMA(aPair, 0, 10, 0, 1, PRICE_CLOSE, shift);

if (Bid>aMA) 
  text = "Over"
else if (Bid<aMA)
  text = "Under"

So, if "aPair" is GBPUSD for example, and GBPUSD is the pair that is open on this chart, then the code is fine.
However if "aPair" is EURUSD" but the chart is open to GBPUSD, i'm thinking the "Bid" function is getting the Bid of GBPUSD, and not EURUSD - is this correct ?

So what can go in place of Bid, so that it takes the price of the "aPair" that is passed in and not the current chart.

I hope that makes sense - dont worry about the poor code, i'm just having my first play with this.

Thx !
  • Post #2
  • Quote
  • Nov 12, 2009 7:40am Nov 12, 2009 7:40am
  •  hayseed
  • Joined Nov 2006 | Status: Member | 3,647 Posts
hey ride...... use market info.....h

Inserted Code
 
double bid   = MarketInfo(aPair,MODE_BID);
double aMA  = iMA(aPair, 0, 10, 0, 1, PRICE_CLOSE, shift);

if (bid>aMA) 
  text = "Over"
else if (bid<aMA)
  text = "Under"
to trade and code, keep both simple... no call to impress....h
 
 
  • Post #3
  • Quote
  • Last Post: Nov 12, 2009 9:19am Nov 12, 2009 9:19am
  •  pipmyride
  • | Joined Jan 2009 | Status: Member | 1,067 Posts
Quoting hayseed
Disliked
hey ride...... use market info.....h

Inserted Code
 
double bid   = MarketInfo(aPair,MODE_BID);
double aMA  = iMA(aPair, 0, 10, 0, 1, PRICE_CLOSE, shift);

if (bid>aMA) 
  text = "Over"
else if (bid<aMA)
  text = "Under"
Ignored
ur a star !

thx !
 
 
  • Platform Tech
  • /
  • Help with dashboard style indicator
  • 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