NexusFi: Find Your Edge


Home Menu

 





DEMA calculation on different time resolution


Discussion in MultiCharts

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




 
Search this Thread

DEMA calculation on different time resolution

  #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?
MC PL editor upgrade
MultiCharts
Cheap historycal L1 data for stocks
Stocks and ETFs
ZombieSqueeze
Platforms and Indicators
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
 
  #2 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629

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 and https://www.multicharts.com/discussion/viewtopic.php?f=16&t=6929).

Regards,

ABCTG

Follow me on Twitter 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,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629

auato,

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

Regards,

ABCTG

Follow me on Twitter Reply With Quote




Last Updated on October 2, 2017


© 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