NexusFi: Find Your Edge


Home Menu

 





MTF Indicators


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one Quick Summary with 1 posts (0 thanks)
    2. looks_two Doctor Leo with 1 posts (0 thanks)
    3. looks_3 Big Mike with 1 posts (0 thanks)
    4. looks_4 diverdan with 1 posts (0 thanks)
    1. trending_up 3,697 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

  #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?
Ninja Mobile Trader VPS (ninjamobiletrader.com)
Trading Reviews and Vendors
Online prop firm The Funded Trader (TFT) going under?
Traders Hideout
Exit Strategy
NinjaTrader
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
Futures True Range Report
The Elite Circle
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
60 thanks
Funded Trader platforms
43 thanks
NexusFi site changelog and issues/problem reporting
24 thanks
GFIs1 1 DAX trade per day journal
22 thanks
The Program
19 thanks
  #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
Frequency: Every few days
Duration: Weeks
Posts: 50,399 since Jun 2009
Thanks Given: 33,175
Thanks Received: 101,541


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
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving 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
  #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