I have been dealing with this very same problem for a few months now.
My comments on Mike's three suggestions below.
1. This is the best suggestion for an accurate solution. Because you
can actually test whether or not "time order" matters. Historical 1
minute data is available. You can b
I found an error in how I calculated the cash settlements at expiration.
Below is the fixed code.
All comments, suggestions, and improvements are most welcome!!
Warm regards,
David
// This option trading strategy is not intended to make money.
// It is intended to demonstrate the use of AmiBrok
Need help with position size - how position size is determined in backtesting?
In one example of my backtest, first trade bought 50 shares, then 40 shares in
the second trade, then 30 shares, then 180 shares, then 30, then 290, then 400,
then 1080, ...to 5160 shares in the last trade. Why is thi
Thank you guys for helping me out.
My problem was the last line in my text files was only a .
So the last record was always nothing. So I thought I was doing something
wrong.well I was but just not what I thought.
--- In amibroker@yahoogroups.com, "Mike" wrote:
>
> The sample in the docs ca
you need to run a batch file and call the script from there
- Original Message -
From: B S
To: amibroker@yahoogroups.com
Sent: Thursday, June 03, 2010 7:12 PM
Subject: [amibroker] Run .js file from Windows Task Scheduler - Possible?
Hi-
I currently use a .js file to r
Can senior members please translate for me the following from MetaStock language to the AFL ?I want to have the enter & exit arrows also.Thank you.vgakkharWriteIf(F1:=ValueWhen(1,HRef(L,-2) AND Ref(L,-1)>Ref(L,-2) AND Ref(L,-3)>Ref(L,-2) AND Ref(L,-4)>Ref(L,-2),Ref(L,-2));a:=Cross(H,F1);b:=Cross
Can senior members please translate for me the following from MetaStock language to the AFL ?I want to have the enter & exit arrows also.Thank you.vgakkharWriteIf(F1:=ValueWhen(1,HRef(L,-2) AND Ref(L,-1)>Ref(L,-2) AND Ref(L,-3)>Ref(L,-2) AND Ref(L,-4)>Ref(L,-2),Ref(L,-2));a:=Cross(H,F1);b:=Cross
Hi-
I currently use a .js file to run a number of scans around the same time each
night. I have the .js saved to my desktop and just double click it -- then
everything is done automatically. What I'm wondering is, can I have Task
Scheduler (or something else) do the double clicking for me at
As requested --
//CalculateMovingAverageLooping.afl
//
//Calculate a simple moving average using looping code
//
//Howard Bandy
//June 2010
//
//In Formula Editor, click Apply Indicator.
//Note that all three moving averages are the same
//Plot the price series
Plot(
Mike--
Thank you. I'll try that and let you know!
Cheers,
Luc
--- In amibroker@yahoogroups.com, "Mike" wrote:
>
> Do not call Equity.
>
> I haven't looked in a while, but I believe that the default behavior is to
> allocate all available funds to the first signal anyway. So, your code would
The sample in the docs can be modified to store the record, instead of printing
it. The value held after the loop will be the last record.
e.g. (untested)
List = "";
fh = fopen( "quotes.csv", "r");
if( fh )
{
while( ! feof( fh ) )
{
List = fgets( fh );
}
}
else
{
Assuming it is always the 4th item, you might use this
List="m,n,p,q";
fourthitem=StrExtract(List,3);
Title=" "+List+" 4th="+fourthitem;
You might have to mess with other String functions. Or you might have to count
commas in List and then extract the last one based on that.
- Original
I don't get a clue from the docs for fgets(). Can anyone point me in the right
direction?
--- In amibroker@yahoogroups.com, "ovtrad...@..." wrote:
>
>
>
> Check the docs for fgets, the example should get you started.
>
> ovt
>
> --- In amibroker@yahoogroups.com, "wpok543" wrote:
> >
> >
Do not call Equity.
I haven't looked in a while, but I believe that the default behavior is to
allocate all available funds to the first signal anyway. So, your code would
not change anything.
Change your AA Settings to provide detailed reporting and you will see exactly
what signals are comin
Actually, based on your description, you *are* using a conditional entry. You
enter only if price drops below the lower band. That's comparable to entering
only if price drops below some fraction of previous close.
The difference is that your low water mark is calculated using data from the
sam
Hi,
I am trying to implement a system in which each Buy or Sell signal uses the
entire amount of money available at that moment. I have tried by inserting the
following commands into my .afl strategy:
Equity(1)
SetPositionSize(100,2)
Unfortunately the back-testing result does not seem to chang
Thank You for your contribution in the vastly underdeveloped area.
Please keep us posted on progress.
Scott
--- In amibroker@yahoogroups.com, David wrote:
>
> I've figured out how to back test a single legged options trading strategy.
> The AmiBroker AFL code for one such strategy is below.
>
>
Interesting suggestions, Mike,
I'm not using conditional entries.
And, about what you say:
1) Intra-day data: I use too many stocks to obtain them easily. And the
backtest would last so much that it 'd be impossible.
2)Remove maxpositions. Yes, but in any day, I don`t know how many signals I can
Are you using conditional entries?
e.g. "If the Close has fallen 3 days in a row, then place a limit order
tomorrow 5% below today's Close"
If not, then see Tomasz's last reply. Otherwise, a couple of alternatives would
be:
1. Get intra-day data as Herman suggested.
2. Remove the max position
Reading again your message, I think you mean that whenever the signals "jump",
I have to buy the stock the next day, isn't it?
So the system is different..
I have to re-test, but if that's the only solution, I think my system will not
work that way..
--- In amibroker@yahoogroups.com, Tomasz
Thanks for the answer.
I really hope you are right, and I can improve my system, but I doubt it.
In fact I don't really understand you.
As to my knowledge, my system does not look into the future.
I don`t mind to explain a simplified and reduced version of my system:
I just buy any stock that fa
Hello,
"But, in the real world, I buy the stocks that first have a signal.
Usually, at the beginning of the session, the fastest moving stocks generate
the signal first. And the slowest stocks (who, sadly, used to be the best ones)
are never bought 'cause I have already bought the 10 stocks of t
if you are using Intraday data and Backtest in the 1-min TimeFrame you
shouldn't have this problem. You can of course not resolve a position
score based on real-time fill occurrence with EOD data.
If you get more that one signal in one minute (it happens) than you
will have to start using tick
Thank you very much for your answer.
I did understand the backtest working, but I think I haven't explained my
problem correctly.
Of course I have the maxopenpositions set to ten, and, during the baktest
simulation I never buy more than 10 stocks.
The problem is, which 10 stocks does the backte
Hello,
You apparently don't understand how portfolio backtest works.
You should use SetOption("MaxOpenPositions", ... )
to limit the maximum number of open positions at any time.
Then using PositionScore you define YOUR preference regarding which
signals should
get priority. The backtester then
Hi
I have been using amibroker to test automated systems that purchase several
stocks at the same time, this is, a portfolio. I use end-of-day bars, reading
500 stocks from SP500.
I thought Amibroker was great for this job. But I have discovered now a big
problem related with portfolios.
Imagine
Hi Tomasz,
This last link and clearing the brower cache has solve the problem
Thanks for the great product and support !!
Regards
Steven
--- On Thu, 6/3/10, Tomasz Janeczko wrote:
From: Tomasz Janeczko
Subject: Re: [amibroker] AmiBroker 5.30.1 64-bit edition (experimental)
To:
I've figured out how to back test a single legged options trading strategy.
The AmiBroker AFL code for one such strategy is below.
All comments, suggestions, and improvements are most welcome!!
Warm regards,
David
// This option trading strategy is not intended to make money.
// It is intended
Hello,
Please try again with this one
http://www.amibroker.com/x64/vcredist_x64.exe
(make sure to clear your browser cache as you may be getting some old
copy from cache
instead of downloading it)
Best regards,
Tomasz Janeczko
amibroker.com
On 2010-06-03 08:34, Steve wrote:
Hello
I still
29 matches
Mail list logo