Normal
Hi Guys,I really just did this as an exercise to learn Amibroker, I'm not using a system along these lines.Stevo:1. I've added this2. Buy on next open, sell on next open3. Good point, as most brokers charge a fixed amount then a percentage I've just picked a value, anyone seriously using this might want to put some sort of conditions in.4/5/6 Your probably right again, maybe an exercise for the future.7. 10% by default, these results try a few values.8. Right again, anyone going to pick a system on this would want to check it with their own data.So to stress again, this is just a learning experience for me, and some others may find the results interesting.Here is the lastest code and results:HighBreakOut = Optimize("HighBreakOut", 20, 10, 40, 10);ShortEMA = Optimize("ShortEMA", 30, 10, 70, 20);HighestHigh = Optimize("HighestHigh", 30, 10, 100, 20);LongEMA = Optimize("LongEMA", 65, 60, 200, 20);Stop = Optimize("Stop", 10, 5, 20, 5);DollarLimit = Optimize("DollarLimit", 10, 5, 20, 5);Liquidity = Optimize("Liquidity", 500000, 500000, 500000, 200000);SetOption("CommissionMode", 1); //% per tradeSetOption("CommissionAmount", 0.15);SetOption("MaxOpenPositions", 10 );SetOption("InitialEquity", 100000 );SetTradeDelays( 1, 1, 1, 1 ); /* delay entry/exit by one bar */PositionSize = -10; // always invest only 10% of the current EquityBangForBuck = ((10000/C)* (MA(ATR(1),200))/100);PositionScore = BangForBuck;cond1=Cross(H,Ref(HHV(H,HighBreakOut),-1)); // when todays high crosses last highest high over the last 10 periodscond2=H > EMA(C,ShortEMA); // todays high is greater than the 40 day Exp MA of closescond3=HHVBars(H,HighestHigh) == 0; // todays high is the highest for 70 periodscond4=EMA(V*C,21) > Liquidity; // ensure at least $500k of money flowcond5=C < DollarLimit; // only trading in stocks less than $10cond6=C > O; // todays close higher than open// the following line is the trigger if all conditions satisfiedBuy=cond1 AND cond2 AND cond3 AND cond4 AND cond5 AND cond6;// here we define variables used once in the tradeApplyStop( stopTypeLoss, stopModePercent, amount=Stop );Sell= Cross(Ref(EMA(L,LongEMA),-1),C); // close crosses below yesterdays average of the lowttrader3.zip
Hi Guys,
I really just did this as an exercise to learn Amibroker, I'm not using a system along these lines.
Stevo:
1. I've added this
2. Buy on next open, sell on next open
3. Good point, as most brokers charge a fixed amount then a percentage I've just picked a value, anyone seriously using this might want to put some sort of conditions in.
4/5/6 Your probably right again, maybe an exercise for the future.
7. 10% by default, these results try a few values.
8. Right again, anyone going to pick a system on this would want to check it with their own data.
So to stress again, this is just a learning experience for me, and some others may find the results interesting.
Here is the lastest code and results:
HighBreakOut = Optimize("HighBreakOut", 20, 10, 40, 10);
ShortEMA = Optimize("ShortEMA", 30, 10, 70, 20);
HighestHigh = Optimize("HighestHigh", 30, 10, 100, 20);
LongEMA = Optimize("LongEMA", 65, 60, 200, 20);
Stop = Optimize("Stop", 10, 5, 20, 5);
DollarLimit = Optimize("DollarLimit", 10, 5, 20, 5);
Liquidity = Optimize("Liquidity", 500000, 500000, 500000, 200000);
SetOption("CommissionMode", 1); //% per trade
SetOption("CommissionAmount", 0.15);
SetOption("MaxOpenPositions", 10 );
SetOption("InitialEquity", 100000 );
SetTradeDelays( 1, 1, 1, 1 ); /* delay entry/exit by one bar */
PositionSize = -10; // always invest only 10% of the current Equity
BangForBuck = ((10000/C)* (MA(ATR(1),200))/100);
PositionScore = BangForBuck;
cond1=Cross(H,Ref(HHV(H,HighBreakOut),-1)); // when todays high crosses last highest high over the last 10 periods
cond2=H > EMA(C,ShortEMA); // todays high is greater than the 40 day Exp MA of closes
cond3=HHVBars(H,HighestHigh) == 0; // todays high is the highest for 70 periods
cond4=EMA(V*C,21) > Liquidity; // ensure at least $500k of money flow
cond5=C < DollarLimit; // only trading in stocks less than $10
cond6=C > O; // todays close higher than open
// the following line is the trigger if all conditions satisfied
Buy=cond1 AND cond2 AND cond3 AND cond4 AND cond5 AND cond6;
// here we define variables used once in the trade
ApplyStop( stopTypeLoss, stopModePercent, amount=Stop );
Sell= Cross(Ref(EMA(L,LongEMA),-1),C); // close crosses below yesterdays average of the low
ttrader3.zip
Hello and welcome to Aussie Stock Forums!
To gain full access you must register. Registration is free and takes only a few seconds to complete.
Already a member? Log in here.