Forex
Google
New signals service!

Go Back   Forex Trading > Programming > Metatrader Programming


Register in Forex TSD!
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time).
Click here to register and get more information

Reply
 
LinkBack (1) Thread Tools Display Modes
  #1111 (permalink)  
Old 08-01-2008, 03:41 AM
Member
 
Join Date: Oct 2006
Posts: 71
Big Be is on a distinguished road
Rsi Ea

I do not see why you use the same variable to open and to close trades, but it may work.

This may be the problem:
"Order" is a global variable. So at the end of each run through the Start function it will be set to the last value it was assigned, and use that value for the beginning of the next run through. It you make it local (move it inside Start) it may fix it. Else you will have to reset it after last use of it.

Good Hunting,

Big Be
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1112 (permalink)  
Old 08-01-2008, 05:06 AM
Senior Member
 
Join Date: Feb 2007
Posts: 947
FerruFx is on a distinguished road
Quote:
Originally Posted by mifiglo View Post
Yeah thanks for offering to help, i have fixed the problem already, it was a problem with my indicator.
However i noticed that my EA doesn't trade according to the Buy or Sell Arrows, here's my EA code.
Thanks in advance for your prompt reply,
I am quite sure that your indicator repaints at least the current bar.

In your EA, in the iCustom() function you use the current bar (the last 0). Try to check the signal only at bar close (set the last number to 1). Then at the first tick of the new candle, if the arrow is still there (and not repaint), the trade won't be a false signal.

Note that I didn't checked it it repaints more than the current bar. But you get the idea.

FerruFx
__________________
THE HEART of FOREX & THE PROBABILITY METER - Trade with 100% confidence and ... Stress Less!!!
Coding services: Experts Advisors, indicators, alerts, etc ... more info by PM
NEW: video presentation of the Probability Meter ... 24hrs action on the website
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1113 (permalink)  
Old 08-01-2008, 01:03 PM
Member
 
Join Date: Oct 2006
Posts: 33
Kaper is on a distinguished road
Problem with Modifying Orders

I have a problem with an EA modifying orders from other EA's and Manual Trades. I use multiple EA's - some that modify the orders but the EA's that modify the orders take into account orders not associated with the EA. How can I have it only modify orders pretaining to a particular EA and not every order that is open for that currency. Thanks.

Kevin
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1114 (permalink)  
Old 08-01-2008, 01:32 PM
Kalenzo's Avatar
Senior Member
 
Join Date: Dec 2005
Location: Bydgoszcz - Poland
Posts: 696
Kalenzo is on a distinguished road
Quote:
Originally Posted by Kaper View Post
I have a problem with an EA modifying orders from other EA's and Manual Trades. I use multiple EA's - some that modify the orders but the EA's that modify the orders take into account orders not associated with the EA. How can I have it only modify orders pretaining to a particular EA and not every order that is open for that currency. Thanks.

Kevin
Hello!
Each ea can mark his orders by magic number. Use it to search in order pool for orders that you wish to be modified. In this case you can have other orders separated.
__________________
You need proffesional mql coder? Contact me! I will help you!
........................................
http://www.fxservice.eu/
........................................
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1115 (permalink)  
Old 08-01-2008, 02:09 PM
fungraphic's Avatar
Member
 
Join Date: Dec 2007
Posts: 37
fungraphic is on a distinguished road
I find coder

Hello,
I find coder for this.
Is there somebody who can develop a EA to calculate the pips month.
Look at the example below.



if i give you EA source code to count pip can you change it in order it can works for all brokers because from now on it only works for FXDD.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1116 (permalink)  
Old 08-01-2008, 02:49 PM
Linuxser's Avatar
Moderator
 
Join Date: May 2006
Location: Helliconia (Spring)
Posts: 3,319
Blog Entries: 46
Linuxser has disabled reputation
Hi fungraphic. I moved your post.

I know you must have some hurry bue there is not need to post same twice. If somebody is interest in help it would reply.
__________________
Elite Manual Trading | Portfolio | Calendar | Suggestions to improve the forum | My Blog

Remember: Signatures must have three lines as maximum
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1117 (permalink)  
Old 08-02-2008, 10:02 PM
Junior Member
 
Join Date: Dec 2007
Posts: 2
free is on a distinguished road
Smile Need Moving average stoploss code

I need code for using the moving average as a stoploss. The stoploss would change as the moving average changed so it would effectively be an adaptive stoploss based upon the moving average. Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1118 (permalink)  
Old 08-02-2008, 11:47 PM
Junior Member
 
Join Date: Dec 2007
Posts: 2
free is on a distinguished road
Tried this code. There will be a a static stop until the the price is above the moving averages for longs or below the moving average for shorts. Added code for a spread for the price of the last bar.

if(OrderType()==OP_BUY) // long position is opened
{
// check for trailing stop
if(TrailingStop>0&&(MaTrend<Low[1]-Spread*POINT))
{

OrderModify(OrderTicket(),OrderOpenPrice(),Trailin gStop,OrderTakeProfit(),0,Green);
return(0);

}
}
else // go to short position
{

if(TrailingStop>0&&(MaTrend>High[1]+Spread*POINT))
{

OrderModify(OrderTicket(),OrderOpenPrice(),Trailin gStop,OrderTakeProfit(),0,Red);
return(0);

}
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1119 (permalink)  
Old 08-03-2008, 08:08 AM
Administrator
 
Join Date: Sep 2005
Posts: 16,812
Blog Entries: 145
newdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud of
Quote:
Originally Posted by free View Post
I need code for using the moving average as a stoploss. The stoploss would change as the moving average changed so it would effectively be an adaptive stoploss based upon the moving average. Thanks
You may look inside the code of this EA EA_based Trailing Stop as an example.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1120 (permalink)  
Old 08-03-2008, 08:19 PM
willmalou's Avatar
Member
 
Join Date: Apr 2006
Posts: 36
willmalou is on a distinguished road
Rsi Ea

I have an ea that takes trades on a bar more than once. Is there any code that will allow only one trade per bar. EA attached.
Attached Files
File Type: mq4 RSI_Test.mq4 (10.9 KB, 10 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Tags
candle time, CHinGsMAroonCLK, coders guru, expert advisor, forex, how to code, I_XO_A_H, mechanical trading, trading

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

LinkBacks (?)
LinkBack to this Thread: http://www.forex-tsd.com/metatrader-programming/554-how-code.html
Posted By For Type Date
Need an experienced programmer? - Page 2 Post #0 Refback 09-24-2008 07:24 AM

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 09:39 AM.



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