Well, I can replicate your "experiment" and I can resolve it by following
Marcin's response (below) to your email and adjusting the periodicity
settings in the AA Window to match the periodicity of the data. So, there
appears to be nothing wrong with the formula or AB, just the settings.

On Thu, Dec 17, 2009 at 8:28 PM, Gray Bohon <[email protected]> wrote:

>
>  [Attachment(s) <#1259f66f25d1ec2b_TopText> from Gray Bohon included
> below]
>
> List:
>
> I'm not getting a very prompt response from tech support on this.  I would
> appreciate it if someone on the list could try to replicate my "experiment"
> and let me know if you are producing the same result.  Basically take the
> code below, put it in an exploration, name it, run it with a live chart in
> the workspace using the "Explore" button in the Automatic Analysis window,
> and look at the output in the trace output window.  Does the user-defined
> variable populate with a value other than zero?
>
> I'm trying to isolate this down to either a problem with my own
> system/settings, or the functioning of AB.
>
> Thanks in advance.
>
> -GB
>
> The Code:
>
>
>
> // Test the MA crossover exploration...
>
>  // long trades entry and exit rules:
>
> MovAvg =
> EMA( *Close*, 15 );
> *
>
> Buy
> * = Cross( *Close*, MovAvg );*
>
> Sell
> * = Cross( MovAvg, *Close* );*
>
> Buy
> * = ExRem(*Buy*, *Sell*);*
>
> Sell
> * = ExRem(*Sell*, *Buy*);*
>
> Filter
> *=*Buy* *OR* *Sell*;
>
> AddColumn
> ( *Close*, "Close" );
>
> //AddColumn( MovAvg, "MovAvg" );
>
> _TRACE
> ("sell..." + LastValue(*Sell*) + " buy..." + LastValue(*Buy*));
>
> _TRACE
> ("Close..." + LastValue(*C*));
>
> _TRACE
> ("MovAvg..." + LastValue(MovAvg));
>
> ----- Forwarded Message ----
> *From:* Gray Bohon <[email protected]>
> *To:* AMIBROKER SUPPORT <[email protected]>
> *Sent:* Wed, December 16, 2009 9:20:06 AM
> *Subject:* Re: [#66304] Fw: [amibroker] Re: Problems with tracing variable
> value through exploration...
>
>  I am using 1-minute bars.  See the bottom-most message I sent to the
> message board.  Intentionally I'm using something that triggers a ton of
> signals and is itself probably unusable as a trading system, just for this
> troubleshooting effort.
>
> As I mentioned below, when I run the exploration as a chart rather than
> through the Automatic Analysis window, it runs as expected.  The problem is,
> that's not going to allow me to apply the exploration the way I want to, to
> a list of stocks.
>
> *Please try to replicate the problem on your own system*:  I am running AB
> 5.20, build date Nov. 26, 2008.  I always run the latest version of IB TWS,
> currently build 900.6, which was updated just a couple days ago.
>
> My chart is a 1 minute chart of USD.CAD-IDEALPRO-CASH.
>
> Please see the following attachments:
>
> 1.  Autorun_Settings:  Shows my settings on the AA window, when I was
> trying to run it on a timed cycle.
> 2.  Autorun_Settings2:  Shows my settings on the AA window today, when I am
> executing the run's manually.
> 3.  Run_As_Chart:  Shows what happens when I double click the exploration
> under the menu tree, which launches it as a "chart."  Note that the data is
> refreshed at the IB data feed rate of 1X/3sec.  Note also that the array
> variable MovAvg has been populated.  This is the code working.  The AFL is
> named Test_Exploration_MAxOver3.afl.
> 4.  Run_As_Chart2:  Same as previous, only now a sell signal has been
> generated on this bar, showing again that the code works in this mode.  I
> deleted the exploration "chart" to freeze it's execution.
> 5.  Run_Under_Automatic_Analysis:  Note that I am running the same AFL;
> Test_Exploration_MAxOver3.afl.  When I hit the "Explore" button, the trace
> results are shown. Note that the MovAvg variable is populated with 0.
>
> Thanks. -GB
>
>  ------------------------------
> *From:* AMIBROKER SUPPORT <[email protected]>
> *To:* Gray Bohon <[email protected]>
> *Sent:* Wed, December 16, 2009 3:35:28 AM
> *Subject:* Re: [#66304] Fw: [amibroker] Re: Problems with tracing variable
> value through exploration...
>
> Hello,
>
> Do you have enough data for the calculation? Note that the interval used by
> exploration is set through SETTINGS of Automatic Analysis window (set the
> PERIODICITY to the appropriate interval). If you're using DAILY, then all
> the calculations are based on daily candles and you need more than 15-days
> for the very first available value of EMA-15.
>
> Best regards
>
> Marcin Gorzynski
> Amibroker.com <http://amibroker.com/> Technical Support
>
> ----- Original Message ----- From: "Gray Bohon" <[email protected]>
> To: <[email protected]>
> Sent: Wednesday, December 16, 2009 2:53 AM
> Subject: [#66304] Fw: [amibroker] Re: Problems with tracing variable value
> through exploration...
>
>
> Please see the below. The problem statement is: "User-defined array in an
> exploration reporting null values when the exploration is run from the
> Automatic Analysis window." Is this a bug? Or am I just missing something
> here?
>
> Thanks in advance.
> -GB
>
>
>
> ----- Forwarded Message ----
> From: Gray Bohon <[email protected]>
> To: [email protected]
> Sent: Tue, December 15, 2009 6:46:54 PM
> Subject: Re: [amibroker] Re: Problems with tracing variable value through
> exploration...
>
>
> Mike, thanks for the input. I had tried that previously; tried again. It is
> not working. Here is the new code:
>
> // Test the MA crossover exploration... // long trades entry and exit
> rules:MovAvg = BuySellBuySellFilter=Buy OR Sell; =  =  =  = EMA( Close,
> 15);Cross( Close, MovAvg );Cross( MovAvg, Close );ExRem(Buy,
> Sell);ExRem(Sell, Buy);AddColumn( Close, "Close");//AddColumn( MovAvg,
> "MovAvg" );_TRACE("sell..."+ LastValue(Sell) + " buy..."+
> LastValue(Buy));_TRACE("Close..."+ LastValue(C));_TRACE("MovAvg..."+
> LastValue(MovAvg));
> Here is the output from the trace log. Here, I just hit "Explore" several
> times rather than run it on an interval:
>
> sell...0 buy...0 C:\Program
> Files\AmiBroker\Formulas\Custom\Test_Exploration_MAxOver3.afl 17 65
> 18:16:35.64
> Close...1.0609 C:\Program
> Files\AmiBroker\Formulas\Custom\Test_Exploration_MAxOver3.afl 18 33
> 18:16:35.64
> MovAvg...0 C:\Program
> Files\AmiBroker\Formulas\Custom\Test_Exploration_MAxOver3.afl 19 39
> 18:16:35.64
> sell...0 buy...0 C:\Program
> Files\AmiBroker\Formulas\Custom\Test_Exploration_MAxOver3.afl 17 65
> 18:16:38.79
> Close...1.0609 C:\Program
> Files\AmiBroker\Formulas\Custom\Test_Exploration_MAxOver3.afl 18 33
> 18:16:38.79
> MovAvg...0 C:\Program
> Files\AmiBroker\Formulas\Custom\Test_Exploration_MAxOver3.afl 19 39
> 18:16:38.79
> sell...0 buy...0 C:\Program
> Files\AmiBroker\Formulas\Custom\Test_Exploration_MAxOver3.afl 17 65
> 18:16:51.45
> Close...1.0609 C:\Program
> Files\AmiBroker\Formulas\Custom\Test_Exploration_MAxOver3.afl 18 33
> 18:16:51.45
> MovAvg...0 C:\Program
> Files\AmiBroker\Formulas\Custom\Test_Exploration_MAxOver3.afl 19 39
> 18:16:51.45
> sell...0 buy...0 C:\Program
> Files\AmiBroker\Formulas\Custom\Test_Exploration_MAxOver3.afl 17 65
> 18:17:03.87
> Close...1.0609 C:\Program
> Files\AmiBroker\Formulas\Custom\Test_Exploration_MAxOver3.afl 18 33
> 18:17:03.87
> MovAvg...0 C:\Program
> Files\AmiBroker\Formulas\Custom\Test_Exploration_MAxOver3.afl 19 39
> 18:17:03.87
>
> (The consistent value for the Close is what the market is actually doing
> right at the moment. That is an accurate dynamic value....)
>
> In any case, I need to get it to print the array value and verify that the
> arrays are working properly. This is really just a troubleshooting exercise
> for a bigger project. Ultimately, I have array manipulations that I need to
> run, for my trading system calculations, on a list of stocks using an
> exploration from the Automatic Analysis window. In particular, I'm trying to
> implement the "AutoTrade using an Exploration" code posted by Peter Kuskopf
> to the KB, for my own trading system. I have been struggling with that,
> because the buy/sell signals are not being generated. It appears that the
> root cause of that problem is this issue of the user-defined arrays not
> being populated when running the exploration under the AA window.
>
> Ultimately, I want to monitor (RT) a large list of stocks for trade
> setup/execute conditions, and autogenerate orders to my IB account. The code
> posted by Kuskopf (meant to run as an exploration) seemed like the most
> straigtforward way to do that. If anyone else has any suggestions for a
> better way to do that, I would like to hear them.... I definately do not
> want to have a zillion charts open to do it. The main reason I migrated from
> Tradestation.
>
> Thoughts, anyone?
>
> Thanks. GB.
>
>
>
> ________________________________
> From: Mike <[email protected]>
> To: [email protected]
> Sent: Tue, December 15, 2009 12:41:50 PM
> Subject: [amibroker] Re: Problems with tracing variable value through
> exploration...
>
>
> Try passing a scaler to the _TRACE instead of an array. Since you are
> interested in the most recent value, just use the LastValue function in the
> trace:
>
> _TRACE("sell. .." + LastValue(Sell) + " buy..." + LastValue(Buy) );
>
> _TRACE("Close. .." + LastValue(C) );
>
> _TRACE("MovAvg. .." + LastValue(MovAvg) );
>
> Mike
>
> --- In amibro...@yahoogrou ps.com, Gray Bohon <egbo...@... > wrote:
> >
> > List:
> >
> > I've done some more tinkering with application of the below (very simple)
> code. I am using IB's data feed. What I've discovered is that, if I take
> my exploration and double-click it to launch it as a "chart," the values are
> reported properly to the Trace window, RT.
> >
> > If I run the exporation from the Automatic Analysis window, it reports
> the RT values of the Close properly, however, the values of the moving
> average are always reported as 0.
> >
> > Does anyone have an idea of why this is happening?Â
> >
> > (This is actually a major problem for me, since I want to run the
> Exploration every few seconds on a list of tickers, not just one....)
> >
> > Thx. GB.
> >
> >
> >
> >
> > ____________ _________ _________ __
> > From: Gray Bohon <egbo...@... >
> > To: amibro...@yahoogrou ps.com
> > Sent: Mon, December 14, 2009 2:24:54 PM
> > Subject: Problems with tracing variable value through exploration. ..
> >
> >
> > I am doing some testing with explorations. I'm trying to get what seems
> like a very simple exploration to work, and its not doing what I would have
> expected.
> >
> > Here is my code:
> >
> > // Test the MA crossover exploration. .. // long trades entry and exit
> rules:MovAvg = EMA( Close, 15);BuySell
> >  Filter=Buy OR Sell; = = Cross( Close, MovAvg );Cross( MovAvg, Close
> );AddColumn
> >  ( Close, "Close");_TRACE( "sell..." + Sell+ " buy..."+ Buy);_TRACE(
> "Close... "+ C);_TRACE
> > Â
> > Â
> > I have the exploration set to run every 30 sec, on a chart that has
> 1-minute bars. There are plenty of signals that should be triggered by the
> data.
> > Â
> > For some reason, the variable "MovAvg" is reported in the trace-log theÂ
> when I initially run the exploration, but registers a value 0 on
> subsequent itterations as it autoruns.Â
> > Â
> > I think I must be missing a setting or something. Attached is my autorun
> setup.Â
> > Â
> > Any ideas on why this is happening? The value of the Close is reported
> accurately by every itteration of the autorun. The values of Buy and Sell
> are also reported, though I think is not working right based on the problem
> with "MovAvg."
> > Â
> > Thanks in advance.
> > Â
> > -GB("MovAvg. .."+ MovAvg);
> >
>
>
>
>  
>

Reply via email to