NexusFi: Find Your Edge


Home Menu

 





DEMA calculation on different time resolution


Discussion in MultiCharts

Updated
    1. trending_up 1,911 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 3 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
auato
Bradenton
 
Posts: 30 since May 2016
Thanks Given: 6
Thanks Received: 4

Hi,

I would like to modify my DEMA calculation from the actual one based on the current time resolution to another resolution.
For example, my signal which works on 5 minutes resolution is also triggered by DEMA values but.... with the following code I attach below, the DEMA is calculated on the same 5minutes bars while I desire that my DEMA indicator in my code calculates over daily bars (time resolution daily and not 5 min. wich is the time for the signal). Is it possible to make changing the code?

Actual code for DEMA based on Xaverage function:
 
Code
inputs: 
Price(Close), Length(260);
 
vars: 
X1(0), X2(0), Dema(0)

X1= XAverage(Price,Length);
X2= XAverage(XAverage(Price,Length),Length);
DEMA = X1 * 2 - X2;



and Xaverage function:

 
Code
inputs: 
	PriceValue( numericseries ), 
	Len( numericsimple ) ;                                             

variables: 
	var0( 2 / ( Len + 1 ) ) ;

if CurrentBar = 1 then
	XAverage = PriceValue
else
	XAverage = XAverage[1] + var0 * ( PriceValue - XAverage[1] ) ;

Thank you


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Iran and Israel Stand Down: What $9M in Peace Contracts …
Prediction Markets & Event Contracts
The Backwardation Signal: How the CL Futures Curve Tells …
Commodities
Sundays Verdict: Lebanon Locked at 99.85% as Iran June 7 …
Prediction Markets & Event Contracts
ATFX Suspends Prop Trading Unit ATFunded -- Full Review …
Funded Trading Evaluation Firms
Khamenei Vetoes Uranium Transfer as Peace Odds Surge to …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
NexusFi site changelog and issues/problem reporting
16 thanks
Darmok and Jalad at Tanagra
3 thanks
Big Mike in Ecuador
2 thanks
CME Expands 24/7 Trading to WTI Crude Oil and Gold -- We …
1 thanks
30 Sessions
1 thanks
  #2 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,448 since Apr 2013
Thanks Given: 494
Thanks Received: 1,643

auato,

you can accomplish your goal by basing your code on another datastream (like data2). However this datastream needs to be present on your charts.
You can find plenty of examples here on nexusfi.com (for example ) or in the official forum. The FAQ thread there will also give you some good information to start with https://www.multicharts.com/discussion/viewtopic.php?f=16&t=6929#p31165 and https://www.multicharts.com/discussion/viewtopic.php?f=16&t=6929#p35429).

Regards,

ABCTG


Follow me on X Reply With Quote
  #3 (permalink)
auato
Bradenton
 
Posts: 30 since May 2016
Thanks Given: 6
Thanks Received: 4


Is it possible to use the second streaming in the backtest?


Reply With Quote
  #4 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,448 since Apr 2013
Thanks Given: 494
Thanks Received: 1,643

auato,

yes, a second datastream can be used in a backtest, too.

Regards,

ABCTG


Follow me on X Reply With Quote




Last Updated on October 2, 2017


© 2026 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 - Downloads - Top
no new posts