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
  #1041 (permalink)  
Old 06-21-2008, 01:12 PM
darkkiller's Avatar
Senior Member
 
Join Date: Jul 2007
Location: Malaysia
Posts: 207
darkkiller is on a distinguished road
ops,i already found the source code.Got it from here
Waddah Attar Dayly CAMERILLA - MQL4 Code Base
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1042 (permalink)  
Old 06-26-2008, 08:16 PM
Member
 
Join Date: Jan 2006
Posts: 30
DooMGuarD is on a distinguished road
hi all...

how to calculate the maximum volume for open a order whit my money...

sample

i have USD$1000 and 100:1 and nolimit for volume in open order...

i need to know

1) maximum lots for open order in EURUSD with this money
2) maximum lots for open order in USDCHF with this money
2) maximum lots for open order in GBPCAD with this money

if you have a code, itīs better...

thanks for your help
__________________
Charles Adriano
---------------------------
sorry, sorry, sorry for my English...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1043 (permalink)  
Old 06-26-2008, 11:59 PM
nondisclosure007's Avatar
Senior Member
 
Join Date: Apr 2007
Posts: 100
nondisclosure007 is on a distinguished road
Code:
varlot=NormalizeDouble((AccountFreeMargin()*(varRiskPerc/100))*AccountLeverage()/MarketInfo(Symbol(),MODE_LOTSIZE),2);
where varRiskPerc is the % you want to put on your trade. ie 2%, then varRiskPerc would be 2. varRiskPerc MUST be a double or the formula will always return 0.

Quote:
Originally Posted by DooMGuarD View Post
hi all...

how to calculate the maximum volume for open a order whit my money...

sample

i have USD$1000 and 100:1 and nolimit for volume in open order...

i need to know

1) maximum lots for open order in EURUSD with this money
2) maximum lots for open order in USDCHF with this money
2) maximum lots for open order in GBPCAD with this money

if you have a code, itīs better...

thanks for your help
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1044 (permalink)  
Old 06-27-2008, 11:12 PM
Member
 
Join Date: Oct 2006
Posts: 71
Big Be is on a distinguished road
Can anyone code this 'simple' task?

I want to grab the highest and lowest values of an indicator over an entire chart. A while ago I tried what I thought should have worked, from within an EA, but it didn't.
(Sorry I don't have that attempt now to show you.)

Any ideas?

Big Be

Last edited by Big Be; 06-27-2008 at 11:14 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1045 (permalink)  
Old 06-28-2008, 12:25 AM
Senior Member
 
Join Date: Nov 2006
Posts: 215
luxinterior is on a distinguished road
You could use an array then load it up with values. Then do a simple sort to move the highest value to the top. Then do the same for the lowest.

For example you'd compare item 2 to item 1. If 2 is higher put it in item 1. Then compare 3 to 1 and repeat to the end of the array.

You'd just do the initial loading of the array in the init() function then with every new bar just compare the value to item 1 of the array.

Hope that helps

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!
Reply With Quote
  #1046 (permalink)  
Old 06-28-2008, 03:40 PM
Junior Member
 
Join Date: Feb 2008
Posts: 3
greenhaze is on a distinguished road
Lightbulb Need help with trade managegement robot.

Hi

I need to write ea which will put awaitng order and do the following when it triggers:

1. Variables ("buy"/"sell",position1_lots,position2_lots,position3_lot s,entry_price,stoploss,TP1,TP2)
2.Open (buy/sell) trade with 3 positions at (entry_price) with (stoploss).
3.Close position_1 at (TP1) and move stop loss to breakeven for 2 left positions.
4.Close position_2 at (TP2) & let the last one ride or hit breakeven.

I've programmed some indicators but i really dont have much idea how to write this robot.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1047 (permalink)  
Old 06-29-2008, 04:32 AM
ajk's Avatar
ajk ajk is offline
Senior Member
 
Join Date: Dec 2005
Posts: 232
ajk is on a distinguished road
big be...
First find the bar with the ihighest array
then, use the bar and the findings in logical order for your indicator.

Last edited by ajk; 06-29-2008 at 04:35 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1048 (permalink)  
Old 06-29-2008, 07:04 PM
Member
 
Join Date: Sep 2007
Posts: 68
Ronald Raygun is on a distinguished road
Invisible TP/SL

Hello everyone.

I'm trying to code in an effective and reliable invisible stoploss, trailing stop and takeprofit into my EAs. So far, my code just looks for the bid/ask to equal the stoploss or takeprofit value. If the price equals that value, then close the trade.

The problem I'm having is that sometimes the price seems to skip. There is no progressive movement of price. How do I then get around that problem? and make an invisible TP/SL which is guaranteed to close the trade where necessary?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1049 (permalink)  
Old 06-29-2008, 07:31 PM
IN10TION's Avatar
Senior Member
 
Join Date: Mar 2007
Posts: 569
Blog Entries: 1
IN10TION is on a distinguished road
:: the only way to close is NOT to use " == " in your code, instead everything have to close higher or lower then your price, use... higher " >= " price or lower " <= " price, yes price doesn't go like 1 2 3, it can jump from 1 to 5 in volatile market (like big news announcements), hope this helps a little
Quote:
Originally Posted by Ronald Raygun View Post
Hello everyone.

I'm trying to code in an effective and reliable invisible stoploss, trailing stop and takeprofit into my EAs. So far, my code just looks for the bid/ask to equal the stoploss or takeprofit value. If the price equals that value, then close the trade.

The problem I'm having is that sometimes the price seems to skip. There is no progressive movement of price. How do I then get around that problem? and make an invisible TP/SL which is guaranteed to close the trade where necessary?
__________________
..4.Nov.08.. IN10TION newsReader v09.85 Lite - the best news reader on your chart
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1050 (permalink)  
Old 06-29-2008, 09:33 PM
Member
 
Join Date: Oct 2006
Posts: 71
Big Be is on a distinguished road
Can anyone code this 'simple' task?

luxinterior and ajk,
Thanks. I tried one of those methods before (I will have to find what I did) and it worked great for price but not for an indicator.
Have you successfully done it?
The indicator doesn't matter, if could be any of MT4's built-ins.


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



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