Adding value to cell manually

need help as the below photo

table on a chart

peak valley

thank you

with NoteGet( "" ) you can receive values from the notepad in the afl. With StrLeft, StrFind or StrToNum you can detect the two values. Good luck.

@needhelp - you have to be MORE specific and precise as to what you want to achieve and what the picture you have drawn is supposed to show.
Is it supposed to show an exploration (as table form suggests)? Or chart?
Do you have any formula that you wrote already? What did you try yourself?

Unfortunately your question isn't clear enough and does not provide all necessary details to give you an answer.

We don't read anybody's else mind. You have to SPELL OUT what you have in your mind.
Please follow this advice: How to ask a good question

Thank you
I would like to draw table in the chart
1- Frist row is: the table name (one cell)
2- Second row contain three cells
3- The rest of the table contain 5 rows and 7 cells in each raw
4- Frist column of the five rows contain the title of the row as (wave 1 – wave 2 - etc.)

////// In the Second row there are 3 cells ////////
1st cell contains the name WAVE
Second cell it is empty and I should enter manually (the peak value)
third cell it is empty and I should enter manually (the valley value)
based on the peak value and the valley value the rest of empty cells will be filled auto base on the formula in the FLA
the other table is vice versa ( valley – peak )
table in the chart example

fxshrat

there is another one for you

I think it was about open high low close Volume in table
https://www.amibroker.com/guide/h_lowlevelgfx.html

https://www.amibroker.com/members/library/detail.php?id=1533&hilite=GfxSelectPen

Tomasz

it is clear or do you want to explain it more

thank you

You did not explain the GOAL. I.e. WHY do you want to do that and why in chart?

Generally tables are straightforward if you use tool designed for table output, i.e. exploration How to create your own exploration

It is always better to use right tool (hammer to hit the nail) than the incorrect tool (hammer to kill the fly).

It is possible to draw table in the chart using low level gfx functions Using low-level graphics but I see no reason to do so when easier method exists.

1 Like

Tomasz
good that you ask

I review the ( Using low-level graphics )

but I could not figure it out ( I do know why ( maybe the age)).

from this link

I try to to divide the coddler codding ( to study what he did or how he did wrote the code)

for tomasze 2

Do not expect that all users of Ambroker from the generation of technology
There are people from the old generation. The Excel Sheet generation.

i am not bad in The Excel Sheet.

i had trade navigator ( that time they will send you the software in CD by mail)
they have very good support but their market data was not good at all

I had MTPredictor but they have an issue (They put their ideas in technical analysis (useful for people who are not familiar with technical analysis))
their ideas not bad.

I bought Amibroker two time
2004 (I did not use it, I used trade navigator and ELWAVE)
2021

i hope Amibroker will jump to next stage .

For the member of Aimbroker

We are in a dark tunnel and so far, it is not clear the end of the tunnel

Beware that some companies may declare bankruptcy

If you do not know the time to enter the market, it is better to watch and save your money

The option trading is an option, but choose a reliable company ( be with the trend)

