• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 8:40pm
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 8:40pm
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

Some Advices before Entering Forex Trading 14 replies

Looking for experienced trader's advices! 13 replies

Manual backtesting tips and advices 6 replies

Advices metabrokers 1 reply

Programming question 3 replies

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe
Tags: Programming question ( give me some advices )
Cancel

Programming question ( give me some advices )

  • Post #1
  • Quote
  • First Post: Mar 24, 2010 7:21am Mar 24, 2010 7:21am
  •  kaydara
  • | Joined Jan 2010 | Status: pip ... pip ... pip ... | 101 Posts
Hello guys,

I'm starting programming my EA and i have some questions in my head and maybe you can give me some advices because there aren't so many tutorials on mq4 on the internet :s

Should i structure my EA to make actions in a specific order, process indicators data, manage open orders, manage pending orders, manage possible new orders.
Are these the 4 big blocks, am i missing some other ? and witch is the order should they be ?


When analyzing some EA's i see many time the RefreshRates() before a close order, is this a good practice ? what is the goal of this refresh ?
I am asking this because when the next tick the EA init function will be run again.


When buying or closing by the EA and not in the broker should i use this approach:

IF ( BID > PRICE_I_WANT_TO_CLOSE ) CLOSE_ORDER AT CURRENT PRICE WITH SLIPPAGE

or should i use a different approach ?
I know that when possible i should put this in the broker hands ( I'm working with FxPro and the only allow me to define that 50 pips away, and sometimes 50 is too much for what i want ).



Well these are my questions, if someone have sometime to put me in the right track i appreciate.

Thank you very much!
  • Post #2
  • Quote
  • Mar 24, 2010 8:15am Mar 24, 2010 8:15am
  •  hayseed
  • Joined Nov 2006 | Status: Member | 3,831 Posts
hey kaydara..... if your post is any reflection of your true self, and they often are, you must be one very well organized person.... those are excellent questions.....

//----

my suggestions on code would be,

//--adapt a basic layout structure that suits you.... and improve it....

//--keep the code lean .... do not use functions that will not be used....

//--refresh rates might be a good practice for a tremendously complex ea but it's not something i use.... even with thousands of trades a month, i don't see errors related to invalid price.... that's my expericence, others might insist on refresh rates use....

//--your suggestion of specfic order of 'basic four big blocks' is good but should be flexible......

//--

nothing beats looking at various ea's and study their layout.... and look at hundreds......h
to trade and code, keep both simple... no call to impress....h
 
 
  • Post #3
  • Quote
  • Last Post: Mar 24, 2010 8:47am Mar 24, 2010 8:47am
  •  kaydara
  • | Joined Jan 2010 | Status: pip ... pip ... pip ... | 101 Posts
thanks a lot for you reply and for your considerations about my questions

It's complicated for me to know that something works just because it does...
I'm a programmer for almost 10 years. I started in java but i feel like i need something more, then i learn C but still i need some more then assembly where i fully understand all the little operations behind the magic of programming.

That's why these questions appear in my head.
And before i fully understand how the mechanisms works in mq4 and forex i will not be satisfied and pop up some questions in my head ( sometimes really stupid questions eheheh )
 
 
  • Platform Tech
  • /
  • Programming question ( give me some advices )
  • Reply to Thread
0 traders viewing now
Top of Page
  • Facebook
  • Twitter
About FF
  • Mission
  • Products
  • User Guide
  • Media Kit
  • Blog
  • Contact
FF Products
  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer
FF Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow FF
  • Facebook
  • Twitter

FF Sister Sites:

  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Forex Factory® is a brand of Fair Economy, Inc.

Terms of Service / ©2023