Stock Portfolio Organizer

The ultimate porfolio management solution.

Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
For Portfolio Manager Click Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Find Out More Here

Multiple system for Amibroker (AFL)

Rating:
4 / 5 (Votes 2)
Tags:
amibroker

Testing multiple system simultaneously.

Similar Indicators / Formulas

Kavach Of Karna v2
Submitted by hbkwarez over 10 years ago
Advanced Elliott Waves
Submitted by MarcosEn about 13 years ago
3_6Day GuaiLiLv
Submitted by motorfly about 13 years ago
Williams Alligator System
Submitted by durgesh1712 about 13 years ago
Interactive Linear Regression Channel
Submitted by InternetWorm about 13 years ago
*Level Breakout system*
Submitted by Tinych about 13 years ago

Indicator / Formula

Copy & Paste Friendly
function multiplex(Buy1, Sell1, BuyPrice1, SellPrice1,size1,PositionScore1, 
	Buy2, Sell2, BuyPrice2, SellPrice2, size2, PositionScore2)
{
	global Buy, Sell, PositionScore, size;
	Buy = Sell = False;
	PositionScore = 0;
	size = 0;
	BuyPrice =SellPrice = Null;
	sys = 0;
	for(i = 0; i < BarCount; i++)
	{
		switch(sys)
		{
			case 0:
			if(Buy1[i] && Buy2[i])
			{
				if(PositionScore1[i] >= PositionScore2[i])
				{
					sys = 1;
					size[i] = size1[i];
					BuyPrice[i] = BuyPrice1[i];
					PositionScore[i] = PositionScore1[i];
					Buy[i] = buy1[i];
				}
				else
				{
					sys = 2;
					size[i] = size2[i];
					BuyPrice[i] = BuyPrice2[i];
					PositionScore[i] = PositionScore2[i];
					Buy[i] = Buy2[i];
				}
			}
			else if (Buy1[i])
			{
				sys = 1;
				size[i] = size1[i];
				BuyPrice[i] = BuyPrice1[i];
				PositionScore[i] = PositionScore1[i];
				Buy[i] = Buy1[i];
			}
			else if (Buy2[i])
			{
				sys = 2; //both used at the same time;
				size[i] = size2[i];
				BuyPrice[i] = BuyPrice2[i];
				PositionScore[i] = PositionScore1[i];
				Buy[i] = Buy2[i];
			}
			break;
			case 1: //system 1 in use
			if(Sell1[i])
			{
				sys = 0;
				Sell[i] = Sell1[i];
				SellPrice[i] = SellPrice1[i];
			}
			break;
			case 2:
			if(Sell2[i])
			{
				sys = 0;
				Sell[i] = Sell2[i];
				SellPrice[i] = SellPrice2[i];
			}
		}
	}
	return;
}
				

Buy1 = C > MA(C, 30);
Sell1 = C < MA(C, 50);
size1 = 10;
PositionScore1 = 1/C;
BuyPrice1 = SellPrice1 = C; 
r = RSI();
Buy2 = 8* (Ref(R < 30, -1));
Sell2 = 8* ( Ref(R > 70, -1)); 
size2 = 5;
BuyPrice2 = SellPrice2 = O;
PositionScore2 = 1/O;
multiplex(Buy1, Sell1, BuyPrice1, SellPrice1,size1,PositionScore1, 
	Buy2, Sell2, BuyPrice2, SellPrice2, size2, PositionScore2);

Short = Cover = False;
SetPositionSize(size, spsPercentOfEquity);
SetOption("MaxOpenPositions", 10 );  // 10 and 100 as max pos makes 7 point difference in winloss   
SetOption("InitialEquity", IE=100000);  
SetOption("AllowPositionShrinking", 0);   
SetOption("CommissionMode", 1);   
SetOption("CommissionAmount", 0);
SetOption("AllowSameBarExit", False);
SetOption("PriceBoundChecking", True);
SetOption("ActivateStopsImmediately", False);
Filter = Buy OR Sell;
AddColumn(Buy, "Buy", 7.0);
AddColumn(Sell, "sell", 7.0);

4 comments

1. godbeest

EROR CODE !!!!!!!!!!!!!

2. godbeest

Try this

3. Baetz

Hello, please explain how it works.

4. worldastro

Nothing view on chart !!!!!

Leave Comment

Please login here to leave a comment.

Back