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

Fw: [amibroker] Exploration Questions: Sorting, display decimals, array functions and price chg functions


  • To: "Amibroker Yahoo Group" <amibroker@xxxxxxxxxxxxxxx>
  • Subject: Fw: [amibroker] Exploration Questions: Sorting, display decimals, array functions and price chg functions
  • From: "Steve Dugas" <sjdugas@xxxxxxxxxxx>
  • Date: Wed, 23 Nov 2005 23:23:57 -0500

PureBytes Links

Trading Reference Links

Hi again - just figured out what you were asking for in #3. You can combine your arrays like this:
 
tArray = IIf( bArray OR sArray, rsiArr, 0 );
AddColumn( tArray, "rsiTrade", 1.2 );
 
Steve
 
----- Original Message -----
Sent: Wednesday, November 23, 2005 11:05 PM
Subject: Re: [amibroker] Exploration Questions: Sorting, display decimals, array functions and price chg functions

Hi,
 
1. Two ways I know of:
    1)  Use the Osaka Plugin, it can be found in the files section of the Amibroker-DLL Yahoo Group.
    2)  Multiply or divide one of the columns by 1000 (or some factor), then add them together. The resulting column will contain the two original columns seperated by a comma or decimal point which can then be sorted.
 
2. In AddColumn statements, change 1.0 to 1.2
 
3. See 2nd part of answer to 1st question. No built-in function.
 
4.
N = 3;
PctChg = ( ref( Close, N ) - Close ) / Close * 100;
AddColumn( PctChg, "% Price Chg", 1.2 );
 
Steve
 
----- Original Message -----
Sent: Wednesday, November 23, 2005 9:03 PM
Subject: [amibroker] Exploration Questions: Sorting, display decimals, array functions and price chg functions

Hi,

I have a couple of questions based on this exploration example:

 

//Constants

RSI_BUY_SIG = 25;

RSI_SELL_SIG = 75;

RSI_PER = 5;

 

rsiArr = RSI( RSI_PER );

 

//only set if it's the first time RSI crosses threshold, otherwise set to 0

bArray = IIf(rsiArr < RSI_BUY_SIG && Ref( rsiArr, -1 ) > RSI_BUY_SIG, RSI( RSI_PER ), 0 );

 

//only set if it's the first time RSI crosses threshold, otherwise set to 0

sArray = IIf(rsiArr > RSI_SELL_SIG && Ref( rsiArr, -1 ) < RSI_SELL_SIG ,RSI( RSI_PER ), 0);

 

color = IIf( RSI( RSI_PER )< RSI_BUY_SIG , colorGreen, colorRed ) ;

 

AddColumn( bArray , "rsiBuy", 1.0, colorDefault, color );

AddColumn( sArray , "rsiSell", 1.0, colorDefault, color );

AddColumn( C , "Close", 1.0, colorDefault, color );

 

Filter = bArray > 0 || sArray > 0  ;

 

 

In the above example, I am basically listing the price and RSI each time it crossed above 75 or below 25.  My questions are:

  1. Is there a way to programmatically sort by multiple columns in an exploration (i.e sort by the color scheme ( which is based on condition “RSI( RSI_PER) < RSI_BUY_SIG)  then by date )?
  2. The above shows the rsiBuy, rsiSell and Close column values in whole numbers, why is this and how can I tell it to display with a two decimal precision?
  3. In the code above, i am using two arrays, bArray and sArray, however I would like to display these in one column since there will never be a “collision” for a given bar.  I realize there are other ways of modifying the above code to do this, but wanted to know if there is any type of array union function in AFL, or would I have to do this in a for loop? 
  4. I would like to expand the above to add a “% Price Chg” column.  I would this to be the % gain in price after N days from when the buy/sell signal occurs (so N would be a new constant, i.e. if N=3 then I’d like to know how much the price move 3 periods after the signal).  I am not clear what functions would facilitate this or if this would require looping.

 

Thanks much
    


--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.5/178 - Release Date: 11/22/2005



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