Forex



Go Back   Forex Trading > Programming > MetaTrader
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
  #1031 (permalink)  
Old 06-16-2008, 05:09 PM
mladen's Avatar
Senior Member
 
Join Date: Oct 2006
Posts: 1,269
mladen is on a distinguished road
...

Metatrader takes arguments for trigonometric functions in radians
You should do something like this :
PHP Code:
#define Pi 3.141592653589793238462643
   
   
MathCos(10.00*Pi/180.00); 
Quote:
Originally Posted by graemenash View Post
Hi,

I am currently coding up in indicator which uses the MathCos function in MQL.

The problem is that it seems to be returning an incorrect value.

For example,
PHP Code:
MathCos(10); 
returns a value of -0.8391, while the TradeStation COSINE function, and the web-based cosine calculator at Basic Maths Functions both return a value of 0.9848.

Is this a known bug? My indicator can't be written unless this function works correctly so I hope there is a solution!

Thanks
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
  #1032 (permalink)  
Old 06-16-2008, 07:25 PM
TheRumpledOne's Avatar
Banned
 
Join Date: Nov 2006
Posts: 802
TheRumpledOne is an unknown quantity at this point
define a global variable pBars

int pBars = -1 ;

Code:
if(pBars != Bars) {  // only once per bar
if (  
Close[1] == Open[1]&& //DOJI 
flgrs==0)
{
alertdoji = 1;
flgrs=1;
}
else
{
flgrs=0;
}
pBars = Bars ; // assign pBars
}// end if pBars
See if that helps.
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
  #1033 (permalink)  
Old 06-17-2008, 12:24 PM
Junior Member
 
Join Date: Dec 2005
Posts: 11
graemenash is on a distinguished road
Line colour

Hi again

I am creating an indicator which draws a line across the chart (in a similar way to a moving average does).

The line is plotted with values taken from a buffer.

I'd like the line to be drawn green if the value on the current bar is higher than the value on the previous bar, and red if it is lower.

How can I do this?

Thanks in advance for any help.
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
  #1034 (permalink)  
Old 06-17-2008, 12:27 PM
Junior Member
 
Join Date: Dec 2005
Posts: 11
graemenash is on a distinguished road
Basically I'd like it to look like this:
Attached Images
File Type: gif line.gif (6.7 KB, 154 views)
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
  #1035 (permalink)  
Old 06-17-2008, 12:36 PM
Junior Member
 
Join Date: Dec 2005
Posts: 11
graemenash is on a distinguished road
Why did my last post get moved from the main programming forum to the end of this thread?

(Thanks for the MathCos help too guys!)
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
  #1036 (permalink)  
Old 06-17-2008, 01:14 PM
Junior Member
 
Join Date: Dec 2005
Posts: 11
graemenash is on a distinguished road
Above problem has been solved
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
  #1037 (permalink)  
Old 06-18-2008, 11:43 AM
Junior Member
 
Join Date: Jun 2007
Posts: 3
xfiles is on a distinguished road
Modification of EA

Hi,

At the moment ea : boincinPipEA_BigBear_nonlagdot uses as a main indicator : NonLagZigZag_v2 and ZigZag Pointer , and as a filter nonlagdot.

Is it posible to delate NonLagZigZag_v2 and ZigZag Pointer from source code and make nonlagdot main indicator?

Im not good in programming, any idea what to change?

Thank you for your help.
Attached Files
File Type: mq4 boincinPipEA_BigBear_nonlagdot.mq4 (7.8 KB, 22 views)
File Type: mq4 nonlagdot.mq4 (4.7 KB, 16 views)
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
  #1038 (permalink)  
Old 06-18-2008, 12:48 PM
mladen's Avatar
Senior Member
 
Join Date: Oct 2006
Posts: 1,269
mladen is on a distinguished road
Thumbs up just a thought

That picture from tradestation shows an interesting thing to us complaining at Metatrader problems : basically in tradestation if you are trying to simply apply a color to a current bar it is going to work OK in all the modes (histo, point, cross, ... all the styles tradestation knows) EXCEPT line style. If you try to change the color in a line style the color change is going to lag one bar and in order to make it properly source must be changed (in the case of that picture to something like this
PHP Code:
if Value1>Value1[1then
        SetPlotColor
[1](1,Green)
else    
SetPlotColor[1](1,red); 
meaning, you have to change the color of the PREVIOUS bar
this peace of code also means that you can not change the style from line style because then the color is going to FORECAST the change and thus it will make it a classical case of repainting indicator

so every coding language has its problems, and maybe we should simply find solutions in our environment (solutions are there, all we have to do is to find them out)



Quote:
Originally Posted by graemenash View Post
Basically I'd like it to look like this:
Attached Images
File Type: gif ts lines.gif (6.7 KB, 194 views)

Last edited by mladen; 06-18-2008 at 01:05 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
  #1039 (permalink)  
Old 06-18-2008, 01:19 PM
Senior Member
 
Join Date: Nov 2006
Posts: 308
luxinterior is on a distinguished road
Quote:
Originally Posted by mladen View Post
every coding language has its problems, and maybe we should simply find solutions in our environment (solutions are there, all we have to do is to find them out)
Nice comment! Totally agree.

Lux
__________________
Build An Expert Advisor. FREE E-course As Seen On TV
ForexArea.com
Users of Gap Trader from 'Forex-Assistant' MUST Read This
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
  #1040 (permalink)  
Old 06-20-2008, 10:23 AM
Junior Member
 
Join Date: Jun 2008
Posts: 9
panteraschoice is on a distinguished road
close all after certain % profit

hi,

I want to close all trades if % gain is achieved on a weekly base.
So I need to know the accountbalance sundayevening 24.00 - no problem.
I need to know equity on sundayevening 24.00 - no problem.
But how do I store these? And how to let the ea read these values, for if there is a powerbreakdown the ea will have to start again and have to read the values from the stored place.
I know how to do this in VB, but how do I do this in mql?
I would be gratefull if someone can point that out.
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
#include, candle time, CHinGsMAroonCLK, code, coders guru, conditionally, dll, eli hayun, Eur_harvester.ex4, expert adviser, expert advisor, forex, higher high, how to code, indicator, I_XO_A_H, kehedge, mechanical trading, metatrader command line, mt4, MT4-LevelStop-Reverse, OrderReliable.mqh, programming, rectangle tool, trading, volty channel stop


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 Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to code this? iscuba11 Metatrader 4 mql 4 - Development course 1 08-03-2007 05:22 PM


All times are GMT. The time now is 10:11 PM.



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