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 7:16 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: ...check direction of indicator's line?
PostPosted: Thu Jan 14, 2010 2:37 pm 
Offline

Joined: Thu Jan 14, 2010 2:09 pm
Posts: 6
And one more question!=)

For example I'll take Momentum... How can I check in TA's direction of it's line on closed bar? I need to know if it is going up or down depending on the last bar, and relaying on this condition decide to take order or not.

Thank You again!=)

Dasha.


Top
 Profile  
 
 Post subject: Re: ...check direction of indicator's line?
PostPosted: Thu Jan 14, 2010 4:36 pm 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
If you want to compare current bar with the previous bar you can use the option shift.
On a TA block select the Momentum indicator on the left side, use shift of 0 (0 means current bar). On the right select Momentum indicator but use a shift of 1 (1 means the previous bar).
If the indicator with shift = 0 > indicator with shift = 1, the momentum of the current bar is higher than the previous bar. This should be used with care since the current bar has not been formed - it may change. You also could use shift = 1 and shift = 2 with this you make sure you are comparing formed bars

As per MetaTrade :
shift -Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).

In plain English:
shift = 0 for current bar (still forming)
shift = 1 previous bar
shift = 2 bar before the previous bar (shift =1)

Molanis Team


Top
 Profile  
 
 Post subject: Re: ...check direction of indicator's line?
PostPosted: Sun Jan 17, 2010 2:09 pm 
Offline

Joined: Thu Jan 14, 2010 2:09 pm
Posts: 6
Now everything is clear! Thank You!=)


Top
 Profile  
 
 Post subject: Re: ...check direction of indicator's line?
PostPosted: Thu Feb 18, 2010 6:02 am 
Offline

Joined: Thu Feb 18, 2010 5:52 am
Posts: 5
On a related note: is there a way to check shift of a given value between two candles? For example: looking at a simple MA. Set MA on both sides of the TA conditions, if [right MA shift 1] is greater than [left MA shift 6] (so if the MA has ended up higher at the end of the last 5 completed candles - I realise this doesn't account for fluctuations between candle -6 and -1) then BUY. I think I can set this up in Molanis pretty easily, it's very intuitive. But how can I amend the above flow so that the BUY signal is triggered only if [right MA shift 1] is greater than [left MA shift 6] by (say) 10 pips?

A side-query - what is the difference between 'MA Shift' and 'Shift' in the MA TA?

Oh, and I assume 'Applied Price' means the data point from which the MA is calculated (e.g. MA period 5 applied price PRICE_CLOSE looks at the close of the last 5 periods to calculate the MA) - would be grateful if you could confirm.

Thanks very much - great software! Learning MQL has been on my to-do list for a while, this may have saved me quite a bit of time!


Top
 Profile  
 
 Post subject: Re: ...check direction of indicator's line?
PostPosted: Thu Feb 18, 2010 9:22 am 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
[right MA shift 1] is greater than [left MA shift 6] by (say) 10 pips?
Can't be done directly. We want to add a new feature for that. You can create an MA+pips indicator with the Technical Indicator Builder but this is not straight forward.

difference between 'MA Shift' and 'Shift' in the MA TA?

Read this post viewtopic.php?f=2&t=45&p=185&hilit=forum#p185

You are right about 'Applied Price'. We use MT4 definitions. More info here: http://docs.mql4.com/indicators/iMA


Top
 Profile  
 
 Post subject: Re: ...check direction of indicator's line?
PostPosted: Thu Feb 18, 2010 9:46 am 
Offline

Joined: Thu Feb 18, 2010 5:52 am
Posts: 5
Thanks very much for responding so quickly.

You can create an MA+pips indicator with the Technical Indicator Builder but this is not straight forward.
I'll have a look at Technical Indicator Builder and see if I can work it out. Presumably I can then import the indicator into Strategy Builder?

Sorry, one separate question: is there a way to hardwire strategy/trade execution times into the TA blocks without relying on Trading Hours Start/End in the START block? For example: if I want the EA to assess the market at (say) 1030 GMT every day, place a trade if conditions are met, then close the trade at 1100 GMT (if SL/TP haven't been hit before then), would setting Trading Hours Start to 1030 GMT and Trading Hours End to 1100 GMT accomplish this? Or would this leave the trade open until SL/TP hit or closed manually? I'm thinking of a TA block with a TIME IS condition, if such a thing exists/is on a future feature list...

Thanks again

Mark


Top
 Profile  
 
 Post subject: Re: ...check direction of indicator's line?
PostPosted: Thu Feb 18, 2010 2:48 pm 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
Yes, You can use the custom indicator.

would setting Trading Hours Start to 1030 GMT and Trading Hours End to 1100 GMT accomplish this?
No. The position will be opened but won't be closed at 1100. You could close it if you create a second EA with trading after 11:00 and a CLOSELONG or CLOSESHORT, and attach it to a different graph. It's a bit complex so I wouldn't use it in a real account. We want to add more time related features - this one seems interesting - but it will take a while since we are working on the commercial version of Technical Indicator Builder for MT4.


Top
 Profile  
 
 Post subject: Re: ...check direction of indicator's line?
PostPosted: Thu Feb 18, 2010 3:21 pm 
Offline

Joined: Thu Feb 18, 2010 5:52 am
Posts: 5
OK - thanks for another swift response.

I'll make my point about the time over on the feature list thread, so it's all in one place, but just one final query - having now looked at TradingHoursStart I see it's only whole hours - how can I amend it to (in my example) 1030 GMT? Also, I presume the clock takes its sync from Market Watch in MT4.

Thanks, this software looks very promising - I am looking forward to the next version and commercial release already!


Top
 Profile  
 
 Post subject: Re: ...check direction of indicator's line?
PostPosted: Fri Feb 19, 2010 10:07 am 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
The time is server time. When you add an EA we print server and terminal (your computer) time. You have to look at this and then find what time is equivalent to 1030 GMT.
We use server time since people may use the EA in different computers, or even in a hosting. Terminal time is not as reliable.


Top
 Profile  
 
 Post subject: Re: ...check direction of indicator's line?
PostPosted: Fri Feb 19, 2010 11:26 am 
Offline

Joined: Thu Feb 18, 2010 5:52 am
Posts: 5
Thanks very much. And is it possible to complete the TradingHoursStart field with 'fractional' hours (i.e. 1030 or 1130 rather than 1000 or 1100)?


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