- Joined
- 1 November 2009
- Posts
- 424
- Reactions
- 67
Amibroker not working after Windows 10 auto upgrade.
All my Amibroker setup gone missing or reference link missing.
Anyone having this problem?
Would anyone like to have a go at converting this pseudocode into AFL? It was developed by StrategyQuant software which I'm trialing. Some of it is very basic, other parts I have no idea what it means.
--------------------------------------------------------------------
Pseudo Source Code of Strategy 1.41
with parameter names.
Generated by StrategyQuant version 3.8.1
Generated at Tue Oct 04 22:48:00 GMT 2016
Tested on DAX, M5, 13.01.2006 - 25.02.2008
Spread: 0.5, Slippage: 0.0, Min distance of stop from price: 0.0
--------------------------------------------------------------------
====================================================================
== Entry conditions
====================================================================
LongEntryCondition = ((Day of week <> Wednesday) And ((Minute < 11) And (ATR(66) < ATR(69))))
ShortEntryCondition = ((Day of week <> Wednesday) And ((Minute < 11) And (ATR(66) > ATR(69))))
====================================================================
== Entry orders
====================================================================
-- Long entry
if LongEntryCondition is true {
if No position is open then Buy at Open(15) + (0.6 * BarRange(99)) Stop;
Stop/Limit order expires after 23 bars.
Profit Target = (0.93 * ATR(97)) pips;
}
-- Short entry
if ShortEntryCondition is true {
if No position is open then Sell at Open(15) + (-0.6 * BarRange(99)) Stop;
Stop/Limit order expires after 23 bars.
Profit Target = (0.93 * ATR(97)) pips;
}
It's almost easy language is it?
Looks like a nice snug curve for too...
#include <stdio.h>
int main(){
long n;
int count = 0;
int m[10],i;
for( i = 2; i < 10 ; i++ )
{
n /= 10;
++count;
m[i]=i+1;
printf("m[%d]= %d\n",i+1,m[i]);
}
printf("Counting number of digits: %d", count);
}
SetBarsRequired(-2,-2);
Plot( C, ""+Interval(2), styleCandle );
for( i = 1; i <4 ; i++ )
{
TimeFrameSet(i*in1Minute );
rs = RSI(14);
TimeFrameRestore();
VarSet( "M"+ i, TimeFrameExpand( rs, i*in1Minute , expandPoint ) );
M = VarGet( "M" + i );
for( b = 0; b < BarCount; b++ )
{
if(M[b] ) PlotText(" "+(i), b, L[b]-1-(i), colorAqua);
}
}
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );SetBarsRequired(-2,-2);
/*
shape2 = 0;
shape3 = 0;
for( b = 0; b < BarCount; b++) {[COLOR="#0000CD"]// visible chart area loop // y[I]ou can also use bi = Barindex();
// fvb = FirstVisiblevalue( bi );
// lvb = LastVisiblevalue( bi );[/I][/COLOR]
getvar = ....;
switch( getvar ) {
case 2: ....
case 3: ....
default: break;
}
}
PlotShapes( shape2 * shapeSmallCircle, colorWhite, 0, L, n*-35 );
PlotShapes( shape3 * shapeSmallCircle, colorYellow, 0, L, n*-35 );
Also... Is there a way to use the Sectors as RS indicators?
That would be perfect but thus far the best I can do is use Industry or IndGrp as RS indicators because they have tickers I can easily type in the parameters section
Do sectors have tickers?
Cheers
_SECTION_BEGIN("Sector strength");
// Look for relative strength of sectors wrt their S&P
// Plot the 13 week EMA of incremental differences
// This is useful for finding strengthening sectors / industries
// Normalize data
// Based on: http://www.amibroker.com/library/detail.php?id=184
Sum_Filter = 9;
Index_Value = Foreign("XAO","close");
Energy_Ratio = Foreign("XEJ","Close",fixup=1) / Index_Value;
Materials_Ratio = Foreign("XMJ","Close",fixup=1) / Index_Value;
Consumer_Discret_Ratio = Foreign("XDJ","Close",fixup=1) / Index_Value;
Health_Ratio = Foreign("XHJ","Close",fixup=1) / Index_Value;
Tech_Ratio = Foreign("XIJ","Close",fixup=1) / Index_Value;
Finance_Ratio = Foreign("XFJ","Close",fixup=1) / Index_Value;
Energy_Perf = EMA(Energy_Ratio - Ref(Energy_Ratio,-1),13) * 10000;
Materials_Perf = EMA(Materials_Ratio - Ref(Materials_Ratio,-1),13) * 10000;
Consumer_Discret_Perf = EMA(Consumer_Discret_Ratio - Ref(Consumer_Discret_Ratio,-1),13) * 10000;
Health_Perf = EMA(Health_Ratio - Ref(Health_Ratio,-1),13) * 10000;
Tech_Perf = EMA(Tech_Ratio - Ref(Tech_Ratio,-1),13) * 10000;
Finance_Perf = EMA(Finance_Ratio - Ref(Finance_Ratio,-1),13) * 10000;
N_Energy_Perf = (Energy_Perf) / Foreign("XEJ","Close",fixup=1);
N_Materials_Perf = (Materials_Perf) / Foreign("XMJ","Close",fixup=1);
N_Consumer_Discret_Perf = (Consumer_Discret_Perf) / Foreign("XDJ","Close",fixup=1);
N_Health_Perf = (Health_Perf) / Foreign("XHJ","Close",fixup=1);
N_Tech_Perf = (Tech_Perf) / Foreign("XIJ","Close",fixup=1);
N_Finance_Perf = (Finance_Perf) / Foreign("XFJ","Close",fixup=1);
Energy_Sum = Sum(N_Energy_Perf,Sum_Filter);
Materials_Sum = Sum(N_Materials_Perf,Sum_Filter);
Consumer_Discret_Sum = Sum(N_Consumer_Discret_Perf,Sum_Filter);
Health_Sum = Sum(N_Health_Perf,Sum_Filter);
Tech_Sum = Sum(N_Tech_Perf,Sum_Filter);
Finance_Sum = Sum(N_Finance_Perf,Sum_Filter);
Plot (Energy_Sum,"Energy",colorGrey50,styleLine);
Plot (Materials_Sum,"Materials",colorGreen,styleLine);
Plot (Consumer_Discret_Sum,"Consumer_Discret",colorlightBlue,styleLine);
Plot (Health_Sum,"Finance",colorYellow,styleLine);
Plot (Finance_Sum,"Finance",colorred,styleLine);
Plot (Tech_Sum,"Tech",colorWhite,styleLine);
//MaxGraph = 4;
//Graph0 = Energy_Sum;
//Graph0Color = colorAqua; //Aqua - Energy
//Graph1 = Tech_Sum;
//Graph1Color = 2; //White - Tech
//Graph2 = Finance_Sum;
//Graph2Color = 4; //Red - Finance
//Graph3 = Materials_Sum;
//Graph3Color = 5; //Green - Mater.
/*
Backtest performance by selectig top sector to buy
Buy when rel performance above 0 and slope maximum
Sell when slope decreass relative to another sector
Always be in the market
*/
//Filter = Close > 0;
//NumColumns = 4;
//Column0Name = "Energy";
//Column0 = Energy_Sum;
//Column1Name = "Tech";
//Column1 = Tech_Sum;
//Column2Name = "Finance";
//Column2 = Finance_Sum;
//Column3Name = "Materials";
//Column3 = MAterials_Sum;
_SECTION_END();
bull= C>O;
Filter=bull;
dt = DateTime();
AddColumn( dt, "Date", formatDateTime );
AddColumn( bull, "Signal", formatChar );
Plot( C, "Close", ParamColor( "Color", colorDefault ), styleNoTitle | ParamStyle( "Style" ) | GetPriceStyle() );
expandmode = expandfirst;
TF = in15Minute;
TimeFrameSet( TF );
dt = DateTime();
bull = C>O;
TimeFrameRestore();
fifteen = TimeFrameExpand( dt, TF, expandmode );
fifteenn = TimeFrameExpand( bull, TF, expandmode );
printf( "`15 Minute candle timeframe: " + DateTimeToStr( SelectedValue( fifteen ) ));
Filter = bull;
AddColumn( dt, "Date", formatDateTime );
Just a thought:
Bull candle time WRONG OUTPUT (use exploration and see it)
We try to compare 1 min . and 15 min. candle close
Of course we're not going to change setting, it's default 1 minute.
Now if we do exploration, it gives wrong output for 15 min.
We only looking for bull candle close time.
For 1 min. working fine as default settings is 1 min.
Use Code below
Code:
Code:bull= C>O; Filter=bull; dt = DateTime(); AddColumn( dt, "Date", formatDateTime ); AddColumn( bull, "Signal", formatChar );
FOR 15 MINUTE , IT GIVES WRONG OUTPUT, USE BELOW CODE AND SEE BY YOURSELF
exploration should show candle time of 15min. bull candle
Code:Plot( C, "Close", ParamColor( "Color", colorDefault ), styleNoTitle | ParamStyle( "Style" ) | GetPriceStyle() ); expandmode = expandfirst; TF = in15Minute; TimeFrameSet( TF ); dt = DateTime(); bull = C>O; TimeFrameRestore(); fifteen = TimeFrameExpand( dt, TF, expandmode ); fifteenn = TimeFrameExpand( bull, TF, expandmode ); printf( "`15 Minute candle timeframe: " + DateTimeToStr( SelectedValue( fifteen ) )); Filter = bull; AddColumn( dt, "Date", formatDateTime );
All are Welcome
Hey
How can I extend the y Grid axis in the background to extend for future dates? You know, the y lines that match up the dates on charts.
If i can the y lines extended it would make my life a whole lot easier to predict future prices with the x axis..
Hope that makes sense
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?