Recent Posts

Pages: [1] 2 3 ... 10
1
Trading System Discussion / Re: 90% accurate system
« Last post by praveen5344 on January 16, 2017, 11:17:27 pm »
it has got lot of ref code which indicates that results repaint with future price..........has anyone tested it in realtime data
2
Amibroker Help / Re: LSMA (Least Square Moving Average)
« Last post by mhjamibrokerforum on December 31, 2016, 10:00:04 am »
thanks for your nice help!
I found it myself, they're same.
3
Amibroker Help / Re: LSMA (Least Square Moving Average)
« Last post by mhjamibrokerforum on December 26, 2016, 03:53:32 pm »
and again by the way...
is this related to the regression line? (same?)
4
Amibroker Help / Re: LSMA (Least Square Moving Average)
« Last post by mhjamibrokerforum on December 26, 2016, 03:28:52 pm »
and by the way...
I will appreciate if anybody share experience of using this tool (especially in contrast with other MAs)
5
Amibroker Help / LSMA (Least Square Moving Average)
« Last post by mhjamibrokerforum on December 26, 2016, 02:41:59 pm »
Hi,
I have not seen any formula about LSMA (Least Square Moving Average) on the internet.
I found 2 math equation and convert them to afl but they didn't work.

does anybody have it? or could anyone help me writing it?
thanks
6
Trading System Discussion / Moving average AFL
« Last post by dudu2683 on December 15, 2016, 10:57:07 am »
Hi all,

I'm looking for a Moving average AFL that can alert me if the prices above moving average 8 and also if moving average 8 cross moving average 13 from bellow.

I'll appreciate your help finding this kind of AFL,

7
Amibroker Help / please help to change code for MT4
« Last post by cdg on December 13, 2016, 01:30:13 am »
please help to change the below code for using in MT4? thanks a lot!

Code: [Select]
_SECTION_BEGIN("Fibosher");
SetBarsRequired(200, 0);

// Ehlers formulas modified by Danny Suwardhani 2008
// from Ehlers, John F. Cybernetic Analysis for Stocks and Futures. Wiley. 2004.
// Chapter 1, p. 1. Code on p. 7.

function InverseFisher(array)
{
e2y = exp(2 * array);
return (e2y - 1)/(e2y + 1);
}

function Normalize(array, arraylen)
// Figure 1.7 on p. 7
{
MaxH = HHV(array, arraylen);
MinL = LLV(array, arraylen);
Value1[0] = array[0]; // Initialize as array

for(i = 1; i < BarCount; i++)
{
Value1[i]=.5*2*((array[i]-MinL[i])/IIf(MaxH[i]-MinL[i]==0,1,MaxH[i]-MinL[i])-.5)+.5*Value1[i-1];

if (Value1[i] > .9999) Value1[i] = .9999;
if (Value1[i] < -.9999) Value1[i] = -.9999;
}
return Value1;
}

function Fisher(array)
// Figure 1.7 on p. 7
{
F = array;
F = .25 * log((1+ array)/(1 - array)) + .5 * Ref(F, -1);
return F;
}

Med = (H+L)/2;
MidPoint=0;
// Fisher Transform
FisherXform = Fisher(Normalize(Med, 10));

FisherColor = colorYellow;
FisherColor = IIf(LinRegSlope(FisherXform,2) == 0,colorBlue,FisherColor );
FisherColor = IIf(LinRegSlope(FisherXform,2) < 0,colorRed,FisherColor );
Sell1 = LinRegSlope(FisherXform,2) <= 0 AND Ref(LinRegSlope(FisherXform,2),-1) > 0;
Buy1  = LinRegSlope(FisherXform,2) >= 0 AND Ref(LinRegSlope(FisherXform,2),-1) < 0;

Plot(FisherXform, "Fibosher", FisherColor , styleLine|styleThick);

barvisible = Status("barvisible");
maxr = LastValue( Highest( IIf( barvisible, FisherXform, 0 ) ) );
minr = LastValue( Lowest( IIf( barvisible, FisherXform, 100 ) ) );
ranr = maxr - minr;

Plot( maxr , "0%", colorGrey50 );
Plot( maxr - 0.236 * ranr, "-23.6%", colorPaleGreen );
Plot( maxr - 0.382 * ranr, "-38.2%", colorPaleBlue );
Plot( maxr - 0.50 * ranr, "-50.0%", colorOrange );
Plot( maxr - 0.618 * ranr, "-61.8%", colorPaleBlue );
Plot( maxr - 0.786 * ranr, "-78.6%", colorPaleGreen );
Plot( minr , "-100%", colorGrey50 );

GraphXSpace = 3;

_SECTION_END();
8
Amibroker Help / Highest High Close Code & Optimizisation PROBLEM
« Last post by 4benz on November 27, 2016, 12:27:27 am »
Hello there,

I am new fairly new to amibroker.

Have been backtesting a basic strategy = Buy a stock on HHV of last 250 trading days. Also index (XAO Aussie Market) needs to meet my filter requirements.
Can backtest this fine for periods 2000-2005 and comes back with result ok.

Here is the code.


SetOption("Maxopenpositions",20);
SetPositionSize(5,spsPercentOfEquity);

Index = Foreign("XAO","C",True);
Indexfilter = MA(Index,100);

Highestvalue = HHV(C,250);
Stoploss = MA(C,50);

Buy = C>= Highestvalue AND Index >= Indexfilter;
Sell = C<= Stoploss;

