[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: Help with trading system



PureBytes Links

Trading Reference Links

There seems to be an issue with the volume. When I started reading this I thought you were trying to find stocks in an EOD database until I got to the 11:30 parameter. There is no way in an EOD data base to know the volume until the end of day. If you are using an intraday database then IB limits the number of stocks. This is especially true if you use their data feed, the limit is 100. You don't say what data feed you are using or how you find the stocks you are monitoring. 

As far as the code, it is straight forward to a point. The buy code without gap is easy;

buy = MACD (5,13,6) > 0 and Stochastic (14,1,3) >= 75 and volume > x and now(4) == 113000;

Gapup is a little harder. First are you looking for a gap relative to the previous day's close or the last intraday bar? If you are using an intraday database and you are concerned about the over night gap then you only want to compare the current open with the previous close. The close time varies with the type of security you are trading. If you are using a day chart then the code would be

OKgap = gapup() and Open - Ref(C, -1) < some amount;

It isn't likely macd or stoch will both give a signal on a gapdown day so you can ignore that case for a buy.

If you are using intraday chart and other than a day period then the code is more difficult because you have to get the value at the close of the previous day not the previous bar. That is much harder to code.

If you are using a static intraday database change the now(4) to timenum() which will give the bar time but to use that you must use a bar that gives a bartime of 1130. Use Now(4) with a live data feed and it will sample the volume at exactly 11:30 but make sure you account for the time zone change if your system is not on NY time.

The above is only possible with intraday data. If you are searching the EOD database leave the time comparison out. 

Now for the trailing stop. If you are doing this manually then you can find the trade price and place a stop order whereever. If you are using IBC then you have to ask TWS for the trade price after the trade has settled. That is a little harder. 

Malcomb added a lot of stuff you don't need to scan a database to find stocks that meet your criteria. It seems he is set up more for back testing than searching. When you search you can set the amount of days to look. It seems to me you would only want to look at one or a few days to find stocks that you might want to trade. Scan will dump them out in a list and you can run it daily and scan the results. You may also want to add price criteria to the scan if you are searching an EOD database.

Also it is not likely that you can use cross since the stoch and macd rarely cross on the same bar. If they do not cross on the same bar then you will never get a signal. You are on the right track using relationships of macd > 0 and stoch > somevalue.

>From this you may see that your question is not as straight forward as you might wish. If you are trying to do this while live trading the difficulty factor goes way up because there are a lot of things that happen that are not apparent with a static database.

Cheers,
Barry

--- In amibroker@xxxxxxxxxxxxxxx, "pstaffieri" <pstaffieri@xxx> wrote:
>
> Require a system that is user friendly where I can load on a nightly basis the following:
> 
> 1. New stocks
> 2. Volume trigger for stocks
> 3. Remove stocks from list
> 
> Also,
> 
> 1. Buys if volume reaches a certain level by 11:30 am, Stochastics (14,1,3) is 75 or over, MACD (5,13,6) is positive, stock has not gapped up/down by over 5 percent.
> 
> 2. Also, after a successful buy it will place a trainling stop of 2% and sell at the end of the day if a certain specific volume is reached for that stock.
> 
> Must be also compatible with the paper trading account at IB.
> 
> Thanks
>




------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/