Re: [Factor-talk] btp - My first body of Factor work
For #1, that is correct. If I come across a good lead on cheap (read free) intraday data I'll make sure I pass it your way - assuming you do the same that is :). Also if you decide to fork/tweak and add futures support, write a parser, etc. that would be very cool. I'd enjoy seeing what you come up with. If you decide to start something from scratch feel free to take any words from btp that are of use. Jon On Wednesday, November 13, 2013 5:19 PM, Dexter Haslem wrote: Great, 1) Understood, I assume it fills with an average price of the bar closing price? Honestly I'm not looking to gear it for backtesting day trades, I am considering tweaking things a bit to work with futures and would like to use settlement where possible, ultimately 2) Got it, I do not know of free intraday data either. Just a shot in the dark whether you already started tackling it. You'd also have to likely deal with sessions once you dig into inter-day bars :( I may write a parser for CQG Data Factory files which are pretty simple, if so I'll see how difficult getting daily going is. 3) Ah makes sense Thanks! On Wed, Nov 13, 2013 at 5:30 PM, Jon Herron wrote: > Hi Dexter - > > Thanks for checking out the code. Looks like you interpreted the code > correctly, hope I can do the same for your questions. > > 1) Currently the answer is yes. This however is not ideal, and is on my list > of (undocumented) TODOs. I was thinking of having something equivalent to > SML's Option. Not sure if something like that exists in Factor currently or > not. > > 2) Would love to. This is also something I considered but do not have (free) > access to less than daily data, at least that I am aware of. If you know > of a data provider from less than daily prices I'd love to hear about it. I > tried to make the individual pieces (data fetching vs signal detection vs > backtesting) separate so that any of the pieces could be swapped out for > another implementation. This of course has never actually been done yet, so > may not be as simple as it sounds. In theory though one could have a > different data fetching mechanism and plug that in to the rest of the app. > > 3) You do. The reasons for this are 1) I wanted to keep the main layers of > the app separate so they could in theory be swapped out for other > implementations, and 2) so that I could see the signals outside of an actual > backtest. For instance every Sunday I could run my weekly signals to see if > I should buy or sell from my current portfolio. I suppose a higher level > word such as detect-signals-and-backtest could be added. > > Hope that answers your questions. > > Jon > > > On Wednesday, November 13, 2013 3:36 PM, Dexter Haslem > wrote: > Hi Jon, > This is really great. I have a few questions. I'm still learning > Factor so I may have misunderstood the code, but these are more of > general usage questions: > > 1) Is any given signal price between high/low of the bar for the > period you select a buy/sell signal? > 2) Any thoughts about increasing granularity to below daily bars and > adding additional data providers? > 3) You have to do detect-signals before backtest, is that correct? It > seems redundant unless I am misunderstanding something > > > Thanks, > Dexter > > > On Thu, Nov 7, 2013 at 11:39 PM, Jon Herron > wrote: >> Hi all - >> >> About a month ago I got some really helpful feedback on the start of my >> backtesting app. Tonight I finally got something that is close enough to >> call version 0.1. So far the app supports downloading historical data, >> detecting signals and simulating buy/sells against a configurable >> brokerage >> account. At the end of the run a simple report is provided of the >> account's >> cash, assets, transactions and (really rough estimate of) taxes owed. >> >> There are still lots of things I want to do with the app, but wanted to >> go >> ahead and share it in the off chance it was of interest to anyone. >> >> https://bitbucket.org/jherron/btp >> >> As always, any feedback/bug reports/contributions are welcome, and thanks >> again for the help. >> >> Jon > >> >> >> -- >> November Webinars for C, C++, Fortran Developers >> Accelerate application performance with scalable programming models. >> Explore >> techniques for threading, error checking, porting, and tuning. Get the >> most >> from the latest Intel processors and coprocessors. See abstracts and >> register >> >> http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk >> ___ >> Factor-talk mailing list >> Factor-talk@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/factor-talk > >> > >-- DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access Free ap
Re: [Factor-talk] Some UI questions
Another question : for app distribution, can all the factor internal goodies be > turned off ( inspect, Prettyprint, etc ... ) ? >> > those things you get from right clicking on a object come from > http://docs.factorcode.org/content/article-ui-presentations.html > Looking at the implementation of object-operations, you can remove the > right click menu by setting the operations variable to f > Hm, actually for tables, these are not presentations. You can see the command-map in basis/ui/gadgets/tables/tables.factor which calls directly "show-table-menu" for a right click (button-down 3). So you can also subclass the table and add a command map on your subclass to just "drop" on "button-down 3" Jon -- DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access Free app hosting. Or install the open source package on any LAMP server. Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] btp - My first body of Factor work
Great, 1) Understood, I assume it fills with an average price of the bar closing price? Honestly I'm not looking to gear it for backtesting day trades, I am considering tweaking things a bit to work with futures and would like to use settlement where possible, ultimately 2) Got it, I do not know of free intraday data either. Just a shot in the dark whether you already started tackling it. You'd also have to likely deal with sessions once you dig into inter-day bars :( I may write a parser for CQG Data Factory files which are pretty simple, if so I'll see how difficult getting daily going is. 3) Ah makes sense Thanks! On Wed, Nov 13, 2013 at 5:30 PM, Jon Herron wrote: > Hi Dexter - > > Thanks for checking out the code. Looks like you interpreted the code > correctly, hope I can do the same for your questions. > > 1) Currently the answer is yes. This however is not ideal, and is on my list > of (undocumented) TODOs. I was thinking of having something equivalent to > SML's Option. Not sure if something like that exists in Factor currently or > not. > > 2) Would love to. This is also something I considered but do not have (free) > access to less than daily data, at least that I am aware of. If you know > of a data provider from less than daily prices I'd love to hear about it. I > tried to make the individual pieces (data fetching vs signal detection vs > backtesting) separate so that any of the pieces could be swapped out for > another implementation. This of course has never actually been done yet, so > may not be as simple as it sounds. In theory though one could have a > different data fetching mechanism and plug that in to the rest of the app. > > 3) You do. The reasons for this are 1) I wanted to keep the main layers of > the app separate so they could in theory be swapped out for other > implementations, and 2) so that I could see the signals outside of an actual > backtest. For instance every Sunday I could run my weekly signals to see if > I should buy or sell from my current portfolio. I suppose a higher level > word such as detect-signals-and-backtest could be added. > > Hope that answers your questions. > > Jon > > > On Wednesday, November 13, 2013 3:36 PM, Dexter Haslem > wrote: > Hi Jon, > This is really great. I have a few questions. I'm still learning > Factor so I may have misunderstood the code, but these are more of > general usage questions: > > 1) Is any given signal price between high/low of the bar for the > period you select a buy/sell signal? > 2) Any thoughts about increasing granularity to below daily bars and > adding additional data providers? > 3) You have to do detect-signals before backtest, is that correct? It > seems redundant unless I am misunderstanding something > > > Thanks, > Dexter > > > On Thu, Nov 7, 2013 at 11:39 PM, Jon Herron > wrote: >> Hi all - >> >> About a month ago I got some really helpful feedback on the start of my >> backtesting app. Tonight I finally got something that is close enough to >> call version 0.1. So far the app supports downloading historical data, >> detecting signals and simulating buy/sells against a configurable >> brokerage >> account. At the end of the run a simple report is provided of the >> account's >> cash, assets, transactions and (really rough estimate of) taxes owed. >> >> There are still lots of things I want to do with the app, but wanted to >> go >> ahead and share it in the off chance it was of interest to anyone. >> >> https://bitbucket.org/jherron/btp >> >> As always, any feedback/bug reports/contributions are welcome, and thanks >> again for the help. >> >> Jon > >> >> >> -- >> November Webinars for C, C++, Fortran Developers >> Accelerate application performance with scalable programming models. >> Explore >> techniques for threading, error checking, porting, and tuning. Get the >> most >> from the latest Intel processors and coprocessors. See abstracts and >> register >> >> http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk >> ___ >> Factor-talk mailing list >> Factor-talk@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/factor-talk > >> > > -- DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access Free app hosting. Or install the open source package on any LAMP server. Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] Factor interface to Spotlight
A good point, Björn - Since the number of elements is known beforehand in mdutil & mdls, an immutable array would suffice (& use less words). I carried the vector format over from a previous incarnation of , where I didn't know how many elems would be needed in the array. I'm not religious about mutating data structures, but your suggestion makes the code more succinct. Thanks, ~cw On Wed, Nov 13, 2013 at 5:04 AM, Björn Lindqvist wrote: > Here are some random tips from me. I'm also a Factor newbie so take it > with a grain of salt: > > * Don't use vectors because normal sequences works just as well. > * Be functional! Avoid words that mutate data structures because they > make the code harder to reason about. > > F.e. this piece of code in mdls: > > "mdls" 1vector swap suffix! > > can be written as just: > > "mdls" swap 2array > > Another example is your mdutil word: > > :: (mdutil) ( flags on|off volume root/owner -- seq ) > root/owner 1vector "-" flags append suffix! > "-i" suffix! on|off suffix! volume suffix! > > It's a great showcase for local variables but can be better written > without array mutations: > > :: mdutil ( flags on|off volume root/owner -- seq ) > root/owner flags "-" prepend "-i" on|off volume 5 narray > > > 2013/11/13 CW Alston : > > I've posted a new gist for spotlight.factor w/ filename & Factor > > formatting. > > I think I dealt with most of Alex's red-lines, & I shed the string > > constants. > > The whole thing is much shorter. The included examples work on my > machine. > > > > The file can be USE:d from the listener if you give it a folder in your > > 'work'. > > > > After a long divagation, looks like I've wound up back where John & Alex > > suggested I start, 3 weeks ago. Well, like I was warned in the Boy > Scouts, > > when you wander lost in the woods, you tend to go 'round in circles. > > Just couldn't see how to get on from there without a compass (or native > > guides), > > & I did learn a lot along the way. Still needs some improvement (maybe > bug > > fixes, too). > > > > In particular, I'd like to memoize an API call to > > MDSchemaCopyAllAttributes(), > > but I'm better at Chinese than C. Pointers on alien-invoke, or what else > to > > use? > > > > -- > mvh/best regards Björn Lindqvist > -- *~ Memento Amori* -- DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access Free app hosting. Or install the open source package on any LAMP server. Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] Some UI questions
Hi Manuel, On Wed, Nov 13, 2013 at 9:15 PM, wrote: > Could you please tell me how to detect when a value is already > opened > so that I don't open a second one ? How would I give it focus ? I have seen > the find-window word but I have not been able to do it. > you could store a reference in dynamic variable and use it to check if the window still opened in your action. Depending on the behavior you want, you can create a new dynamic scope for each "" call, or set the dynamic variable in the global scope. For example, store the gadget you create, and call "find-world handle>>" to see if the window is still opened; if a window is already opened, you can give it focus with http://docs.factorcode.org/content/word-request-focus,ui.gadgets.html > Another question : for app distribution, can all the factor internal > goodies be > turned off ( inspect, Prettyprint, etc ... ) ? > those things you get from right clicking on a object come from http://docs.factorcode.org/content/article-ui-presentations.html Looking at the implementation of object-operations, you can remove the right click menu by setting the operations variable to f And finally, is there somewhere a file explorer widget ? I don't think there is one, although it is possible to do cross-platform filesystem operations: http://docs.factorcode.org/content/article-io.directories.html so making a basic one shouldn't be too hard Cheers, Jon -- DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access Free app hosting. Or install the open source package on any LAMP server. Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] btp - My first body of Factor work
Hi Dexter - Thanks for checking out the code. Looks like you interpreted the code correctly, hope I can do the same for your questions. 1) Currently the answer is yes. This however is not ideal, and is on my list of (undocumented) TODOs. I was thinking of having something equivalent to SML's Option. Not sure if something like that exists in Factor currently or not. 2) Would love to. This is also something I considered but do not have (free) access to less than daily data, at least that I am aware of. If you know of a data provider from less than daily prices I'd love to hear about it. I tried to make the individual pieces (data fetching vs signal detection vs backtesting) separate so that any of the pieces could be swapped out for another implementation. This of course has never actually been done yet, so may not be as simple as it sounds. In theory though one could have a different data fetching mechanism and plug that in to the rest of the app. 3) You do. The reasons for this are 1) I wanted to keep the main layers of the app separate so they could in theory be swapped out for other implementations, and 2) so that I could see the signals outside of an actual backtest. For instance every Sunday I could run my weekly signals to see if I should buy or sell from my current portfolio. I suppose a higher level word such as detect-signals-and-backtest could be added. Hope that answers your questions. Jon On Wednesday, November 13, 2013 3:36 PM, Dexter Haslem wrote: Hi Jon, This is really great. I have a few questions. I'm still learning Factor so I may have misunderstood the code, but these are more of general usage questions: 1) Is any given signal price between high/low of the bar for the period you select a buy/sell signal? 2) Any thoughts about increasing granularity to below daily bars and adding additional data providers? 3) You have to do detect-signals before backtest, is that correct? It seems redundant unless I am misunderstanding something Thanks, Dexter On Thu, Nov 7, 2013 at 11:39 PM, Jon Herron wrote: > Hi all - > > About a month ago I got some really helpful feedback on the start of my > backtesting app. Tonight I finally got something that is close enough to > call version 0.1. So far the app supports downloading historical data, > detecting signals and simulating buy/sells against a configurable brokerage > account. At the end of the run a simple report is provided of the account's > cash, assets, transactions and (really rough estimate of) taxes owed. > > There are still lots of things I want to do with the app, but wanted to go > ahead and share it in the off chance it was of interest to anyone. > > https://bitbucket.org/jherron/btp > > As always, any feedback/bug reports/contributions are welcome, and thanks > again for the help. > > Jon > > -- > November Webinars for C, C++, Fortran Developers > Accelerate application performance with scalable programming models. Explore > techniques for threading, error checking, porting, and tuning. Get the most > from the latest Intel processors and coprocessors. See abstracts and > register > http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk > ___ > Factor-talk mailing list > Factor-talk@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/factor-talk >-- DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access Free app hosting. Or install the open source package on any LAMP server. Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] btp - My first body of Factor work
Hi Jon, This is really great. I have a few questions. I'm still learning Factor so I may have misunderstood the code, but these are more of general usage questions: 1) Is any given signal price between high/low of the bar for the period you select a buy/sell signal? 2) Any thoughts about increasing granularity to below daily bars and adding additional data providers? 3) You have to do detect-signals before backtest, is that correct? It seems redundant unless I am misunderstanding something Thanks, Dexter On Thu, Nov 7, 2013 at 11:39 PM, Jon Herron wrote: > Hi all - > > About a month ago I got some really helpful feedback on the start of my > backtesting app. Tonight I finally got something that is close enough to > call version 0.1. So far the app supports downloading historical data, > detecting signals and simulating buy/sells against a configurable brokerage > account. At the end of the run a simple report is provided of the account's > cash, assets, transactions and (really rough estimate of) taxes owed. > > There are still lots of things I want to do with the app, but wanted to go > ahead and share it in the off chance it was of interest to anyone. > > https://bitbucket.org/jherron/btp > > As always, any feedback/bug reports/contributions are welcome, and thanks > again for the help. > > Jon > > -- > November Webinars for C, C++, Fortran Developers > Accelerate application performance with scalable programming models. Explore > techniques for threading, error checking, porting, and tuning. Get the most > from the latest Intel processors and coprocessors. See abstracts and > register > http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk > ___ > Factor-talk mailing list > Factor-talk@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/factor-talk > -- DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access Free app hosting. Or install the open source package on any LAMP server. Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
[Factor-talk] Some UI questions
Hi All ! the more I look into Factor the more amazing I find it..both the language and the libraries. I have some UI-related questions. I have written a program which I have simplified in the code below. It lists 100 records, along with the square of each value. When you double click on a row, it displays a with the value. Could you please tell me how to detect when a value is already opened so that I don't open a second one ? How would I give it focus ? I have seen the find-window word but I have not been able to do it. Another question : for app distribution, can all the factor internal goodies be turned off ( inspect, Prettyprint, etc ... ) ? And finally, is there somewhere a file explorer widget ? I would like to thank everybody for all the work that has gone into making factor what it is today ! Thanks ! Manuel ! - USING: accessors colors.constants kernel math math.parser math.ranges models present sequences ui ui.gadgets.scrollers ui.gadgets.tables ui.gadgets.panes ; IN: sgui : make-sqseq ( val -- seq ) dup string>number sq present { } 2sequence ; SINGLETON: seq-renderer M: seq-renderer filled-column drop 1 ; M: seq-renderer column-titles drop { "Value" "Value squared" } ; M: seq-renderer row-columns drop make-sqseq ; M: seq-renderer row-color 2drop "black" named-color ; M: seq-renderer row-value drop ; : row-action ( val -- ) t >>scrolls? { 150 150 } >>pref-dim swap present open-window ; : ( -- table ) 100 [1,b] [ present ] map seq-renderer 8 >>gap COLOR: dark-gray >>column-line-color { 100 400 } >>pref-dim [ row-action ] >>action ; MAIN-WINDOW: sgui { { title "Simple GUI" } } >>gadgets ; ! - -- DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access Free app hosting. Or install the open source package on any LAMP server. Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] Factor interface to Spotlight
Here are some random tips from me. I'm also a Factor newbie so take it with a grain of salt: * Don't use vectors because normal sequences works just as well. * Be functional! Avoid words that mutate data structures because they make the code harder to reason about. F.e. this piece of code in mdls: "mdls" 1vector swap suffix! can be written as just: "mdls" swap 2array Another example is your mdutil word: :: (mdutil) ( flags on|off volume root/owner -- seq ) root/owner 1vector "-" flags append suffix! "-i" suffix! on|off suffix! volume suffix! It's a great showcase for local variables but can be better written without array mutations: :: mdutil ( flags on|off volume root/owner -- seq ) root/owner flags "-" prepend "-i" on|off volume 5 narray 2013/11/13 CW Alston : > I've posted a new gist for spotlight.factor w/ filename & Factor > formatting. > I think I dealt with most of Alex's red-lines, & I shed the string > constants. > The whole thing is much shorter. The included examples work on my machine. > > The file can be USE:d from the listener if you give it a folder in your > 'work'. > > After a long divagation, looks like I've wound up back where John & Alex > suggested I start, 3 weeks ago. Well, like I was warned in the Boy Scouts, > when you wander lost in the woods, you tend to go 'round in circles. > Just couldn't see how to get on from there without a compass (or native > guides), > & I did learn a lot along the way. Still needs some improvement (maybe bug > fixes, too). > > In particular, I'd like to memoize an API call to > MDSchemaCopyAllAttributes(), > but I'm better at Chinese than C. Pointers on alien-invoke, or what else to > use? -- mvh/best regards Björn Lindqvist -- DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access Free app hosting. Or install the open source package on any LAMP server. Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk