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 6:37 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Trend Slope Indicator
PostPosted: Mon Mar 14, 2011 11:02 pm 
Offline

Joined: Fri Nov 12, 2010 8:34 pm
Posts: 2
I created an EA using a custom indicator. The EA will correctly trade the uptrend of the indicator. The value is placed in "Signal Line (15)"). The EA won't trade the downtrend of the indicator. The value is placed in "Value 2". The value would be "214748367".
For me, it would make sense to just use one output value i.e Signal Line (15).

Thank you for your assistants

Matthew


Attachments:
(T_S_R)-Signal Line.mq4 [3.91 KiB]
Downloaded 825 times
Top
 Profile  
 
 Post subject: Re: Trend Slope Indicator
PostPosted: Tue Mar 15, 2011 8:48 am 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
Please attach your strategy file (.mol file)
Going forward, do not attach strategies in mq4 or ex4 format. For support we require to use the strategy file for molanis strategy builder and your custom indicator's mq4 file


Top
 Profile  
 
 Post subject: Re: Trend Slope Indicator
PostPosted: Tue Mar 15, 2011 5:56 pm 
Offline

Joined: Fri Nov 12, 2010 8:34 pm
Posts: 2
Attached is mol file.

Thank you,

Matthew


Attachments:
TrendSlope.mol [5.44 KiB]
Downloaded 841 times
Top
 Profile  
 
 Post subject: Re: Trend Slope Indicator
PostPosted: Wed Mar 16, 2011 9:22 am 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
What you see in the screen is a line than changes colors. In MT4 this is made using two lines but showing one at a time. So when the indicator paints the red line, the green line is painted with a value of empty (not zero) so you don't see it - and vice versa.
In mt4 EMPTY_VALUE = 2147483647
In Metatrader empty is defined as a huge number, so your conditions can be compared to 100000 (or any number bigger that the prices but smaller that mt4 empty - we use 100000)
The indicator code shows this:
SetIndexBuffer(0, Uptrend);
SetIndexBuffer(1, Dntrend);
So uptrend is mode 0
downtrend is mode 1
You did not describe your logic so no idea when you want to buy (the logic in the trading diagram seems odd). If you want to buy when there is an uptrend line, just use
indicator mode 0 < 100000 this tells you the indicator is painting a green line.
If you want to buy when the price is below that line, use
indicator mode 0 < 100000 AND price < indicator mode 0 (use the icon AND to create this condition)
For sell, indicator mode 1 < 100000 tells you that the indicator is painting a red line.

In your strategy you trade using bars, I would not use bid/ask with this indicator and trading bars. bid / ask are used when trading ticks, when trading bars a close price may work better.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 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