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 Thread Tools Display Modes
  #161 (permalink)  
Old 08-02-2007, 03:26 AM
FX4$$$'s Avatar
Junior Member
 
Join Date: Apr 2006
Posts: 16
FX4$$$ is on a distinguished road
iEnvelopes code

Dave,
Are you declaring the values to be 'double' ?

I PMed you ages ago, couldn't reach you by your reg. email. Glad to see you posting

P in KC
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #162 (permalink)  
Old 08-02-2007, 03:27 AM
iscuba11's Avatar
Senior Member
 
Join Date: May 2006
Location: Houston
Posts: 399
iscuba11 is on a distinguished road
Yes they are double!

Dave
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #163 (permalink)  
Old 08-02-2007, 04:21 AM
iscuba11's Avatar
Senior Member
 
Join Date: May 2006
Location: Houston
Posts: 399
iscuba11 is on a distinguished road
Cool

Hello, can anybody help with this code??
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #164 (permalink)  
Old 08-02-2007, 04:32 AM
Mistigri's Avatar
Junior Member
 
Join Date: Mar 2006
Location: SLC
Posts: 23
Mistigri is on a distinguished road
Null

Replace your NULL with Symbol() ...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #165 (permalink)  
Old 08-02-2007, 05:04 AM
Member
 
Join Date: Feb 2006
Posts: 35
flexie is on a distinguished road
Quote:
Originally Posted by iscuba11 View Post
envtop_cur0=iEnvelopes(NULL,0,30,0,5,0,-0.04,2,0);//TopBand


envbottom_cur0=iEnvelopes(NULL,0,30,0,5,0,0.04,1,0 );//BottomBand


Something is not right with above - Can someone spot and fix this code??

Dave
<><<<

Much thanks in advance!!
A suggestion from a seasoned coder ... try to get in the habit of using words for your variables rather than numbers. I think you will find the errors become easier to find. Also, you need to be a bit more specific in the context of how it's being used for us to spot problems.

So, some concerns I see:
1) do you want the shift as 5 or applied price to be 5? I am assuming you want the price to be 5 = PRICE_TYPICAL.
2) you have the modes reversed. MODE_UPPER = 1, MODE_LOWER = 2.
3) you are forcing the shift to 0, which is the current bar only. Not sure if this is what you want, but for an indicator that draws lines it needs to be a variable. An EA is ok with a 0.

Mark
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #166 (permalink)  
Old 08-02-2007, 05:17 AM
iscuba11's Avatar
Senior Member
 
Join Date: May 2006
Location: Houston
Posts: 399
iscuba11 is on a distinguished road
Smile

Thanks For The Reply!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #167 (permalink)  
Old 08-02-2007, 05:24 AM
iscuba11's Avatar
Senior Member
 
Join Date: May 2006
Location: Houston
Posts: 399
iscuba11 is on a distinguished road
Smile

Quote:
Originally Posted by flexie View Post
A suggestion from a seasoned coder ... try to get in the habit of using words for your variables rather than numbers. I think you will find the errors become easier to find. Also, you need to be a bit more specific in the context of how it's being used for us to spot problems.

So, some concerns I see:
1) do you want the shift as 5 or applied price to be 5? I am assuming you want the price to be 5 = PRICE_TYPICAL.
2) you have the modes reversed. MODE_UPPER = 1, MODE_LOWER = 2.
3) you are forcing the shift to 0, which is the current bar only. Not sure if this is what you want, but for an indicator that draws lines it needs to be a variable. An EA is ok with a 0.

Mark
The 5 is shift and looks correct. The MODE upper and lower are wrong and have been corrected. What about the deviation's???

Dave
<><<<
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #168 (permalink)  
Old 08-02-2007, 07:34 AM
Member
 
Join Date: Jun 2007
Posts: 48
mas0n is on a distinguished road
Quote:
Originally Posted by MQL4 View Post
Thank You Mas0n,
I do not get this half page code. Would You please write me how to create just 1 simple label, and how to change the font, font size, and color of it.

Thank You,







MQL4.
objectCreate("pbstat",StartX,StartY,"test",10,"Ari al Narrow",FontColor);
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #169 (permalink)  
Old 08-02-2007, 08:41 AM
Member
 
Join Date: Feb 2007
Posts: 30
justize is on a distinguished road
Closing Order by Expiration

Hi,
iīm working on a momentum-strategy and I think it would be best to close orders by a expirationtime.

static datetime TradeTime;
...
TradeTime = iTime(NULL,PERIOD_D1,0);
...
ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,0,Ask-StopLoss,Ask+spread*Point+TakeProfit,"My EA",1234,TradeTime+(Hour()+1)*60*60,Green);


I want to run it in 30M-timeframe. While opening a position, I want to set the expiration time of the order to actual time + 1 hour, so it MUST be closed after 2 bars.

I hope someone can help me, the code above donīt work like it should be...

Thank you for reading,
JustY
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #170 (permalink)  
Old 08-02-2007, 10:40 AM
ralph.ronnquist's Avatar
Senior Member
 
Join Date: Oct 2006
Posts: 280
ralph.ronnquist is on a distinguished road
Quote:
Originally Posted by justize View Post
Hi,
iīm working on a momentum-strategy and I think it would be best to close orders by a expirationtime.

static datetime TradeTime;
...
TradeTime = iTime(NULL,PERIOD_D1,0);
...
ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,0,Ask-StopLoss,Ask+spread*Point+TakeProfit,"My EA",1234,TradeTime+(Hour()+1)*60*60,Green);


I want to run it in 30M-timeframe. While opening a position, I want to set the expiration time of the order to actual time + 1 hour, so it MUST be closed after 2 bars.

I hope someone can help me, the code above donīt work like it should be...

Thank you for reading,
JustY
To close 1 hour into future of this bar opening:
PHP Code:
ticket=OrderSend(..., Time[0] + 60 60, ...); 
To close 1 hour into future of now:
PHP Code:
ticket=OrderSend(..., TimeCurrent() + 60 60, ...); 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Tags
automated close order, close, eas, forex, learn mql4, learn mql4 video, mql4 learning, OrderCloseBy, profit, reach, secure profit function, T101_v1.11_orest_IBFXm.mq4, learning mql4

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
Learning Cycles For New Traders Dan7974 General Discussion 350 01-18-2008 07:04 PM
Learning to code for autotrading GoatT Metatrader Programming 8 01-10-2007 09:55 PM
Self learning expert mrtools Expert Advisors - Metatrader 4 32 10-22-2006 06:29 PM


All times are GMT. The time now is 12:13 PM.



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