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 Sat May 18, 2024 6:55 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 11 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Trailingstop doesn't work
PostPosted: Thu Dec 06, 2012 1:57 pm 
Offline

Joined: Tue Dec 04, 2012 2:55 pm
Posts: 6
Hi,

I'm new in using MT4 and Molanis and I did'nt find the topic here.
I built a simple MA-cross-Ea to test and try the different options (variables) and functions for learning how to use it.
And now my question:
In the backtest it looks very well, but if I try to trade in my demo-account the SL and TP is modified after opening a position, but the trailingstop will not be modified. It doesn't matter what settings I was set. The SL/TP is not included in opening , it will be modified after opening a position. If I try to set the SL/TP incl. opening, I get an alert.

Bit why is in the following minutes/hours the SL not modified as trailingstop?

What did I wrong?
the mol.file is attached.

Thanks for your help.

PS: Sorry for my english, I hope you know what I mean. :oops:


Attachments:
TEST_MA_CROSS.mol [13.84 KiB]
Downloaded 425 times
Top
 Profile  
 
 Post subject: Re: Trailingstop doesn't work
PostPosted: Fri Dec 07, 2012 9:30 pm 
Offline
Site Admin

Joined: Fri Oct 16, 2009 3:40 pm
Posts: 451
Your settings seem fine.
For ecn the tp and sl are sent after the trade is executed. This is a normal behavior for ecn. Non ecn mt4 servers receive the stops with the order.
You trade bars so the trailing is evaluated once per bars so you may think it does not work. Go to mt4, in the ea inputs look for the variables to set the trailing and change it to trade every tick. See http://www.molanis.com/products/molanis ... or-builder (Features released on Feb 28,2011) for detailed info on setting trailing stops.


Top
 Profile  
 
 Post subject: Re: Trailingstop doesn't work
PostPosted: Mon Dec 10, 2012 2:34 pm 
Offline

Joined: Tue Dec 04, 2012 2:55 pm
Posts: 6
Thanks for reply,
I thought, that I tried both options, but I'm not sure. I will test it for some days ( I use a 15min-timeframe EURUSD) and come back, if there is still this miracle. :(


Top
 Profile  
 
 Post subject: Re: Trailingstop doesn't work
PostPosted: Mon Dec 10, 2012 10:00 pm 
Offline

Joined: Sun Jun 19, 2011 9:38 pm
Posts: 270
sandy21 wrote:
Hi,

I'm new in using MT4 and Molanis and I did'nt find the topic here.
I built a simple MA-cross-Ea to test and try the different options (variables) and functions for learning how to use it.
And now my question:
In the backtest it looks very well, but if I try to trade in my demo-account the SL and TP is modified after opening a position, but the trailingstop will not be modified. It doesn't matter what settings I was set. The SL/TP is not included in opening , it will be modified after opening a position. If I try to set the SL/TP incl. opening, I get an alert.

Bit why is in the following minutes/hours the SL not modified as trailingstop?

What did I wrong?
the mol.file is attached.

Thanks for your help.

PS: Sorry for my english, I hope you know what I mean. :oops:


If you think your English is poor, then you haven't been to New Jersey. :roll:

You say you are new to MT4, so I'm guessing that you don't really have a Standard Account. See: START, Account Type, MicroAccount. I don't know if this could cause trailing stop problems, but it's the only potential mistake I can find.

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


Top
 Profile  
 
 Post subject: Re: Trailingstop doesn't work
PostPosted: Fri Dec 14, 2012 3:06 pm 
Offline

Joined: Tue Dec 04, 2012 2:55 pm
Posts: 6
I test this strategy on a demo-account. if I use the trailingstop-function of the MT4-terminal it works, but the trailingstop in the EA seems to be out of function.
after opening a position the TP and SL ist set a few second later and accepted by the server. but then no modifying will happen, don't matter if the position is in profit or loss direction. and I tested the option "Checl TSEverytick", no matter if TRUE or FALSE.

can you tell me what is the difference between standard an micro account.

I use a standard account at active trades, london. there I set my positions manually, and a demo-account for testing EA's ( and molanis, becoues I'm not a programmer)

Thank you


