NexusFi: Find Your Edge


Home Menu

 





MTF Indicators


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one Big Mike with 1 posts (0 thanks)
    2. looks_two diverdan with 1 posts (0 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 Doctor Leo with 1 posts (0 thanks)
    1. trending_up 3,685 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 3 posts
    2. attach_file 0 attachments




 
Search this Thread

MTF Indicators

(login for full post details)
  #1 (permalink)
 diverdan 
Singapore
 
Experience: Beginner
Platform: Multicharts, R
Trading: EUR / USD
Posts: 185 since Feb 2010
Thanks Given: 106
Thanks Received: 99

Hi

I have created a MTF signal in MC, one timeframe (for trend) is the daily chart and the other for trading is 60 minute chart.

I have defined the trend based upon the daily chart using:
 
Code
                            
if (DayEma[0] > DayEma[1]) then
    trend 
1
else if (DayEma[0] < DayEma[1]) then
    trend 
= -1
else if (DayEma[0] = DayEma[1]) then trend 0
else trend trend
However this only worked for one hour bar in the day i.e. when the session ended. Otherwise DayEma[0] = DayEma[1].

I sort of solved the problem by calculating the hour bar to reference back to the end of the session to get the correct daily EMA value:

 
Code
                            
if (DayEma[0] > DayEma[Mod(BarNumber -1,  24)]) then
    trend 
1
else if (DayEma[0] < DayEma[Mod(BarNumber -1,  24)]) then
    trend 
= -1
else if (DayEma[0] = DayEma[Mod(BarNumber -1,  24)]) then trend 0
else trend trend
This would work for time based trade charts but not any exotic bar types (e.g. Range).

Does anyone know how to solve this elegantly?

Cheers,

Daniel

Visit my NexusFi Trade Journal Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
Looking for an MQL4 MetaTrader programmer/coder
The Elite Circle
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
Futures Close-Out Policy
Commodities
Request for MACD with option to use different MAs for fa …
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
33 thanks
Daytrading ES & NQ
32 thanks
Battlestations: Show us your trading desks!
30 thanks
Spoo-nalysis ES e-mini futures S&P 500
28 thanks
Retail Trading As An Industry
25 thanks

(login for full post details)
  #3 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Posts: 50,248 since Jun 2009
Thanks Given: 33,111
Thanks Received: 101,368


I just use a

 
Code
                            
if date <> date[1
block in my code for processing new day events. It may work here too, I'm not 100% sure what you are trying to do.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor


For the best trading education, watch our webinars
Searching for trading reviews? Review this list


Lifetime Elite Membership: Sign-up for only $149 USD
Receive exclusive offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
(login for full post details)
  #4 (permalink)
Doctor Leo
St. Petersburg, Russia
 
Posts: 30 since Nov 2010
Thanks Given: 6
Thanks Received: 19

I think I realize the root of the problem. When you use any indicator from a higher timerame on a lower one you have equal values for all bars except the first corresponding to the higher timeframe bar. And you seem to want the condition like ma1 > ma2 be true over the whole lower timeframe span (day in your example). If my guess is true then it's very easy to implement. You simply write:

ma1 = xaverage(close of data2, N);
condition1 = ma1 of data2 > ma1[1] of data2;

In this case the condition should be true during the whole day on the lower timeframe.

Hope this helps. If this is not what you're looking for please ask for more, I'll try to help.

Reply With Quote





Last Updated on November 13, 2010


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts