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

RE: [amibroker] Re: Importing a signal file



PureBytes Links

Trading Reference Links

No. But if you plan on updating the data for recent trades, Quote Editor
will not let you add a -1. You either add the recent quotes to your .csv
file and re-import -or- you allow a 2 to represent a short and "fix" it
with this code or similar:


sig1 = ParamStr("Enter ticker of 1st Signal");
//...
tradeSig1 = ParamToggle("Trade Signal 1","Off,On",1);
//...
SetForeign(Sig1);
    cond1 = C;
    sig1FN = FullName(); //Store the FullName
    cond1 = IIf(cond1 == 1,1,IIf(cond1 == 0 OR cond1 == 3,0,-1));
    cond1 = cond1 * tradeSig1; //Allows to turn off Sig1
    if (sig1 == "None") tradeSig1 = False; //if True no ticker picked
RestorePriceArrays();

The above example sets:
 1 = 1 (or long)
 0 and 3 = 0 (or Cash)
 any other value = -1 (or Short)
--
Terry

-----Original Message-----
From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On
Behalf Of techsmart
Sent: Wednesday, December 28, 2005 07:15
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Re: Importing a signal file

So, Terry, are you saying I need to replace the -1's with 2's before 
importing?  Then convert the 2's to -1's when I plot with 'foreign'? 
Not sure I understand, but maybe it will be apparent after I give 
this a try.

ty,

ts

--- In amibroker@xxxxxxxxxxxxxxx, "Terry" <MagicTH@xxxx> wrote:
>
> Yes, just use File->Import wizard. Be sure to check accept negative
> prices. Note that Quote Editor will NOT let you enter a negative 
value.
> To work around this, when you read the file allow for both -1 and 2 
to
> represent a short trade (I convert 2's to -1 after reading in the 
file
> using Foreign.)
> 
> --
> Terry
> -----Original Message-----
> From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] 
On
> Behalf Of techsmart
> Sent: Tuesday, December 27, 2005 19:29
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] Importing a signal file
> 
> I have a signal file from another source that I'd like to import 
into 
> AB to use in backtesting.
> 
> The file consists of:
> 
> date,#
> 
> as in:
> 
> 1/2/88,1
> 1/3/88,1
> 1/4/88,0
> 1/5/88,-1
> ...etc
> 
> such that 1=long, 0=cash, -1=short.
> 
> Is there a way to import this into an AB formula to plot as an 
> indicator?
> 
> ts
> 
> 
> 
> 
> 
> 
> 
> 
> 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
>







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



 




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