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
  #1 (permalink)  
Old 03-27-2007, 12:19 AM
SaxMan's Avatar
Member
 
Join Date: Mar 2006
Posts: 27
SaxMan is on a distinguished road
Question Open Condition -- Need Advanced Programming Help

Hi Experts,

I've been attempting to program my open order condition based upon the following criteria as an example:

1. A cross of some sort (Ex. MA cross):
a) at the point of cross, it needs to make a time stamp (or bar stamp // or similar) to mark the place where cross takes place.
b) When this bar closes, it needs to recorded the close of the cross bar (not the close when the cross occurs)(i.e. if cross happens @ 10:10:10 and your using 1m chart, it will record the close of 10:10 @ 10:11)

2. Once a Close Price is recorded:
a) a Counter needs to be establish to count (to a limit) the number of bars since the cross.
b) The Condition is met when, in case of long open, a current Close higher than the recorded close is reached and vice versa lower close on short before the limit is reached


The problem I'm having is that I use Global static variables for the time stamp, Close Price, and Counter. In doing this, upon each new bar it records new information if the condition remains true.

I.E. 1 min Chart: MA Cross @ 10:10 Recorded itime/time[0] = 12345667

next bar: Close recorded: 1.1111, Counter=1
next bar: conditions remain true so in my case it now records a new timestamp, close, counter=1;

BUT I want: next bar: conditions remain -- Time stamp remains original, Close Price remains original .... and it looks for the final condition to be met which is a higher close.

Any help would be greatly appreciated,
Thanks,
SaxMan
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 03-27-2007, 03:33 PM
SaxMan's Avatar
Member
 
Join Date: Mar 2006
Posts: 27
SaxMan is on a distinguished road
Lightbulb I Fixed my Issue

Hi Everyone,

I fixed my issue. The basic problem I had was using itime/time. I replaced this with Bars since the increment for Bars is +1 whereas itime/time varies based upon timeframe used.

If you would like to know how I accomplished this please post a reply... otherwise I'll not bother.

Have a good one,
SaxMan
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-12-2007, 04:28 PM
Member
 
Join Date: Oct 2006
Posts: 69
Big Be is on a distinguished road
Please post or PM

This looks similar to a problem I am trying to solve. Your solution could help.
Thanks.
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 On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
>>Advanced GET & 4X<< kappari Tools and utilities 13 02-29-2008 06:53 AM
Need Help Programming EA mikejody Metatrader 4 0 05-15-2007 03:26 PM
Advanced GET peregrinus Non Related Discussions 26 04-11-2007 04:42 PM


All times are GMT. The time now is 06:25 AM.



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