Forex



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
 
Thread Tools Display Modes
  #1041 (permalink)  
Old 06-20-2008, 11:04 AM
Senior Member
 
Join Date: Nov 2006
Posts: 305
luxinterior is on a distinguished road
Write them to a file. Take a look in the help files and you'll figure it out.

Good luck.

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
  #1042 (permalink)  
Old 06-21-2008, 05:13 AM
darkkiller's Avatar
Senior Member
 
Join Date: Jul 2007
Location: Malaysia
Posts: 258
darkkiller is on a distinguished road
Price label and text

Hi
can somebody guide/teach me how to put Price label and Text properly.I already search and found this

Putting an object anchored on the right side of the screen

Code:
      if(ObjectFind("P label") != 0)
      {
      ObjectCreate("P label", OBJ_TEXT, 0, Time[0], Close[0]);
      ObjectSetText("P label", "Price", 10, "Arial", Red);
      }
      else
      {
      ObjectMove("P label", 0, Time[0], Close[0]);
      }
Code:
ObjectCreate("Trade", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("Trade", "n", 40, "Wingdings", Red);
   ObjectSet("Trade", OBJPROP_CORNER, 1);
   ObjectSet("Trade", OBJPROP_XDISTANCE, 30);
   ObjectSet("Trade", OBJPROP_YDISTANCE, 30);
But still do not know how to apply.I attach together this indicator for my study in coding

Example like picture below,this is what i want,thanks!!
Attached Images
File Type: gif teach.gif (11.4 KB, 152 views)
Attached Files
File Type: mq4 Pivot_only_H4.mq4 (2.4 KB, 15 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
  #1043 (permalink)  
Old 06-21-2008, 01:12 PM
darkkiller's Avatar
Senior Member
 
Join Date: Jul 2007
Location: Malaysia
Posts: 258
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #1044 (permalink)  
Old 06-26-2008, 08:16 PM
Member
 
Join Date: Jan 2006
Posts: 33
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #1045 (permalink)  
Old 06-26-2008, 11:59 PM
nondisclosure007's Avatar
Senior Member
 
Join Date: Apr 2007
Posts: 123
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #1046 (permalink)  
Old 06-27-2008, 11:12 PM
Member
 
Join Date: Oct 2006
Posts: 80
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #1047 (permalink)  
Old 06-28-2008, 12:25 AM
Senior Member
 
Join Date: Nov 2006
Posts: 305
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #1048 (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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #1049 (permalink)  
Old 06-29-2008, 04:32 AM
ajk's Avatar
ajk ajk is offline
Senior Member
 
Join Date: Dec 2005
Posts: 261
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #1050 (permalink)  
Old 06-29-2008, 07:04 PM
Member
 
Join Date: Sep 2007
Posts: 69
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!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

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 07:32 PM.



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