Can AFL on Price chart, INSERT a new chart and Plot to it?


Before I start… I read this and it is not what I want to do:


  1. Run my AFL (with IB connection and autotrading) on the PRICE chart - this calculates all my indicators/variables for me based on my parameters I set on the overall AFL.
  2. From the AFL running on the price chart, I want to INSERT a blank chart, and then plot my variables on that chart UNDER the price chart and sync’d to the price chart for time/range bars.

Can you do this? I searched this forum and I read the manual and don’t see any functions to do this.

I DON’T want to run the same code on a separate chart and switch based on ChartType like this

ChartType = ParamList("Chart Type", "Price Chart|Indicator"); //

if (ChartType == "Price Chart") // Price Chart

if (ChartType == "Indicator") // 
Plot(a1, "MyIndicator1", colorRed, styleThick );
Plot(a2, "MyIndicator2", colorGreen, styleThick );

Thanks in advance !

  1. Do all calculations in step one and save the results you need in static variables
  2. insert a new panel, read the static variables you saved in step 1 and plot your indicators


Yep, good advice. That would certainly work, and keep all the code in the orginal AFL.

Thank you !