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/

INCORRECT TRADES
http://www.molanis.com/forum/viewtopic.php?f=2&t=996
Page 1 of 2

Author:  insomniawawa [ Wed Feb 01, 2012 7:08 am ]
Post subject:  INCORRECT TRADES

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 668 times
screenshot.jpg
screenshot.jpg [ 174.13 KiB | Viewed 9026 times ]
Sym Trend TEST.mol [6.67 KiB]
Downloaded 677 times

Author:  admin [ Thu Feb 02, 2012 10:36 am ]
Post subject:  Re: INCORRECT TRADES

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!

Author:  insomniawawa [ Mon Feb 13, 2012 4:01 pm ]
Post subject:  Re: INCORRECT TRADES

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 700 times
Silver Trend signal 10s.mq4 [3.21 KiB]
Downloaded 703 times

Author:  molanisfx [ Mon Feb 13, 2012 4:03 pm ]
Post subject:  Re: INCORRECT TRADES

Did you try to print out the output?

Author:  insomniawawa [ Mon Feb 13, 2012 5:28 pm ]
Post subject:  Re: INCORRECT TRADES

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 9010 times ]

Author:  insomniawawa [ Mon Feb 13, 2012 5:30 pm ]
Post subject:  Re: INCORRECT TRADES

Then, when the signal appeared it showed price of currency pair Down=1.3191.

Author:  insomniawawa [ Wed Feb 15, 2012 7:39 am ]
Post subject:  Re: INCORRECT TRADES

Can you help me with this problem?

Author:  molanisfx [ Wed Feb 15, 2012 9:39 am ]
Post subject:  Re: INCORRECT TRADES

Sure, just confirm your strategy (buy when.. sell when)?

Author:  insomniawawa [ Wed Feb 15, 2012 11:50 am ]
Post subject:  Re: INCORRECT TRADES

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.

Author:  molanisfx [ Thu Feb 16, 2012 4:31 pm ]
Post subject:  Re: INCORRECT TRADES

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

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