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

AFTER YOU REGISTER SEND US AN EMAIL TO ACTIVATE YOUR ACCOUNT - Before posting:-1- Please read the user guide -2- Try the examples -3- Search in the forum
It is currently Fri May 03, 2024 4:10 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: how does close long (CL) and close short (CS) really work
PostPosted: Tue Jul 12, 2011 10:01 am 
Offline

Joined: Thu Sep 09, 2010 8:12 am
Posts: 48
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 640 times
sa2.jpg
sa2.jpg [ 143.93 KiB | Viewed 4599 times ]
sa1.jpg
sa1.jpg [ 122.2 KiB | Viewed 4604 times ]
Top
 Profile  
 
 Post subject: Re: how does close long (CL) and close short (CS) really work
PostPosted: Tue Jul 12, 2011 11:00 am 
Offline
Site Admin

Joined: Fri Oct 16, 2009 3:40 pm
Posts: 451
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)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by Molanis © 2009