NexusFi: Find Your Edge


Home Menu

 





DEMA calculation on different time resolution


Discussion in MultiCharts

Updated
    1. trending_up 1,837 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?
Saylors 41-Month HODL Breaks: Strategy Sells 32 BTC as $ …
Prediction Markets & Event Contracts
Trump Truth Social Fires Hormuz From 10% to 59% -- Arsen …
Prediction Markets & Event Contracts
April CPI Preview: +3.7% YoY Expected at 8:30 AM ET -- C …
Traders Hideout
Khamenei Vetoes Uranium Transfer as Peace Odds Surge to …
Prediction Markets & Event Contracts
Penalties in Budapest, Peace Deadline in Tehran: Arsenal …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
The Pivot Point 113.6³ — Navigating the Prediction of …
26 thanks
Sober Journey With S&P
17 thanks
The Confluence Meter: A Multi-Layered Signal Framework B …
11 thanks
NT8 color choices
10 thanks
Volume Indicators
7 thanks
  #2 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,447 since Apr 2013
Thanks Given: 493
Thanks Received: 1,639

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,447 since Apr 2013
Thanks Given: 493
Thanks Received: 1,639

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