Forex
Google
New signals service!

Go Back   Forex Trading > Discussion Areas > Metatrader 4


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
  #21 (permalink)  
Old 10-01-2007, 09:36 PM
WNW's Avatar
WNW WNW is offline
Senior Member
 
Join Date: Feb 2006
Location: Motown, USA
Posts: 385
WNW is on a distinguished road
Quote:
Originally Posted by HerbertH View Post
With enclose I mean putting your code in between the { } brackets of the code snippet I showed you.

For example:
Code:
int start()
{
     if(Timestamp != iTime(NULL,0,0))
     {
          Timestamp = iTime(NULL,0,0);

          CheckForNewTradeSetup(); // This will be where you put your code which is only allowed to run once every new bar
     }

     CheckOpenTrades();    // This will be where your code is placed, which will run every tick
}
The example shown above will check to open new trades once every new bar,
but will check existing open trades (e.g. to handle breakeven etc) every tick.

Hope this helps

PS. If you are not a coder and this expert is not functioning properly, why don't you just have the original coder have a look at this?
Thanks much for the explanation, that helps a lot.

Unfortunately the original coder is not interested in making modifications.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #22 (permalink)  
Old 10-01-2007, 09:53 PM
HerbertH's Avatar
Member
 
Join Date: May 2006
Posts: 88
HerbertH is on a distinguished road
Quote:
Originally Posted by WNW View Post

Unfortunately the original coder is not interested in making modifications.

I assume you have asked him/her for a refund then......

Cheers
__________________
Better being out, wishing to be in than being in and wishing to be out.....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #23 (permalink)  
Old 10-01-2007, 10:57 PM
WNW's Avatar
WNW WNW is offline
Senior Member
 
Join Date: Feb 2006
Location: Motown, USA
Posts: 385
WNW is on a distinguished road
I'd have better luck getting a federal tax refund...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #24 (permalink)  
Old 10-05-2007, 09:03 AM
Junior Member
 
Join Date: Oct 2007
Posts: 29
NTrader is on a distinguished road
This is a simple code to do it. Isn't it?
Code:
int BarsCount = 0;
 
int start()
{ 
  if (Bars > BarsCount)
  {
    //your code to be executed only once per bar goes here     
    BarsCount = Bars;
  } 
  return(0);
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #25 (permalink)  
Old 10-07-2007, 01:15 AM
wolfe's Avatar
Senior Member
 
Join Date: Jan 2006
Posts: 704
wolfe is on a distinguished road
No new order on same bar

Could anyone show me how to code this?

What I want is hopefully pretty basic, if an order closes on the current bar, no new order will take place until the next bar open (or after close of current bar).

Thank you for any help on this probably easy question for any good programmer.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #26 (permalink)  
Old 10-07-2007, 02:51 AM
1Dave7's Avatar
Member
 
Join Date: Aug 2007
Posts: 82
1Dave7 is on a distinguished road
Smile Try This

See attached word.doc

Dave
Attached Files
File Type: doc TRADE ONLY ONCE ON BAR.doc (19.5 KB, 86 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #27 (permalink)  
Old 10-07-2007, 10:27 AM
HerbertH's Avatar
Member
 
Join Date: May 2006
Posts: 88
HerbertH is on a distinguished road
Quote:
Originally Posted by wolfe View Post
Could anyone show me how to code this?

What I want is hopefully pretty basic, if an order closes on the current bar, no new order will take place until the next bar open (or after close of current bar).

Thank you for any help on this probably easy question for any good programmer.

Wolfe, look here:
How to open 1 trade per bar

Cheers
__________________
Better being out, wishing to be in than being in and wishing to be out.....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

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
Using Gannswing to open trade gee Expert Advisors - Metatrader 4 1 02-15-2007 09:00 PM
Restarting EA with current open trade dwmcqueen Metatrader 4 5 01-26-2007 04:29 AM
script open trade BrunoFX Tools and utilities 6 05-21-2006 11:08 PM


All times are GMT. The time now is 03:08 PM.



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