molanis.com/forum - Tools for MetaTrader : The place to ask about the best expert advisor builder, expert advisor downloads, and expert advisor programming
http://www.molanis.com/forum/

how does close long (CL) and close short (CS) really work
http://www.molanis.com/forum/viewtopic.php?f=13&t=404
Page 1 of 1

Author:  micade [ Tue Jul 12, 2011 10:01 am ]
Post subject:  how does close long (CL) and close short (CS) really work

Hi molanis. This is what i thought how to use the CS and CL TA until recently when i have issue with my ea :

---When you have a stop loss and you also have the CL TA (for long trades) then either will act as stop for the open trade(s). I mean when you have 100 pips stop loss and the condition for the CL comes before the 100 pips is reached then the trade will
be closed. Also when the 100 pips is reached before the condition of the CL then trade will be closed. Reverse for short trades---

If this is correct, then i have some ea which is not working according to this rulles and i want you to help me see what i cant see now. i have attached some pics and the sample code bellow.

Attachments:
brktrunm1.mol5 [27 KiB]
Downloaded 668 times
sa2.jpg
sa2.jpg [ 143.93 KiB | Viewed 4631 times ]
sa1.jpg
sa1.jpg [ 122.2 KiB | Viewed 4636 times ]

Author:  admin [ Tue Jul 12, 2011 11:00 am ]
Post subject:  Re: how does close long (CL) and close short (CS) really work

About the stop loss, in mt4 the stop loss is managed by the server. This means the builder creates an expert advisor that sends the order (with the stop) to the server. In mt4 click the expert tab, it shows the logs and it tells you when the order is sent. Also, after the position is opened you can see in the mt4 screen the stops. If the tp or sl is not executed, it is a server / broker related problem. This is out of our control since it is a server issue. If you were backtesting your ea, some times mt4 takes a sample for backtesting and does not use all values.

CL and CS do not work like a stop loss. They are simple trading conditions that close positions. It means that if you trade using bars, they will be evaluated once per bar (at the open). If you trade using ticks, they will be evaluated every tick (close to a stop loss but managed in the client side)

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/