BullCharts Forum Homepage
Forum Home Forum Home > BullCharts > BullScript
  New Posts New Posts RSS Feed: Bullcharts developers kit?
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Bullcharts developers kit?

 Post Reply Post Reply
Author
Message Reverse Sort Order / View First Unread Post
timw View Drop Down
Newbie
Newbie


Joined: 29 Mar 2006
Location: Australia
Posts: 3
Post Options Post Options   Quote timw Quote  Post ReplyReply Direct Link To This Post Topic: Bullcharts developers kit?
    Posted: 04 Sep 2006 at 11:12am

I'd like to endorse the suggestion that there is an urgent need for a developers kit similar to that available for Metastock.

Brendan Lansdowne's advice to me when I enquired about this earlier in the year was to write my routines in VC++ and use an ODBC connection to connect to the Bullcharts database.  I have been forced to go this this way for some things but it involves a lot of work and we will eventually finish up rewriting Bullcharts if we continue with this approach :)

Another alternative we have considered is dropping Bullcharts and moving over to Metastock but this is also not an ideal option for us either as Bullcharts, in our experience is a superior product.  

A developers plug in kit would not only make it possible to do things which are quite impossible with Bullscript but it would also provide a means for those wishing to do so to provide commercial add-ons  without having to reinvent the wheel.

In my opinion this is an important feature that Bullcharts needs to seriously consider if they wish to maintain a lead over Metastock.

I'm happy to pay for a beta version of a Bullcharts developers kit and also assist with beta testing.

Regards

Tim Wilson

 

 

 

Back to Top
zorro View Drop Down
Newbie
Newbie
Avatar

Joined: 17 Apr 2005
Posts: 17
Post Options Post Options   Quote zorro Quote  Post ReplyReply Direct Link To This Post Posted: 29 Aug 2006 at 9:08pm
Take a look at the ExtFml function.
Back to Top
Gordon View Drop Down
Newbie
Newbie
Avatar

Joined: 21 Apr 2006
Location: Australia
Posts: 6
Post Options Post Options   Quote Gordon Quote  Post ReplyReply Direct Link To This Post Posted: 15 May 2006 at 10:34pm
Thanks very much for that. I'll have a look through it.

Cheers
Gordon
Back to Top
chart rider View Drop Down
Regular
Regular
Avatar

Joined: 25 Sep 2004
Location: Australia
Posts: 96
Post Options Post Options   Quote chart rider Quote  Post ReplyReply Direct Link To This Post Posted: 08 May 2006 at 6:03pm

Gordon

Attached is a basic one I found, using moving average cross overs and % trailing stop loss.  The results are shown as markers, but can be displayed as text by adding code to change the line type to text.

Is this the kind of thing you were looking for?

CR

{Input criteria}

 

startDate := inputdate("Start date");

endDate := inputdate("End date");

entryMA1 := input("entry fast MA", 10, 1);

entryMA2 := input("entry slow MA", 20, 1);

trailingPerc := input("Trailing Stop %", 5, 0);

 

{*********************************************************** **************************************************}

{fixed data}

 

tradeSize := 10000;

commission := 0.002*tradesize;

 

{*********************************************************** **************************************************}

{calculate moving averages}

ma1 := ma(C,entryMA1,E);

ma2 := ma(C,entryMA2,E);

 

{*********************************************************** **************************************************}

{Detect entry trigger}

validDate := now>=startDate and now<=endDate; {check that time is within the nominated trade dates}

 

maEntry := hist(cross(ma1, ma2) ,1);

 

enterWhen := maEntry and validDate;

 

{*********************************************************** **************************************************}

{Detect exit triggers}

 

{Detect moving average exit}

maExit := hist(cross(ma2, ma1) ,1);

 

{Detect date exit}

dateExit := if(now>=endDate,1,0);

 

{Detect SL exit}

anotherExit := maExit;

SLposition := if(enterWhen,1,if(anotherExit,0,prev));

buyToday := SLposition=1 and hist(SLposition,1)=0;

dayAfterBuy := hist(buyToday,1)=1;

 

{stop loss or profit protection, based on closing prices}

trailingSL := highestsince(1, dayAfterBuy, hist(C,1)*(1-trailingPerc/100));

 

SLexit := C<=trailingSL and hist(C,1)>trailingSL;

 

{Set exit trigger}

exitWhen := hist(maExit,1) or hist(SLexit,1) or dateExit;

 

{*********************************************************** **************************************************}

{Calculate buy & sell prices and determine position status}

 

buyPrice := (H+L)/2;

sellPrice := (H+L)/2;

 

