NexusFi: Find Your Edge


Home Menu

 





John Ehlers ZERO LAG alagrande's version for THINKORSWIM


Discussion in ThinkOrSwim

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




 
Search this Thread

John Ehlers ZERO LAG alagrande's version for THINKORSWIM

  #1 (permalink)
alagrande
glendale ca usa
 
Posts: 97 since Sep 2017
Thanks Given: 11
Thanks Received: 88

#NICA_ZEROLAG
#This is my version, anyone is welcome to play with it and modify it for better results.


input length = 20;
input GainLimit = 50;

input length2 = 4;
input GainLimit2 = 20;

def alpha = 2/ (length + 1);
def alpha2 = 2/ (length2 + 4);


def EMA = alpha*close + (1 - alpha)*EMA[1];
def EMA2 = alpha2*close + (1 - alpha2)*EMA2[1];


def Value1 = -GainLimit + GainLimit;
def Gain = Value1/10;

def Value2 = -GainLimit2 + GainLimit2;
def Gain2 = Value2/10;

def EC = alpha*(EMA + Gain*(close-EC[1]))+ (1 - alpha)*EC[1];
def Error = Close - EC;

def EC2_ = alpha2*(EMA2 + Gain2*(close-EC[1]))+ (1 - alpha2)*EC[1];
def Error2 = Close - EC2_;

def BestGain = Gain;
def BestGain2 = Gain2;

DEF LeastError = 1000000;

plot EC1 = alpha*(EMA + BestGain*(Close - EC[1])) + (1 - alpha)*EC[1];
EC1.setDefaultColor(color.orange);

plot EC2 = alpha2*(EMA + BestGain2*(Close - EC[1])) + (1 - alpha2)*EC[1];
EC2.setDefaultColor(color.UPTICK);

plot EMA44 = alpha2*close + (1 - alpha2)*EMA[1];
#Plot1(EC);

#Plot3(EMA);

addcloud(EC1, EC2, COLOR.RED, COLOR.GREEN);

ASSIGnPriceColor(IF EC1<EC2 [1] then color.cyan else if EC1>EC2[1] then color.yellow else color.current);

##

Reply With Quote
Thanked by:




Last Updated on June 23, 2018


© 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