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
  #241 (permalink)  
Old 05-13-2007, 06:30 AM
Senior Member
 
Join Date: Feb 2007
Posts: 947
FerruFx is on a distinguished road
Thanks ryanklefas for your reply.

I try to understand this and see if i can do something by myself!

FerruFx
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #242 (permalink)  
Old 05-14-2007, 06:07 AM
ralph.ronnquist's Avatar
Senior Member
 
Join Date: Oct 2006
Posts: 280
ralph.ronnquist is on a distinguished road
I would guess that your EA eats up memory by creating "the same" label objects again and again. The culprit lines are then the ObjectCreate calls, like
PHP Code:
ObjectCreate("Trend_MAfast_5"OBJ_LABELWindowFind("xxxxxxx"), 00); 
I suggest you wrap those lines into conditional creation, like
PHP Code:
if ( ObjectFind"Trend_MAfast_5" ) == -) {
    
ObjectCreate("Trend_MAfast_5"OBJ_LABELWindowFind("xxxxxxx"), 00);

so that you re-use the existing objects if they are created already.

Do the same for all ObjectCreate.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #243 (permalink)  
Old 05-14-2007, 06:28 AM
Senior Member
 
Join Date: Feb 2007
Posts: 947
FerruFx is on a distinguished road
Thanks ralph.ronnquist!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #244 (permalink)  
Old 05-22-2007, 07:37 PM
forextrend's Avatar
Senior Member
 
Join Date: Nov 2005
Posts: 120
forextrend is an unknown quantity at this point
Thumbs up "buy limit order" and "sell limit order" code

Can someone post code for "buy limit order" and "sell limit order" that can be used in an EA.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #245 (permalink)  
Old 05-22-2007, 08:08 PM
Junior Member
 
Join Date: Dec 2006
Posts: 13
Flirrrt is on a distinguished road
OrderSend(Symbol(),OP_BUYLIMIT,lots,limitprice,sli ppage,stoploss,takeprofit,"comment",magic#,expirat ion_time,arrowcolor)

Replace OP_BUYLIMIT with OP_SELLLIMIT for the sell limit order.
Replace each word with the values you choose.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #246 (permalink)  
Old 05-23-2007, 05:49 PM
Member
 
Join Date: Jan 2007
Posts: 20
gm6510 is on a distinguished road
i need the code for this indicator!

hi all

i need the code for this indicator(ADX crossing)

i try this code

iADX(NULL, 0, 14, PRICE_CLOSE, MODE_MAIN,0);

but i think there is problem in
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #247 (permalink)  
Old 05-23-2007, 10:19 PM
Senior Member
 
Join Date: Dec 2006
Location: Ukraine
Posts: 491
Shinigami is on a distinguished road
double iADX( string symbol, int timeframe, int period, int applied_price, int mode, int shift)

this one?

double iADX( string symbol, int timeframe, int period, int applied_price, int mode, int shift)
Calculates the Movement directional index and returns its value.
Parameters:
symbol - Symbol the data of which should be used to calculate indicator. NULL means the current symbol.
timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.
period - Averaging period for calculation.
applied_price - Applied price. It can be any of Applied price enumeration values.
mode - Indicator line index. It can be any of the Indicators line identifiers enumeration value.
shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
Sample:

if(iADX(NULL,0,14,PRICE_HIGH,MODE_MAIN,0)>iADX(NUL L,0,14,PRICE_HIGH,MODE_PLUSDI,0)) return(0);


see http://docs.mql4.com/indicators/iADX for more
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #248 (permalink)  
Old 05-23-2007, 11:30 PM
Member
 
Join Date: Jan 2007
Posts: 20
gm6510 is on a distinguished road
hi Shinigami
i dont understand any thing!

can you give me the code for the indicator in Attachment?
Attached Files
File Type: zip ADX Crossing.zip (835 Bytes, 18 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #249 (permalink)  
Old 05-24-2007, 08:55 AM
Senior Member
 
Join Date: Dec 2006
Location: Ukraine
Posts: 491
Shinigami is on a distinguished road
There is no need in that. I posted the way you should use the iADX() function
If you don't code its okay not to understand. If you are trying to write an EA, you should be able to understand syntax...
I'll be a bit more specific (if you didn't look into that link)
usage:
iADX(NULL,0,14,PRICE_HIGH,MODE_MAIN,0
NULL as current symbol
0 - current time frame, you can use M1 M15 H4 or whichever you like, you need a window with that period open for running a forward test and quotes history for a backtest, see sticky threads for backtesting modeling quality.
14 - period in bars back from current bar. You calculate iADX for that period. In this example you use 14 bars back from this bar, current bar's number is 0(!)
PRICE_HIGH - Applied price constants. It can be any of the following values:
Constant Value Description
PRICE_CLOSE 0 Close price.
PRICE_OPEN 1 Open price.
PRICE_HIGH 2 High price.
PRICE_LOW 3 Low price.
PRICE_MEDIAN 4 Median price, (high+low)/2.
PRICE_TYPICAL 5 Typical price, (high+low+close)/3.
PRICE_WEIGHTED 6 Weighted close price, (high+low+close+close)/4.
(see http://docs.mql4.com/constants/prices)
MODE_MAIN - http://docs.mql4.com/constants/lines you'll find all the information there, hard to explain, never used it before. Basically its
Constant Value Description
MODE_MAIN 0 Base indicator line.
MODE_PLUSDI 1 +DI indicator line.
MODE_MINUSDI 2 -DI indicator line.
0 in the end is shift. If you wish not to use current bar to start calculations, but would like to shift back few bars, use this number. 5 will mean you ignore last 5 bars including current and start calculation of iADX based on 14 previous bars.



I hope that helps...
See links for more information, I just LOVE that resource.
Oh and the code there is colored just like in metaeditor, very useful!

And I really don't understand what you don't understand... Its pretty damn clear in the posted indicator and its quite simple too...

Last edited by Shinigami; 05-24-2007 at 08:57 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #250 (permalink)  
Old 05-25-2007, 08:47 PM
Senior Member
 
Join Date: May 2006
Posts: 722
robp is on a distinguished road
Trailing stop code needed

Does anyone have code for a good trailing stop? I'm looking for something that gets progressively tighter as it gets deeper in profit. Thanks.
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 12:20 PM.



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