close position in zerocode
  #1 (permalink)  
Old 07-27-2005, 07:39 PM
Freshman
 
Join Date: Jul 2005
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
motisi2 is on a distinguished road
Default close position in zerocode

hello
I trise to put my simple ruls at zerocode
i hope its o.k.
i dont know if i did it right
i wish i could ask somwone
i need to put a closing position and i dont know how:
logic: is the price line croses 3 ema 10, 25. 50 then close posotuon
can somwone help me please
thanks
Reply With Quote
  #2 (permalink)  
Old 07-28-2005, 04:10 PM
scorpion's Avatar
Administrator
 
Join Date: Aug 2004
Posts: 1,992
Thanks: 125
Thanked 383 Times in 152 Posts
scorpion is a splendid one to beholdscorpion is a splendid one to beholdscorpion is a splendid one to beholdscorpion is a splendid one to beholdscorpion is a splendid one to beholdscorpion is a splendid one to beholdscorpion is a splendid one to beholdscorpion is a splendid one to behold
Send a message via MSN to scorpion Send a message via Yahoo to scorpion
Default

Why cross 3 EMAs? I asked because when the price crosses EMA 50, it must have crossed EMA 10 and 25 already. I think just check if the price cross EMA 50 alone is way efficient.

To close positions if bid price cross an EMA (setup up the period in step 1):
Close Logics
PriceBid <= MA (x) Previous
PriceBid > MA (x) Current

Note: Replace the x with appropriate indicator's id found in popup menu.
__________________
Make easy pips with the Advanced Economic Calendar for Forex Trading.

Last edited by scorpion : 07-28-2005 at 04:20 PM.
Reply With Quote
Conditional Close
  #3 (permalink)  
Old 08-03-2005, 04:01 AM
Freshman
 
Join Date: Jul 2005
Posts: 17
Thanks: 0
Thanked 2 Times in 1 Post
freshfx is on a distinguished road
Default Conditional Close

Scorpion, How would you write your close if your EA was designed for both long and short positions. In other words, how would you write:

If Long, close when EMA(1) crosses EMA(2) to downside;
else
if short, close when EMA(1) crosses EMA(2) to upside;

Thanks alot, freshfx
Reply With Quote
Please check answer
  #4 (permalink)  
Old 08-03-2005, 04:32 AM
Freshman
 
Join Date: Jul 2005
Posts: 17
Thanks: 0
Thanked 2 Times in 1 Post
freshfx is on a distinguished road
Default Please check answer

I think I have answered the question I asked above in the previous post.

CLOSE LOGIC

AND MA(1)previous<MA(2)previous
AND MA(1)current>=MA(2)current
OR MA(1)previous>MA(2)previous
AND MA(1)current<=MA(2)current

I would appreciate comment, thanks. freshfx
Reply With Quote
  #5 (permalink)  
Old 08-03-2005, 04:08 PM
scorpion's Avatar
Administrator
 
Join Date: Aug 2004
Posts: 1,992
Thanks: 125
Thanked 383 Times in 152 Posts
scorpion is a splendid one to beholdscorpion is a splendid one to beholdscorpion is a splendid one to beholdscorpion is a splendid one to beholdscorpion is a splendid one to beholdscorpion is a splendid one to beholdscorpion is a splendid one to beholdscorpion is a splendid one to behold
Send a message via MSN to scorpion Send a message via Yahoo to scorpion
Default

Hey,

Above logics will close trade all the time regardless of buy or sell, so don't use it. I'm thinking to add "close only long" and "close only short" in the next version.
__________________
Make easy pips with the Advanced Economic Calendar for Forex Trading.
Reply With Quote
Reply


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ZeroCode Beta 2 Status scorpion MetaTrader and ZeroCode 85 06-21-2008 05:11 PM
ZeroCode Expert Running 3 Majors (?) Scicronys MetaTrader and ZeroCode 8 12-12-2007 09:58 AM
RE: RSI in ZeroCode ????? TurboTrader24 MetaTrader and ZeroCode 9 08-04-2005 04:28 AM
Help bulding expert In Zerocode Please motisi2 MetaTrader and ZeroCode 4 07-29-2005 08:06 AM
Important: ZeroCode Header in Compiled MQL files scorpion MetaTrader and ZeroCode 0 06-09-2005 09:59 AM


All times are GMT. The time now is 01:04 PM.
Powered by vBulletin Version 3.6.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0

Registered members have access to special online forex currency trading tools, software, mt4 expert advisors and indicators. Register now