position := if(enterWhen,1,if(exitWhen,0,prev));  {Determine position status based on ma entry and exit}

enterReal := position=1 and hist(position,1)=0;

lastBuy := if(enterReal,buyPrice,prev);

exitReal := position=0 and hist(position,1)=1;

 

{*********************************************************** **************************************************}

{Calculate win size and accumulated profit}

 

shareQty := tradeSize/lastBuy;

tradeWin := (if(exitReal, sellPrice-lastBuy, 0)*shareQty - commission)*100/tradeSize;

profit := if(exitReal, (tradeWin+prev), prev);

 

{Display results}

Win := if(tradeWin>0, tradeWin, 0);

Loss := if(tradeWin<0, tradeWin, 0);

 

[color=black];  {Display entry mark}

if(enterReal,5,0);

 

[color=limegreen];

Win;

 

[color=red];

Loss;

 

[color=blue];

profit;

 

 

Back to Top
Gordon View Drop Down
Newbie
Newbie
Avatar

Joined: 21 Apr 2006
Location: Australia
Posts: 6
Post Options Post Options   Quote Gordon Quote  Post ReplyReply Direct Link To This Post Posted: 08 May 2006 at 1:35pm
CR

Thanks. That would be brilliant if you could do that.

Gordon
Back to Top
chart rider View Drop Down
Regular
Regular
Avatar

Joined: 25 Sep 2004
Location: Australia
Posts: 96
Post Options Post Options   Quote chart rider Quote  Post ReplyReply Direct Link To This Post Posted: 06 May 2006 at 11:47am

Gordon

In earlier days, before I started using TradeSim, I used to run backtests on individual stocks, displaying entries, exits and summary of results as text in an indicator pane.

I'll have a search through my old scripts later on and see what I can rustle up.

CR

Back to Top
Gordon View Drop Down
Newbie
Newbie
Avatar

Joined: 21 Apr 2006
Location: Australia
Posts: 6
Post Options Post Options   Quote Gordon Quote  Post ReplyReply Direct Link To This Post Posted: 06 May 2006 at 11:30am
Thankyou for your reply. I can do what you are saying but what I want is a bit different from this. My interest is in trying to construct a mechanical trading system with Bullcharts and have the results displayed on a chart. That is, show all the entry and exit points over however many years of data exist for any particular stock. That way I can examine what has happened and fine tune the system.

To illustrate my problem, let me describe a very simple (and probably very unprofitable) trading system.
  1. We enter when the 5 day moving average crosses above the 20 day moving average.
  2. Our stop is placed atr(10) below the highest low achieved since entering the trade. Therefore, we have a trailing stop that is always tightening upwards.

For an entry to be valid it mustn’t be already entered. This means it has to know if a previous stop has been hit or not. After all, before a trade is stopped out the entry conditions might be met a number of times. I’m only interested in the first of these because the trailing stop is based upon that first entry. As a result I would expect to see a repeated series of enter/stop on the chart.

Here is my problem; the entry point has to know about stops and the stops have to know about entry points. It’s this chicken and the egg problem that’s really baffling me at the moment. I simply can’t figure out how to script something even this simple. And yet, many trading systems are based around concepts like this – so I don’t think I’m asking for something too exotic. If anyone can show me how to implement this simple system it I’d be really grateful. With that as a starting point I’m sure I could take it from there.

Gordon



Edited by Gordon
Back to Top
chart rider View Drop Down
Regular
Regular
Avatar

Joined: 25 Sep 2004
Location: Australia
Posts: 96
Post Options Post Options   Quote chart rider Quote  Post ReplyReply Direct Link To This Post Posted: 05 May 2006 at 8:08pm

Gordon

Not sure of the level of complexity you're looking for, but the trailing stops shown on the link are easily programmable with Bullscript by inputing the trade date into the indicator.  The indicator will plot from that date on.

If you are after more info, I may be able to find the script that I've used previously to do just this kind of thing.

CR

Back to Top
Gordon View Drop Down
Newbie
Newbie
Avatar

Joined: 21 Apr 2006
Location: Australia
Posts: 6
Post Options Post Options   Quote Gordon Quote  Post ReplyReply Direct Link To This Post Posted: 03 May 2006 at 12:42pm
I've noticed that Metastock has a Developers Kit. I was wondering if there is an equivalent for Bullcharts. I can program in C++ and would like to be able to build indicators that are almost impossible to create with the current Bullscript - like trailing stops, etc. See http://www.tradernexus.com/advancedstop/advancedstop.html for what I mean.

Gordon
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.69
Copyright ©2001-2010 Web Wiz