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
  #311 (permalink)  
Old 08-22-2007, 01:57 PM
Junior Member
 
Join Date: Jan 2006
Posts: 2
herly is on a distinguished road
Just to explain ...

Example :
Pair GBP/USD
Time H1
High=1.9820
Low=1.9859
Total Range = 39 pips.

Open Price next H1 = 1.9843

For line 1a (magenta)
1.9843 - (39/5) = 1.9835

For line 1b (white)
1.9843 - (39/2) = 1.9824

For line 2a (magenta)
1.9843 + (39/5) = 1.9851

For line 2b (white)
1.9843 + (39/2) = 1.9863

And line can automatic change for the next H1.
And this indicator can use for M30, H1 and H4.

Regards,
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #312 (permalink)  
Old 08-22-2007, 11:22 PM
carllos's Avatar
Member
 
Join Date: May 2006
Location: Portugal
Posts: 54
carllos is on a distinguished road
Talking Need hand here

Sorry, i´m just too tired today and can´t think at all.
Can someone please show me a code for this simple stuff:

EA stop trading till next bar is open. I mean, if one position is closed EA will only try to open a new position ate next bar and not imeddiatly.

I tried using this but it´s not working and i guess i´m too tired:

double com=iOpen(NULL,0,1);
string coms=DoubleToStr(com, 2); // comment for open order
bool shutdown=false;

for(i=orders-1;i>=0;i--){

OrderSelect(i,SELECT_BY_POS,MODE_HISTORY);
if(OrderSymbol()==Symbol()){
//----
if(OrderComment()==coms) {
shutdown=true;
}
}
}

If shutdown is true no position should open, but It does!!!

Thankx

Carllos
__________________
"Hoe ur pips mate?"

Last edited by carllos; 08-22-2007 at 11:24 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #313 (permalink)  
Old 08-22-2007, 11:30 PM
carllos's Avatar
Member
 
Join Date: May 2006
Location: Portugal
Posts: 54
carllos is on a distinguished road
weird

Man, i must be really tired..
Take a look at this picture.. FXDD !!!!
Attached Images
File Type: jpg weird.JPG (94.0 KB, 135 views)
__________________
"Hoe ur pips mate?"
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #314 (permalink)  
Old 08-23-2007, 01:23 PM
iZero's Avatar
Member
 
Join Date: Aug 2007
Location: Gold Coast, Australia
Posts: 42
iZero is on a distinguished road
Maybe your entry and current prices are switched?
__________________
Tips are most welcome
(That's me in the Avatar BTW)

Paper trading blog (MMG)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #315 (permalink)  
Old 08-24-2007, 08:17 AM
1Dave7's Avatar
Member
 
Join Date: Aug 2007
Posts: 82
1Dave7 is on a distinguished road
Smile Profit coding for display

I am still confused on how to code to capture the current profit of a particular currency in play, minus the swap, when 3 other currencies are also in play on the same platform? How do I set it up to handle magic numbers?

Another question: How do I also capture the total sum balance of profits or loss, minus swaps and minus the beginning starting balance of all the currencies in play including the closed out trades?

Would anybody care to spend a few minutes to code these routines. Your efforts are sincerely appreciated!!!!!!!!!!!!!!!

Thanks a bunch in advance!

Dave
<><<<
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #316 (permalink)  
Old 08-24-2007, 10:09 AM
Junior Member
 
Join Date: Nov 2006
Posts: 2
pierfraxxxx is on a distinguished road
Help:newlines in a objectText

How can I make an object Text with more lines?
example:

Data=StringConcatenate("Bid:",Bid," Ask:",Ask);
ObjectCreate(object_name1, OBJ_TEXT, 0,x,y);
ObjectSetText(object_name1,Data, fontsize,"Comic Sans MS", Black);

I want a result like:
Bid:1234
Ask:1236

and not: Bid:1234 Ask:1236

The "\n" doesn't function..
Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #317 (permalink)  
Old 08-24-2007, 12:16 PM
Willis11of12's Avatar
Senior Member
 
Join Date: Dec 2005
Posts: 105
Willis11of12 is on a distinguished road
if I were to do that I would just do this:
Print(" Bid: ",Bid);
Print(" Ask: ",Ask);
That will print the Bid and Ask prices and it will put them one under the other like you said you were looking for. Also, doing it this way, you don't have to declare any variables for it. I hope that is what you were looking for.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #318 (permalink)  
Old 08-24-2007, 12:34 PM
Junior Member
 
Join Date: Nov 2006
Posts: 2
pierfraxxxx is on a distinguished road
Quote:
Originally Posted by Willis11of12 View Post
if I were to do that I would just do this:
Print(" Bid: ",Bid);
Print(" Ask: ",Ask);
That will print the Bid and Ask prices and it will put them one under the other like you said you were looking for. Also, doing it this way, you don't have to declare any variables for it. I hope that is what you were looking for.
Yes, but I want an object text on the chart...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #319 (permalink)  
Old 08-25-2007, 06:04 PM
Junior Member
 
Join Date: Jun 2006
Posts: 3
Struc63 is on a distinguished road
Help with coding

Gentlemen
What code line would help me to close all pending orders if the last order closed in profit?

Actually how can I identify the last winning trade?

Regards

Thanks in advance
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #320 (permalink)  
Old 08-26-2007, 02:28 AM
ajk's Avatar
ajk ajk is offline
Senior Member
 
Join Date: Dec 2005
Posts: 232
ajk is on a distinguished road
exit s

can anyone direct me on how to program an indicator based exit.?
below is what I have so far. .but doesnt work .
if( OrdersTotal() >= 1 )
{
int total=OrdersTotal();
for(int cnt=0;cnt<=total;cnt++) // cnt loop
{
OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
if( OrderSymbol() == Symbol() && OrderMagicNumber() >= Magic_No_start && OrderMagicNumber() <= Magic_No_start + 100 && order_check != OrderTicket() ) // check for symbol
{
if(OrderType()==OP_BUY && OrderSymbol()==Symbol())
{
if( ACLOSE == 1 && OrderProfit() > 1)
{
OrderClose(OrderTicket(),OrderLots(),Bid,3,Violet) ; // close LONG position
}}
if(OrderType()==OP_SELL && OrderSymbol()==Symbol()) // check for symbol
{
if( ACLOSE == 2 && OrderProfit() > 1)
{
OrderClose(OrderTicket(),OrderLots(),Ask,3,Violet) ; // close SHORT position
}}
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:26 PM.



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