Formula writing 1000 questions 70-71

70. Ask:
a:zig(4,10); tj:=a>ref(a,1) and a>refx(a,1); tj1:=a<ref(a,1) and a<refx(a,1) ; s:=if(tj or tj1,a,0); DRAWNUMBER(tj,a*(1+n1/1000),s,2)COLORMAGENTA,align0; DRAWNUMBER(tj1,a/(1+n1/1000) ,s,2)COLORGREEN,align0; I have such an indicator, and I want to make an early warning that it will not break the previous low, can it work Answer (vkioli2): {method 1} a:zig(4,10); tj:=a> ref(a,1) and a>refx(a,1); tj1:=a<ref(a,1) and a<refx(a,1); s:=if(tj or tj1,a,0) ; DRAWNUMBER(tj,ref(a,barslast(tj1)),s,2)COLORMAGENTA,align0; DRAWNUMBER(tj1,ref(a,barslast(tj)),s,2)COLORGREEN,align0; {method 2} a :zig(4,10); tj:=a>ref(a,1) and a>refx(a,1); tj1:=a<ref(a,1) and a<refx(a,1); s:=if(tj or tj1,a,0); b1:ref(a,barslast(tj1)); b2:ref(a,barslast(tj)); DRAWNUMBER(tj,b2,s,2)COLORMAGENTA; DRAWNUMBER(tj1,b1,s,2) COLORGREEN;QUOTE:71. Question: Can anyone manage to make the average cost line of changing hands not only show individual stocks but also be used in the market in the analyst's main chart? a1:=SUMBARS(v,CAPITAL); CMA:sum(AMOUNT,a1)/sum(v,a1)/100,PRECIS2, Color567A89; {100% change hands average cost line}; Answer (ahfyxl): A1:=SUMBARS(VOL,CAPITAL); CMA:IF(CAPITAL>0,SUM(AMOUNT,A1)/SUM(VOL,A1)/100 ,EMA(CLOSE,120)),PRECIS2; (Note) There are two problems when it is used in the market: 1. The CAPITAL=0 of the market, of course, can also be manually defined and assigned to it; 2. The market index is not the price, and the market average price A big difference. To solve the display problem of the indicator under the main chart of the market, it can be replaced by the moving average of the index.

Guess you like

Origin blog.csdn.net/qq974416775/article/details/129803422