Does interest will go up more than what it is? I think yes it will. ) They have to raise the interest rate, the faster, the better(

Do not rely on technical indicators, as they are helper only to clarify the vision of the market

John J. Murphy - Bill M Williams and others did their parts.

thank you to Cougar

https://forum.amibroker.com/t/own-adx-indicator-calculation-in-excel/3908/10?u=needhelp

i will use the gfx for switching.

so I am learning but in different way.

hi Tomasz

for asking

when i add my number in the top textbox and i add the formula in the rest of the text boxes
it is not calculated


_SECTION_BEGIN("Moon Calendar Trading System (MCTS)");

SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 
procedure SetOrigin(x0, y0) {
	global _x0, _y0;
	_x0 = x0; _y0 = y0;
}

procedure GfxSetColors(fgColor, bgColor) {
	GfxSetTextColor(fgColor); GfxSetBkColor(bgColor); 
	GfxSelectPen(fgColor); GfxSelectSolidBrush(bgColor);
}
procedure GfxFrame(titl,hheight, x, y, width, height, textColor, bgColor) {
	global _x0, _y0;
	x = x+_x0; y = y+_y0;
	GfxSetColors(textColor, bgColor);
    GfxRoundRect(x, y+0.5*hheight, x+width, y+height, 5, 5);
    if (titl != "") {
		w = GfxGetTextWidth(titl)*0.68; m = x+width*0.5;
		// GfxRectangle(m-w, y+1, m+w, y+hheight-1); 
		GfxRoundRect(m-w, y+1, m+w, y+hheight-1, 5, 5); 
		GfxDrawText(titl, x, y, x+width, y+hheight, 1|4|32);
		
    }
}

// Gui* part - Edit control

function EditNumber(idEdit, initialValue, x, y, width, height, textColor, bgColor) {
    global _x0, _y0;
	local rc;
	
    x = x+_x0; y = y+_y0;
    rc = GuiEdit( idEdit, x, y, width, height, 0); 
    if( rc == guiNew ) GuiSetValue(idEdit, initialValue ); 
    GuiSetColors( idEdit, idEdit, 1, textColor, bgColor, textColor);
   
    
    return GuiGetValue(idEdit);
}


 DT_VCENTER = 4 | 32; 
// format: 0 left, 1 center, 2 right
procedure GfxLabel(text, x, y, width, height, format) {
	global _x0, _y0;
	x = x+_x0; y = y+_y0;
	GfxDrawText( text, x, y, x+width, y+height, format | DT_VCENTER ); 
}

procedure GfxLabel2(text2, x, y, width, height, format) {
	global _x0, _y0;
	x = x+_x0; y = y+_y0;
	GfxDrawText( text2, x, y, x+width, y+height, format | DT_VCENTER ); 
}
procedure GuiDemos(x,y) {
	local n,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,
	      n12,n13,n14,n15,n16,n17,n18,n19,n20
	      ,n21,n22,txt;
	
	// GfxSelectFont("Arial", 9); GuiSetFont("Arial", 10);
	SetOrigin(x,y);
	GfxFrame("Moon Night Calendar Trading System", 30, 0, 30, 600, 600, colorWhite, colorblack); // 30, 0, 30, 700, 180, colorWhite, colorblack(30, 0, 30, WITDTH, HIGHT, colorWhite, colorblack )
	SetOrigin(x+20,y+30);
		///////////// TEXTBOX //////////////
	n = EditNumber(1, 0, 45, 65, 80, 25, colorBlue, colorYellow);
	n2 = EditNumber(2, 0, 400, 65, 80, 25, colorBlue, colorYellow); //2, 0, 200, 65, 80, 25, colorBlue, colorYellow ## SECOUND TEXTBOX, formula , LIFT / RIGHT, HIGHT/LOW, WIDTH OF THE TEXT BOX , HIGHT OF THE TEXT BOX
	
	n3 = EditNumber(3, (n2+n)/2, 180, 150, 80, 25, colorBlue, colorYellow);//textbox # , formula , LIFT / RIGHT , HIGHT/LOW , WIDTH OF THE TEXT BOX , HIGHT OF THE TEXT BOX.
	n4 = EditNumber(4, (n2+n)/2, 280, 150, 80, 25, colorBlue, colorYellow);
	n5 = EditNumber(5, (n2+n)/2, 380, 150, 80, 25, colorBlue, colorYellow);
	n6 = EditNumber(6, (n2+n)/2, 480, 150, 80, 25, colorBlue, colorYellow);
	
	n7 = EditNumber(7,(n2+n)/3 , 180, 240, 80, 25, colorBlue, colorYellow);
	n8 = EditNumber(8, (n2+n)/3, 280, 240, 80, 25, colorBlue, colorYellow);
	n9 = EditNumber(9, (n2+n)/3, 380, 240, 80, 25, colorBlue, colorYellow);
    n10 = EditNumber(10, (n2+n)/3, 480, 240, 80, 25, colorBlue, colorYellow);
	                                                                           // add formula for missing 3 days here
	n11 = EditNumber(11, (n2+n)/4, 180, 330, 80, 25, colorBlue, colorYellow);
	n12 = EditNumber(12, (n2+n)/4, 280, 330, 80, 25, colorBlue, colorYellow);
	n13 = EditNumber(13,(n2+n)/4, 380, 330, 80, 25, colorBlue, colorYellow);
	n14 = EditNumber(14, (n2+n)/4, 480, 330, 80, 25, colorBlue, colorYellow);
	
	n15 = EditNumber(15, (n2+n)/2 , 180, 420, 80, 25, colorBlue, colorYellow);
	n16 = EditNumber(16, (n2+n)/2, 280, 420, 80, 25, colorBlue, colorYellow);
	n17 = EditNumber(17, (n2+n)/2, 380, 420, 80, 25, colorBlue, colorYellow);
	n18 = EditNumber(18, (n2+n)/2, 480, 420, 80, 25, colorBlue, colorYellow);
	
	n19 = EditNumber(19, (n2+n)/2, 180, 510, 80, 25, colorBlue, colorYellow);
	n20 = EditNumber(20, (n2+n)/2, 280, 510, 80, 25, colorBlue, colorYellow);
	n21 = EditNumber(21, (n2+n)/2, 380, 510, 80, 25, colorBlue, colorYellow);
	n22 = EditNumber(22, (n2+n)/2, 480, 510, 80, 25, colorBlue, colorYellow);
	
	
	///////////////////////////////        LABEL        /////////////////////////////////////////
	          //HIGH First (add it manually from the moon trading system application ( desktop pc) ) //
	GfxLabel(" HFFM: "+n, 10, 30, 140, 30, 1);
	         //LOW LAST (add it manually from the moon trading system application ( desktop pc)) // ************************** to remmember  **********( convert the date or find the equivalent date  for the hi point and low point
	GfxLabel(" LLFM: "+n2, 350, 30, 140, 30, 1); // 110, 30, 140, 30, 1) LIFT / RIGHT, HIGHT/LOW, 140, 30, 1
	         //Waning(gibbous + quarter) 6 DAYS//
 	GfxLabel("WAN GQ: ", 0, 150, 140, 30, 1);
 	         //  Waning( quarter + crescent) 6 DAYS //
    GfxLabel("WAN QC: ", 0, 240, 140, 30, 1);
             // Dark Moon) 3 DAYS+ MISSING 3 DAYS //
    GfxLabel(" DM: ", 0, 330, 140, 30, 1);
             // waxing (crescent+ quarter) 6 DAYS //
     GfxLabel(" WAX CQ: ", 0, 420, 140, 30, 1);
             //  waxing ( quarter + gibbous) 6 DAYS //
       GfxLabel(" WAX QG: ", 0, 510, 140, 30, 1);
}

x = Param("x_origin", 20, 0, 1980, 20);
y = Param("y_origin", 20, 0, 1024, 20);
demo = ParamToggle("Show Demo", "No|Yes", 1);

if (demo) {
	
	GuiDemos(x+80, y+80);
	
}

if there is short for the code or better idea for the setting.

but something I can understand it

I could not modify the one in Low-level graphics

https://www.amibroker.com/guide/afl/gfxdrawtext.html

thank you

EditNumber() is misused. The second argument is the initial value, if you want to display a computed value in the box you must either modify the function as in

function SetNumber(idEdit, Value, x, y, width, height, textColor, bgColor) {
    global _x0, _y0;
	local rc;
	
    x = x+_x0; y = y+_y0;
    rc = GuiEdit( idEdit, x, y, width, height, 0); 
    GuiSetValue(idEdit, Value ); 
    GuiSetColors( idEdit, idEdit, 1, textColor, bgColor, textColor);
   
    return Value;
}
/*
Then modify all lines (replace EditNumber by SetNumber) starting from n3:
	n3 = SetNumber(3, (n2+n)/2, 180, 150, 80, 25, colorBlue, colorYellow);
// etc
*/

or simply use GfxLabel() to display the computed value (invert colors first).

Cheers.

1 Like

thank you for your reply

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.