Forex Forum - EarnForex
Serving Traders Since 2005
 

Go Back   Forex Forum - EarnForex > MetaTrader > MetaTrader Indicators

MetaTrader Indicators Post and discuss the MetaTrader indicators here.

Reply
 
LinkBack Thread Tools Display Modes
  #21 (permalink)  
Old 25th January 2010, 10:41
Default Avatar
Junior Member
 
Join Date: Jan 2010
Location: italy
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Enivid View Post
1. With iMA() function you get only indicator handle, not the buffer. You should copy the buffer to get the actual vales:

MQL5 Code:
  double MA1Buffer[];
   CopyBuffer(MA1, 0, 0, rates_total, MA1Buffer);
  double MA2Buffer[];
   CopyBuffer(MA2, 0, 0, rates_total, MA2Buffer);

Do this inside your OnCalculate() handler.

2. Then you need compare the buffer values rather than handles when determining the arrow. You also need to give your arrow buffers the actual values rather than just stating them:
MQL5 Code:
 if (MA2Buffer[i]>MA1MABuffer[i]);
     {Arrow1[i] = MA2Buffer[i]; }
 
 if (MA2Buffer[i]<MA1Buffer[i]);
    {Arrow2[i] = MA2Buffer[i]; }

3. When you have this working you may want to modify this code to draw arrows only on MA cross, not on all bars, but I don't know if that's relevant for you.
I ask you favour Enivid:is possible you write the code correct completely why i cannot understand probably ...Thanks
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Murrey Math Line X Enivid MetaTrader Indicators 10 29th May 2011 10:34
Automatic Trend Line Alerts for MetaTrader 4 AutoTrader MetaTrader Expert Advisors 0 19th September 2009 15:34
Trend Line Indicator for MetaTrader 4 TrendLineTrader MetaTrader Indicators 0 11th September 2009 10:02
Gold Double Top SwingTrdr Technical Analysis 0 7th September 2009 06:21
Weekly Unemployment Claims In Line mercaforex Fundamental Analysis 0 23rd July 2009 11:00


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


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Inactive Reminders By Icora Web Design

SEO by vBSEO 3.3.2