Problem creating fresh 'clean slate' chart sheet

21/2/18
I am a newborn newbie. And worse still, I'm old (66)!
Let me preface by saying that I very, very rarely change or create AFL formulas.
In that respect I’m also naïve.
Recently added a 9th sheet
and it's not a 'a blank slate' in that when I drag and drop price on it, it shows an odd chart (not of price, but more like RSI) with negative values on the Y axis.
It's as if I must have fiddled with AFL formulas; but I try not to do so as I don't understand that language.
It also seems that when I do this, an unwanted RS base ticker usually is included - which also stuffs up the chart.
Thank you for helping me out in simple language (English)
Harry

@harryzehnwirth, there is detailed documentation on How to use drag-and-drop charting interface

In particular, see the section about how to remove the unwanted indicators plot from the selected chart pane.
From the popup menu (activated with a RIGHT mouse button click) that shows a list of all the "drag&drop" indicators that are included in the formula, you should select the one that you want permanently erase from it.

In the worst case you can repeat the procedure, deleting all the indicators, one by one: when the chart is blank (and there is a message at the top saying that the formula is empty) drag&drop again your favorite indicator/s.

If Auto-save for layouts is not checked in your Preferences / Miscellaneous tab, do not forget to save the modified layout.

Thanks Beppe,
You’ve sent me in the right direction, I think.
What I have found using those manoeuvres is that the ‘Price’ that I drag in to a fresh chart keeps company with other (unwanted) indicators.
[/uploads/default/original/2X/c/c5a3a9079c164942c488a5199859cfe882212042.png]So the[/uploads/default/original/2X/3/33b2edb8e62a298b8dec015729e6608e28525567.jpg] generic ‘price’ in the ‘Charts’ column on the left
has the formula below even before drag and drop.

[/uploads/default/original/2X/a/a9f7f07f942e041dcb448f4b0e9ad1c75a60b4ee.jpg]

Over a period of months I guess it has been unwittingly ‘corrupted’ by me.

How do I normalize that Price formula?

Thanks,
Harry Zehnwirth

@harryzehnwirth, you may post the source code (not a picture) of that "corrupted" formula here, and probably we can help you to understand how to fix it and explain to you what part of the formula is generating the issue you are facing. (Please, specify what version of AB are you using).
To get the formula, press the RIGHT mouse button on the chart and from the popup menu select "Edit formula".

When posting AFL code here, please be sure to use the </> button to paste it.

I recommend you to read also Files and directories used by AmiBroker to understand what files are used and managed by AmiBroker.
If needed, this will help you in the future to make selective backup copies of some important files that you can recover in case of corruption/mistakes.

Thank you Giuseppe,
I have Amibroker 5.8
When I drag just the price to the chart, the formula is:

_SECTION_BEGIN("Price");
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() );

base = ParamStr("RS base ticker", GetBaseIndex() );
Plot( RelStrength(base), _SECTION_NAME() + "(" + base + ")", ParamColor( "color", colorCycle ), ParamStyle("Style") );

Plot( AccDist(), _DEFAULT_NAME(), ParamColor("Color", colorCycle ), ParamStyle("Style") );

_SECTION_END();

Thanks again for helping
Harry

@harryzehnwirth a basic plot for price is as follow:

_SECTION_BEGIN("Price");
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() );
_SECTION_END();

You need to remove the extra lines.

To clean up the formula in the hidden drag-drop folder do as follow:

  • Select the "File" menu item "New blank chart".
  • In the new blank chart "Insert Linked" (DO NOT drag-drop) the formula you want to fix (Price) - Refer to the document I linked yesterday.
  • (Close the extra empty pane).
  • The chart will now display the plot with the extra stuff.
  • With the right button of the mouse open the popup menu and select "Edit formula".
  • Modify as per the above code.
  • Save the edited formula.

Now you can close this extra chart (no longer needed) and try to add the "Price" with drag&drop to any other chart/sheet.

P.S. Here is a link to learn how to paste code correctlye in the forum

2 Likes

Giuseppe,
You are clearly the best!
Thanks ever so much
Harry

1 Like