- Joined
- 17 June 2019
- Posts
- 19
- Reactions
- 0
Hello All,
Here is my code....if you run an exploration in Amibroker you will see four columns. The last colum is supposed to be the difference between the second and third....but no! It seems my remap is affecting the result, but I dont know how or why...if the remap lines are commented out, the calculation is correct...help please...TIA.
x = ROC (C, 10);
y = ROC (C, 20);
z = ROC (C, 30);
today = x + y + z;
OneDayAgo = Ref(today,-1);
TwoDaysago = Ref(today,-2);
change = onedayago-today;
today = Remap( today, LastValue( Lowest( today ) ), LastValue( Highest( today ) ), -1,1);
OneDayAgo = Remap( OneDayAgo, LastValue( Lowest( OneDayAgo ) ), LastValue( Highest( OneDayAgo ) ), -1,1);
TwoDaysago = Remap(TwoDaysago, LastValue( Lowest( TwoDaysago ) ), LastValue( Highest( TwoDaysago ) ), -1,1);
change = Remap( change, LastValue( Lowest( change ) ), LastValue( Highest( change ) ), -1,1);
Filter=1;
AddColumn(Twodaysago,"2 Days Ago ",1.2,textcolor=colorwhite,IIf(twodaysago>0,bkgndColor = colorgreen,colorred));
AddColumn(OneDayAgo,"1 Day Ago ",1.2,IIf(onedayago<twodaysago,textcolor=colorYellow,colorblack),IIf(onedayago>0,bkgndColor = colorgreen,colorred));
AddColumn(today,"Today ",1.2,IIf(today<onedayago,textcolor=colorYellow,colorWhite),IIf(today>0,bkgndColor = colorgreen,colorred));
AddColumn(change,"o/night change",1.2,IIf(today<onedayago,textcolor=colorYellow,colorwhite),IIf(change<0,bkgndColor = colorRed,colorGreen));
Here is my code....if you run an exploration in Amibroker you will see four columns. The last colum is supposed to be the difference between the second and third....but no! It seems my remap is affecting the result, but I dont know how or why...if the remap lines are commented out, the calculation is correct...help please...TIA.
x = ROC (C, 10);
y = ROC (C, 20);
z = ROC (C, 30);
today = x + y + z;
OneDayAgo = Ref(today,-1);
TwoDaysago = Ref(today,-2);
change = onedayago-today;
today = Remap( today, LastValue( Lowest( today ) ), LastValue( Highest( today ) ), -1,1);
OneDayAgo = Remap( OneDayAgo, LastValue( Lowest( OneDayAgo ) ), LastValue( Highest( OneDayAgo ) ), -1,1);
TwoDaysago = Remap(TwoDaysago, LastValue( Lowest( TwoDaysago ) ), LastValue( Highest( TwoDaysago ) ), -1,1);
change = Remap( change, LastValue( Lowest( change ) ), LastValue( Highest( change ) ), -1,1);
Filter=1;
AddColumn(Twodaysago,"2 Days Ago ",1.2,textcolor=colorwhite,IIf(twodaysago>0,bkgndColor = colorgreen,colorred));
AddColumn(OneDayAgo,"1 Day Ago ",1.2,IIf(onedayago<twodaysago,textcolor=colorYellow,colorblack),IIf(onedayago>0,bkgndColor = colorgreen,colorred));
AddColumn(today,"Today ",1.2,IIf(today<onedayago,textcolor=colorYellow,colorWhite),IIf(today>0,bkgndColor = colorgreen,colorred));
AddColumn(change,"o/night change",1.2,IIf(today<onedayago,textcolor=colorYellow,colorwhite),IIf(change<0,bkgndColor = colorRed,colorGreen));