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 10, 2024 4:00 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 11 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: how to keep previous position if the trend is the same
PostPosted: Wed Jun 20, 2012 6:53 pm 
Offline

Joined: Sun Jun 19, 2011 9:38 pm
Posts: 270
Your CloseLong and CloseShort TA's are incorrect (below). In both, you have condition A = condition A, which will always be true and hence always be looking to close your position. I assume you want to close longs on appearance of a red arrow and close shorts on appearance of a blue arrow. Try changing the condition within each TA respectively to:

CloseLong if Jasent, Mode 1 > User Defined Number 0; and
CloseShort if Jasent, Mode 0 > User Defined Number 0.

If that doesn't work, try:

CloseLong if Jasent, Mode 1 > User Defined Number 0.0000001; and
CloseShort if Jasent, Mode 0 > User Defined Number 0.0000001.

Apparently, 0 doesn't always equal 0 in MT4.

Also, be aware that using shift 0 does not wait for your current candle to close, so the arrows may appear and disappear several times even though you exited your position on the first appearance of an arrow. Using shift 1 would use the actual close of your previous candle.

MolanisFX or admin will correct me if I'm wrong..
Attachment:
incorrect.png
incorrect.png [ 126.94 KiB | Viewed 556 times ]

_________________
I'm not a programmer, but I play one on TV.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ]  Go to page Previous  1, 2

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