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

Re: [amibroker] Programming advice requested



PureBytes Links

Trading Reference Links

Chuck,
    From more detail you have given, It looks like my version isn't 
exactly what you want.
    However, I think it's along similar lines at to what you want to achive.
    Perhaps you can modify my code to suite your needs more specificaly.

    You can download it now here: 
http://www.amibroker.org/3rdparty/BasicPortfolioTracker_V1.zip

The code I have posted will:
    Record trade details like buy price, date etc.
    Store these details in an external file.
    It is a TWO chart system, One for Writing the data, One for 
checking/creating alerts.
    The Alert checking chart reads the data written from the 1st chart's 
data file.

Gocha's
    It's only basic - So It doesn't have Sell point written to file for 
later reference.
    You can not write a buy in the future (Unless you manualy modify the 
datafile)

New functions
    Perhaps with the new X-Shift function, You will be able to mark a 
buy in future bars.
    Im not sure if X-Shift is implemented in any of the beta's yet.......

ATB
    Michael.

cstrader wrote:

> OK, I can see the logic of making, in essence, a new static variable 
> for each bar of interest.  But aren't these static variables 
> completely lost at the end of the day?  I'd like to be able to mark 
> the bar permanently with the information, so that I can backtest it 
> over time.  Also, using static variables and/or selectedvalue() are 
> problematic for me because they are not conducive to plotting the 
> trades over time.  And AA simply can't deal with them.  What I want to 
> do is to write the information into an array....
>  
> It seems to me that there might well be an internal function that 
> allows this....all that's really necessary is to create a dynamic 
> table with datetime() and whatever other values one wants to save.  
> It's just like the data plugin writing to the data table as bars come in.
>  
> I'm looking forward to Mike's solution too.
>  
> chuck
>  
>
>     ----- Original Message -----
>     *From:* Herman van den Bergen <mailto:psytek@xxxxxxxx>
>     *To:* amibroker@xxxxxxxxxxxxxxx <mailto:amibroker@xxxxxxxxxxxxxxx>
>     *Sent:* Tuesday, February 28, 2006 7:39 PM
>     *Subject:* RE: [amibroker] Programming advice requested
>
>     Yes, that is what I tried to explain... you place your cursor on
>     the selected bar, which identifies its X-datetime position by way
>     of the SelectedValue(DateTime()). You save the trade information
>     something like staticvarsettext("Trade"+DateTimeNum,
>     OrderType+Numtostr(TradePrice,1.2). You set the OrderType and
>     TradePrice using param(). Then in your plotText() loop you compare
>     this variable name to the DateTim in the loop, if it matches you
>     PlotText(... staticvargettext("Trade"+DateTimeNum),...). Most of
>     the time the staticvar you are reading return empty, and you don't
>     plot anything.
>      
>     hope this helps...perhaps i miss something
>      
>     herman
>      
>
>         -----Original Message-----
>         *From:* amibroker@xxxxxxxxxxxxxxx
>         [mailto:amibroker@xxxxxxxxxxxxxxx]*On Behalf Of *cstrader
>         *Sent:* Tuesday, February 28, 2006 7:08 PM
>         *To:* amibroker@xxxxxxxxxxxxxxx
>         *Subject:* Re: [amibroker] Programming advice requested
>
>         That's not quite what I need.
>          
>         Say my guru tells me to buy at 11:12 tomorrow AM.  I'd like to
>         mark that bar with a buy, and remember that it is a buy.  So
>         i'd like to be able, on the fly, to mark a bar with a signal
>         and perhaps a price, and to save it for later use.
>          
>         Thanks
>          
>         chuck
>          
>          
>          
>
>             ----- Original Message -----
>             *From:* Herman van den Bergen <mailto:psytek@xxxxxxxx>
>             *To:* amibroker@xxxxxxxxxxxxxxx
>             <mailto:amibroker@xxxxxxxxxxxxxxx>
>             *Sent:* Tuesday, February 28, 2006 5:47 PM
>             *Subject:* RE: [amibroker] Programming advice requested
>
>             If you haven't done so, have a look at the PlotText(),
>             this allows you to place text anywhere on the chart. It
>             gives an example of how to display the words "Buy" and
>             "Sell" and price next to the bar. Also look at the
>             VarSetText() and VarGetText().
>              
>             To add text to the selected or lastbar you would use the
>             SelectedValue( barIndex()) or LastValue(BarIndex()) as the
>             name for your StaticVar in which you store the info you
>             want to show. When looping you read the barindex() for
>             each bar, set BI = barIndex() and in your loop use BI[i]
>             to look for a non-empty static variable.
>              
>             At the start the system can read a simple text file and
>             transfer them to StaticVar. At the closing of the system
>             you can use a ParamTrigger to load and save the parameters
>             to a simple text file. 
>              
>             Hope this sketchy info helps...
>             herman 
>
>                 -----Original Message-----
>                 *From:* amibroker@xxxxxxxxxxxxxxx
>                 [mailto:amibroker@xxxxxxxxxxxxxxx]*On Behalf Of *cstrader
>                 *Sent:* Tuesday, February 28, 2006 4:34 PM
>                 *To:* amibroker@xxxxxxxxxxxxxxx
>                 *Subject:* [amibroker] Programming advice requested
>
>                 I would like to add something to my trading that I
>                 have not yet found to be available.  Basically, I'd
>                 like to be able to write my own information onto a bar
>                 in real time (for instance a manually-entered trade
>                 entry or exit), and to do this from the chart
>                 window (parameters menu).  This information should
>                 remain available in a hard disk file when AB closes.
>                  
>                 I'm thinking I need to create a dynamic array table of
>                 some sort that also gets written to disk and which
>                 contains both the date/time code and the new
>                 information.  I know that there is the OSAKA plugin
>                 which seems to do something like this, and perhaps
>                 that is my best option?  Alternatively, I could write
>                 to a foreign ticker, but I'm not sure that's possible
>                 from the chart menu.
>                  
>                 Any advice appreciated....
>                  
>                 thanks
>                  
>                 chuck
>                  
>                  
>                  
>
>
>
> Please note that this group is for discussion between users only.
>
> To get support from AmiBroker please send an e-mail directly to
> SUPPORT {at} amibroker.com
>
> For other support material please check also:
> http://www.amibroker.com/support.html
>
>
>



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Try Online Currency Trading with GFT. Free 50K Demo. Trade 
24 Hours. Commission-Free. 
http://us.click.yahoo.com/RvFikB/9M2KAA/U1CZAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html

 
Yahoo! Groups Links

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

<*> 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/