Top
 Profile  
 
 Post subject: Re: Trailingstop doesn't work
PostPosted: Sat Dec 15, 2012 9:26 pm 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
Are you taking about the .mol file you posted at the beginning of the post?
What is for you a trailing stops? maybe we mean different things. Just asking because you said "don't matter if the position is in profit or loss direction"
Please post your .mq4 file to check the setting for trailing.
Have you seen the logs, the ea prints out everything, even the change on trailing stops.
Quote:
can you tell me what is the difference between standard an micro account.

The difference is the minimum lot size. It does not affect the trailing stops.


Top
 Profile  
 
 Post subject: Re: Trailingstop doesn't work
PostPosted: Sun Dec 16, 2012 2:47 pm 
Offline

Joined: Tue Dec 04, 2012 2:55 pm
Posts: 6
let me describe my understanding of a trailingstop.

I Use this EA on a 5-Min-EURUSD-Chart.
if my trad moves in a "wrong" direction, the SL (30 pips) is set and stops the trade if the loss is more than 30 pips.
if the trade moves in a profit direction, i.e 50 pips and the TS=SL are at 30 pips, then the SL must be changed 30 pips lower then the last quote, so I will get minimum 20 pips profit, if the trades turn in the loss direction.

as I could see in the logfile, the SL and TP was set after opening a position, but the SL will not be modified again, even if I have profit. If I use the trailingstop-function at the MT4-terminal, I can see that the SL will be modified.

I will post the logfile, if I will have the next trade.

I can't post the mq4 file because it's the standard version of strategy builder, so you cant get the .mol or the .ex4-file.

Was it understandable ?? :D


Top
 Profile  
 
 Post subject: Re: Trailingstop doesn't work
PostPosted: Wed Dec 19, 2012 11:23 am 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
In the example you have tp=100, sl=ts=50 pips. This should work fine. Do not use 20 pips since it is too low.
When I attached the ea to a chart, it shows this in the expert tab:
2012.12.19 10:57:07 TEST_MA_CROSS EURUSD,M5: M-Min Stops/Limit Level = 20 pips.
It means that for my broker the min stops is 20, some times you need to add the spread on top of that so use 27 pips as a minimum. Thus when testing sl and ts use 30 pips as a min to be safe. Then when you know it is working fine, reduce the amount until it does not work.
Since you have the standard version every time you attach the ea to a chart you need to set CheckTSEveryTick=true (You have to do it every time the ea restart)

I test your ea with the initial settings and got this:
Price SL TP
10 2012.02.14 14:05 sell 4 0.02 1.31677 0.00000 0.00000 0.00 9987.13
11 2012.02.14 14:05 modify 4 0.02 1.31677 1.32177 1.30677 0.00 9987.13
12 2012.02.14 18:57 modify 4 0.02 1.31677 1.31677 1.30677 0.00 9987.13
13 2012.02.14 18:57 modify 4 0.02 1.31677 1.31676 1.30677 0.00 9987.13
14 2012.02.14 18:57 modify 4 0.02 1.31677 1.31675 1.30677 0.00 9987.13

It shows the ts working, initially it moves after 50pips then it keeps moving


Top
 Profile  
 
 Post subject: Re: Trailingstop doesn't work
PostPosted: Wed Dec 19, 2012 2:05 pm 
Offline

Joined: Tue Dec 04, 2012 2:55 pm
Posts: 6
Hi,

it looks like I didn't understand the logic, how the TS works in molanis.
I thought, that the TS modifies the SL from the beginning when the trade moves in the profit direction, means if TS = 20pips and the trade is 10 pips in profit, then the SL will be changed to 10 pips below the orderprice ( gap of 20 pips, regardless any spreads).
But as I understood your explanation, the TS modifies the SL the first time, if the trade is more then 20pips in profit ( this example), and then every tick again if necessary.

is this the right description of the logic?
can this logic be changed anyhow?

And I will set the TSCheck everytime I restart the Ea, that was new for me. Thank you


Top
 Profile  
 
 Post subject: Re: Trailingstop doesn't work
PostPosted: Wed Dec 19, 2012 4:13 pm 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
That is the logic. If you have a pro version you can change the code.


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

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:  
Powered by Molanis © 2009