Buy= ExRem(Buy,Sell);
Sell= ExRem(Sell,Buy);

However I want to optimize the HHV for different days. From looking at some tutorials I came up with this code.


SetOption("Maxopenpositions",20);
SetPositionSize(5,spsPercentOfEquity);

Highestvalue = Optimize("hhv", 250, 50, 300, 5);

Index = Foreign("XAO","C",True);
Indexfilter = MA(Index,100);

Highestvalue = HHV(C,250);

Stoploss = MA(C,50);

Buy = C >= Highestvalue AND Index >= Indexfilter;
Sell = C <= Stoploss;

Buy= ExRem(Buy,Sell);
Sell= ExRem(Sell,Buy);

Now when I run this code through the Optimize feature I just get 51 results for the exact same strategy.....It seems like they are not actually changing the HHV value or something.....

Does anyone know why this might be? I can't seem to find this problem on the net so some help would be greatly appreciated.

Thank you.
4benz
9
Trading System Discussion / Bollinger bands and candles
« Last post by vekian on November 24, 2016, 08:57:04 pm »
I was wondering if anyone can convert this code to AFL.
It is called Bollinger Band Breakout Candles. I have attached a picture of how the indicator looks.
It is written in something called 'pinescript'.

Thanks,  vekian.

 
study(title="[RS]Bollinger Bands Breakout Candles V0", shorttitle="[RS]BBBc.V0", overlay=true)
length = input(8)
src = input(hl2)
deviations = input(2)
ma = sma(src, length)
oma = ma > ma[1] ? valuewhen(ma < ma[1], ma[1], 0) : ma < ma[1] ? valuewhen(ma > ma[1], ma[1], 0) : nz(oma[1])
upper = oma + stdev(src, length) * deviations
lower = oma - stdev(src, length) * deviations

plotcandle(oma, upper, lower, ma, color=ma>=upper?#9ce0b2:ma<=lower?#e0b29c:ma>=ma[1]?green:maroon)
10
Trading System Discussion / Convert code to AFL
« Last post by vekian on November 24, 2016, 08:50:06 pm »
I have a formula code that I would like converted to AFL if anyone wants to give it a try. Apparently it is written in 'pinescript'. I have a attached a picture example of how the indicator looks.
The indicator is called Transient Zones.

//By Jurij w/ TZ percent occurrence by SPYderCrusher
study("Transient Zones v1.1", "TZ", overlay=true)

//inputs
h_left = input(title="H left", type=integer, defval=10)
h_right = input(title="H right", type=integer, defval=10)
sample_period = input(title="Sample bars for % TZ", type=integer, defval=5000)
show_ptz = input(title="Show PTZ", type=bool, defval=true)
show_channel = input(title="Show channel", type=bool, defval=true)

//barCount = nz(barCount[1]) + 1
//check history and realtime PTZ
h_left_low = lowest(h_left)
h_left_high = highest(h_left)
newlow = low <= h_left_low
newhigh = high >= h_left_high
plotshape(newlow and show_ptz, style=shape.triangledown, location=location.belowbar, color=red)
plotshape(newhigh and show_ptz, style=shape.triangleup, location=location.abovebar, color=green)
channel_high = plot(show_channel ? h_left_low : 0, color=silver)
channel_low = plot (show_channel ? h_left_high : 0, color=silver)

//check true TZ back in history
central_bar_low = low[h_right + 1]
central_bar_high = high[h_right + 1]
full_zone_low = lowest(h_left + h_right + 1)
full_zone_high = highest(h_left + h_right + 1)
central_bar_is_highest = central_bar_high >= full_zone_high
central_bar_is_lowest = central_bar_low <= full_zone_low
plotarrow(central_bar_is_highest ? -1 : 0, offset=-h_right-1)
plotarrow(central_bar_is_lowest ? 1 : 0, offset=-h_right-1)

//TZ probability calc
x = central_bar_is_highest ? 1 : 0
high_bar_tz_count = cum(x)

y = central_bar_is_lowest ? 1 : 0
low_bar_tz_count = cum(y)

total_tz = high_bar_tz_count + low_bar_tz_count
percent_tz_high = (high_bar_tz_count / sample_period) * 100
//plot(percent_tz_high, color = lime, transp=100)
percent_tz_low = (low_bar_tz_count / sample_period) * 100
//plot(low_bar_tz_count, color=red, transp=100)
percent_total_tz = (percent_tz_high + percent_tz_low)
plot(percent_total_tz, color=black, transp=100)

//PTZ probability calc
i = newhigh ? 1 : 0
high_bar_ptz_count = cum(i)

j = newlow ? 1 : 0
low_bar_ptz_count = cum(j)

total_ptz = high_bar_ptz_count + low_bar_ptz_count
percent_ptz_high = (high_bar_ptz_count / sample_period) * 100
//plot(percent_ptz_high, color=green, transp=100)
percent_ptz_low = (low_bar_ptz_count / sample_period) * 100
//plot(percent_ptz_low, color=maroon, transp=100)
percent_total_ptz = (percent_ptz_high + percent_ptz_low)
plot(percent_total_ptz, color=navy,  transp=100)

//PTZ resolving probability calc
percent_ptz_resolved = (1 - (total_tz / total_ptz)) * 100
plot(percent_ptz_resolved, color=gray,  transp=100)


Thanks,

vekian
Pages: [1] 2 3 ... 10