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 Mon Apr 29, 2024 9:53 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: INCORRECT TRADES
PostPosted: Wed Feb 01, 2012 7:08 am 
Offline

Joined: Tue Dec 27, 2011 12:37 pm
Posts: 45
Hi,

I tried to use EA with indicator called "Symphonie Trendline Indikator", but I've noticed that EA doesn't take into consideration condition that I've created. This indicator just draws blue line when trend is up (value 1 = mode 0) and red line when it's down (value 2 = mode 1). Actually, value 1 is till line is rising and when it starts to fall it becomes value 2. I wanted to use this indicator as a filter to eliminate bad trades opposite to major trend, but EA it doesn't work. I used shifted 1 and 2 with no results. Could you help me to set this condition correct? Value 1 only buy trade, value 2 only sell trade. I enclose mql code, .mol file only with indicator condition and screenshot of trades on 1min chart that made EA.


Best regards!


Attachments:
Symphonie_Trendline_Indikator.mq4 [3.33 KiB]
Downloaded 658 times
screenshot.jpg
screenshot.jpg [ 174.13 KiB | Viewed 8968 times ]
Sym Trend TEST.mol [6.67 KiB]
Downloaded 669 times
Top
 Profile  
 
 Post subject: Re: INCORRECT TRADES
PostPosted: Thu Feb 02, 2012 10:36 am 
Offline
Site Admin

Joined: Fri Oct 16, 2009 3:40 pm
Posts: 451
Expert advisors created with the strategy builder do not take incorrect trades. Hundreds of people use this software and we have a high quality code.
The ea takes the trades as per your trading logic. If you see odd trades, then you should review your logic.
In this case your logic seem fine but it's wrong. You are assuming that the signals are 0 (no signals) and signal (>0). In reality it works in a different way for your indicator.
I added this code to print out the indicator's value
Print("UP=",TrendUp[0]);
Print("Down=",TrendDown[1]);
It shows this:
2012.02.02 10:28:08 Symphonie_Trendline_Indikator EURUSD,H1: Down=1.3403
2012.02.02 10:28:08 Symphonie_Trendline_Indikator EURUSD,H1: UP=2147483647
So no signal is 2147483647 which in mt4 coding terms means empty. Your condition >0 won't work. You need to use <100000 (or any number lower than 2147483647)
This issue has been explained in the forum before in some links at viewtopic.php?f=3&t=162

I hope this helps. Happy forex trading!


Top
 Profile  
 
 Post subject: Re: INCORRECT TRADES
PostPosted: Mon Feb 13, 2012 4:01 pm 
Offline

Joined: Tue Dec 27, 2011 12:37 pm
Posts: 45
Hi,

Thank you for help. In this case it was useful solution, but I have the same problem with other indicator called "silvertrend signal". I tried different options, but EA trade in random way, just selling and buying all the time. Could you help me with this indicator? Mode 0 shifted 1< 10000 buy and mode 1 shifted 1<10000 sell. I enclose .mol file and .mq4 indicator coed.


Best regards!


Attachments:
TEST silvertrend.mol [6.72 KiB]
Downloaded 689 times
Silver Trend signal 10s.mq4 [3.21 KiB]
Downloaded 693 times
Top
 Profile  
 
 Post subject: Re: INCORRECT TRADES
PostPosted: Mon Feb 13, 2012 4:03 pm 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
Did you try to print out the output?


Top
 Profile  
 
 Post subject: Re: INCORRECT TRADES
PostPosted: Mon Feb 13, 2012 5:28 pm 
Offline

Joined: Tue Dec 27, 2011 12:37 pm
Posts: 45
I added comment the same as you wrote me last time:

Print("UP=",val1[0]);
Print("Down=",val2[1]);

and it's showing 2147483647 or 0. I enclose screenshot.


Attachments:
print silvertrend.jpg
print silvertrend.jpg [ 251.38 KiB | Viewed 8953 times ]
Top
 Profile  
 
 Post subject: Re: INCORRECT TRADES
PostPosted: Mon Feb 13, 2012 5:30 pm 
Offline

Joined: Tue Dec 27, 2011 12:37 pm
Posts: 45
Then, when the signal appeared it showed price of currency pair Down=1.3191.


Top
 Profile  
 
 Post subject: Re: INCORRECT TRADES
PostPosted: Wed Feb 15, 2012 7:39 am 
Offline

Joined: Tue Dec 27, 2011 12:37 pm
Posts: 45
Can you help me with this problem?


Top
 Profile  
 
 Post subject: Re: INCORRECT TRADES
PostPosted: Wed Feb 15, 2012 9:39 am 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
Sure, just confirm your strategy (buy when.. sell when)?


Top
 Profile  
 
 Post subject: Re: INCORRECT TRADES
PostPosted: Wed Feb 15, 2012 11:50 am 
Offline

Joined: Tue Dec 27, 2011 12:37 pm
Posts: 45
Simply, buy when green arrow in previous candle appeared, mode 0 must be equal price (mode 0<10000) and sell when there's red arrow, mode 1<10000.


Top
 Profile  
 
 Post subject: Re: INCORRECT TRADES
PostPosted: Thu Feb 16, 2012 4:31 pm 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
You need to see more values:

Use
Print("UP=",val1[0]);
Print("UP=",val1[1]);
Print("UP=",val1[2]);
Print("Down=",val2[0]);
Print("Down=",val2[1]);
Print("Down=",val2[2]);
Most likelly those arrows repaint, so you need to see the print out when an arrow is drawn


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 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:  
cron
Powered by Molanis © 2009