July 20, 2012 11:54
THIS IS A BETA VERSION OF THE SOFTWARE. EXPECT BUGS !!!
Backup your data files and entire AmiBroker folder first!
INSTALLATION INSTRUCTIONS
IMPORTANT: This archive is update-only. You have to install full version 5.50 first.
Just run the installer and follow the instructions.
Then run AmiBroker. You should see "AmiBroker 5.55.0 BETA" written in the About box.
See CHANGE LOG below for detailed list of changes.
CHANGE LOG
CHANGES FOR VERSION 5.55.0 (as compared to 5.54.0)
The function queries current state of keyboard keys (at the time of the call).
vkey is virtual key code to query (see table below).
The function returns 0 if key is NOT pressed and value < 0 ( less than
zero) when key is currently pressed.
Example:
Plot( C, "Close", colorRed );
vk_Shift = 16;
if( GetAsyncKeyState(
vk_Shift ) < 0 ) Title = "Shift
is pressed";
Virtual Key codes:
vk_BackSpace = 8;
vk_Tab = 9;
vk_Return = 13;
vk_Shift = 16;
vk_Control = 17;
vk_Alt = 18;
vk_Pause = 19;
vk_CapsLock = 20;
vk_Escape = 27;
vk_Space = 32;
vk_PageUp = 33;
vk_PageDown = 34;
vk_End = 35;
vk_Home = 36;
vk_Left = 37;
vk_Up = 38;
vk_Right = 39;
vk_Down = 40;
vk_PrintScreen = 44;
vk_Insert = 45;
vk_Delete = 46;
/* NOTE: vk_0..vk_9 vk_A.. vk_Z match regular ASCII codes for digits and A-Z letters */
vk_0 = 48;
vk_1 = 49;
vk_2 = 50;
vk_3 = 51;
vk_4 = 52;
vk_5 = 53;
vk_6 = 54;
vk_7 = 55;
vk_8 = 56;
vk_9 = 57;
vk_A = 65;
vk_B = 66;
vk_C = 67;
vk_D = 68;
vk_E = 69;
vk_F = 70;
vk_G = 71;
vk_H = 72;
vk_I = 73;
vk_J = 74;
vk_K = 75;
vk_L = 76;
vk_M = 77;
vk_N = 78;
vk_O = 79;
vk_P = 80;
vk_Q = 81;
vk_R = 82;
vk_S = 83;
vk_T = 84;
vk_U = 85;
vk_V = 86;
vk_W = 87;
vk_X = 88;
vk_Y = 89;
vk_Z = 90;
vk_LWin = 91;
vk_RWin = 92;
vk_Apps = 93;
/* numerical key pad */
vk_NumPad0 = 96;
vk_NumPad1 = 97;
vk_NumPad2 = 98;
vk_NumPad3 = 99;
vk_NumPad4 = 100;
vk_NumPad5 = 101;
vk_NumPad6 = 102;
vk_NumPad7 = 103;
vk_NumPad8 = 104;
vk_NumPad9 = 105;
vk_Multiply = 106;
vk_Add = 107;
vk_Subtract = 109;
vk_Decimal = 110;
vk_Divide = 111;
/* function keys */
vk_F1 = 112;
vk_F2 = 113;
vk_F3 = 114;
vk_F4 = 115;
vk_F5 = 116;
vk_F6 = 117;
vk_F7 = 118;
vk_F8 = 119;
vk_F9 = 120;
vk_F10 = 121;
vk_F11 = 122;
vk_F12 = 123;
vk_F13 = 124;
vk_F14 = 125;
vk_F15 = 126;
vk_F16 = 127;
vk_NumLock = 144;
vk_ScrollLock = 145;
vk_LShift = 160;
vk_RShift = 161;
vk_LControl = 162;
vk_RControl = 163;
vk_LAlt = 164;
vk_RAlt = 165;
vk_SemiColon = 186;
vk_Equals = 187;
vk_Comma = 188;
vk_UnderScore = 189;
vk_Period = 190;
vk_Slash = 191;
vk_BackSlash = 220;
vk_RightBrace = 221;
vk_LeftBrace = 219;
vk_Apostrophe = 222;
Supported "field" values are:
"
list" - returns the list of static variables
"
memory" - returns memory usage in bytes (not including memory used
for variable name itself)
"
totalmemory" - returns memory usage in bytes (including memory used
for variable name)
Example:
StaticVarSet("my_array1", Close );
StaticVarSet("my_array2", Close );
StaticVarSet("my_scalar", 12 );
StaticVarSetText("my_text", "Text123456" );
"All variables in memory: " +
StaticVarInfo( "*", "list" );
" Total static var memory: " +
StaticVarInfo( "*", "totalmemory");
" Only my_ variables: " +
StaticVarInfo( "my_*", "list" );
" Memory 2 arrays (bytes): " +
StaticVarInfo( "my_array*", "memory" );
" Memory scalar (bytes): " +
StaticVarInfo( "my_scalar", "memory" );
" Memory text (bytes): " +
StaticVarInfo( "my_text", "memory" );
CHANGES FOR VERSION 5.54.0 (as compared to 5.53.1)
// XY chart coding example
// This formula generates 2 X-Y scatter charts
that display relationship between
// final trade profit and MFE and MAE
Buy = Cross( MACD(), Signal());
Sell = Cross( Signal(), MACD()
);
Short = False;
Cover = False;
Eq = Equity( 1 ); //
single-security equity this evaluates stops (if you use them)
and removes extra signals
Entry = Buy OR Short;
EqAtEntry = ValueWhen(
Entry, Eq );
Profit = 100 * ( Eq
- EqAtEntry ) / EqAtEntry; // percent profit
// MAE and MFE below use CLOSING equity, MAE and
MFE in the report use high/low price
MAE = 100 * ( LowestSince(
Entry, Eq ) - EqAtEntry ) / EqAtEntry; // percent
MAE
MFE = 100 * ( HighestSince(
Entry, Eq ) - EqAtEntry ) / EqAtEntry; // percent
MAE
bi = BarIndex();
Len = bi - ValueWhen(
Entry, bi );
EntryPrice = ValueWhen(
Entry, BuyPrice );
// if you prefer MAE/MFE using high/low price
// uncomment the lines below (long only Version)
MAE = 100 * ( LowestSince(
Entry, Low )
- EntryPrice ) / EntryPrice ; // percent MAE using
low
MFE = 100 * ( HighestSince(
Entry, High )
- EntryPrice ) / EntryPrice ; // percent MAE using
high
Exit = Sell OR Cover;
dt = DateTime();
Clr = ColorHSB( Status("stocknum"), 255, 255 );
for( bar = 0;
bar < BarCount;
bar++ )
{
if(
Exit[ bar ] )
{
// item text
consists of two parts
// first part
(before \t) is a item name displayed immediatelly on XY chart
// second
part (after \t) is a tooltip hint text that is displayed in the tooltip
// when you
hover on given item
// here we
will only use hint text
HintText = "\t" + Name()+"@"+ DateTimeToStr(
dt[ bar ] );
XYChartAddPoint( "Profit vs MAE",
HintText, MAE[ bar ], Profit[ bar ],Clr );
XYChartAddPoint( "Profit vs MFE",
HintText, MFE[ bar ], Profit[ bar ], Clr );
XYChartAddPoint( "Profit vs trade length",
HintText, Len[ bar ], Profit[ bar ], Clr );
}
}
XYChartSetAxis( "Profit vs MAE", "[MAE]", "[Profit]" );
XYChartSetAxis( "Profit vs MFE", "[MFE]", "[Profit]" );
XYChartSetAxis( "Profit vs trade length", "[Length]", "[Profit]" );
Filter = Exit;
AddColumn( Eq, "Equity" );
AddColumn( Profit, "Profit" );
AddColumn( MAE, "MAE" );
AddColumn( MFE, "MFE" );
AddColumn( Len, "trade
length" );
CHANGES FOR VERSION 5.53.1 (as compared to 5.53.0)
CHANGES FOR VERSION 5.53.0 (as compared to 5.52.0)
CHANGES FOR VERSION 5.52.0 (as compared to 5.51.2)
SetChartGradientFill( colorLightOrange, colorPaleGreen );
Plot( C, "Close", ColorBlend( colorPaleGreen, colorBlack ),
styleGradient | styleLine, Null, Null, 0,
-1 );
Plot( C, "Close", colorBlack, styleBar, Null, Null, 0, 1,
-20 /*
line width as percent of bar */ );
CHANGES FOR VERSION 5.51.2 (as compared to 5.51.1)
CHANGES FOR VERSION 5.51.1 (as compared to 5.51.0)
CHANGES FOR VERSION 5.51.0 (as compared to 5.50.5)
HOW TO REPORT BUGS
If you experience any problem with this beta version please send detailed description of the problem (especially the steps needed to reproduce it) to support at amibroker.com