treatment "@2.ztt"{
	background{
		table algotrader{
			lifetime = PERIOD;
			execute = WITHEACH;
		}
		table prices{
			lifetime = PERIOD;
			execute = WITHEACH;
		}
		table prices2{
			lifetime = PERIOD;
			execute = WITHEACH;
		}
		table prices3{
			lifetime = PERIOD;
			execute = WITHEACH;
		}
		table globals{
		}
		table subjects{
		}
		table summary{
		}
		table contracts{
		}
		table session{
			uses = "Task";
		}
		table logfile{
		}
		numsubjects = 12;
		numgroups = 2;
		numpracticeperiods = 0;
		numactualperiods = 30;
		exchangerate = 0.005;
		startendowment = 0;
		showupfee = 0;
		noAutoscope = FALSE;
		firstBoxesOnTop = FALSE;
		showupfeeawaytext = "Sie haben Verlust gemacht. Wollen Sie das Startgeld einsetzen, um diesen Verlust zu decken?";
		showupfeeawayyestext = "Ja";
		showupfeeawaynotext = "Nein";
		moneyawaytext = "Sie haben Verlust gemacht. Wollen Sie weiterfahren?";
		moneyawayyestext = "Ja";
		moneyawaynotext = "Nein";
		bancruptwaittext = "Bitte warten Sie bis Ihr Computer wieder freigegeben wird.";
		program{
			table = globals;
			do{
				AT = 1; // if == 1, one subject is replaced by an algorithmic Trader during the Trading.
				FV = 360; // the fundamental value of an asset in every round
				TimeRound = 60;
				SecondsLeft = TimeRound;
				InitialNumberOfStocks = 4;
				InitialMoney = 720; //twice the fundamental value of one asset
				time = 0;
				start=0;
				expectedDividends = 15;
				payedDividends = 0;
				numTrades = 0;
				numTrades2 = 0;
				numTrades3 = 0;
				TimeAuction = TimeRound*expectedDividends;
				r = 0; //random number
				r2=0;
				it=0;
				previousDividend = 0;
				
				
				
				//VARIABLES NEEDED FOR CONTRACT-MATCHING
				B=0; //Player offering best Buy
				S=0; //Player offering best Sell
				QuantitiyToBeTraded = 0;
				groupConsidered = 0;
				bestBuyPriceGroup = 0;
				bestSellPriceGroup = 10000;
				sold = 0; //Boolean: The contract from Seller has been deactivated
				bought = 0;
			}
		}
		program{
			table = algotrader;
			do{
				Group=0;
				ID=0;
				money=0;
				stocks=0;
			}
		}
		program{
			table = prices;
			do{
				Seller=0;
				Buyer=0;
				price=0;
				end=0;
				id=-1;
				Group = 0;
			}
		}
		program{
			table = prices2;
			do{
				Seller=0;
				Buyer=0;
				price=0;
				end=0;
				id=-1;
				Group = 0;
			}
		}
		program{
			table = prices3;
			do{
				Seller=0;
				Buyer=0;
				price=0;
				end=0;
				id=-1;
				Group = 0;
			}
		}
		program{
			table = subjects;
			do{
				//NEEDED FOR FINAL PAYMENT
				profitFirstTrading=0;
				profitFirstTreatment=-1;
				taskPayed = -1;
				
				Control1 = -1;
				Control2 = -1;
				Control3 = -1;
				Control4 = -1;
				Control5 = -1;
				
				money = \InitialMoney;
				stocks = 4;
				
				// the following variables are needed to administer selling and buying actions by the subjects
				bestBuyPrice = 0;
				bestSellPrice = 10000;
				
				offeredQuantity = 0;
				wantedQuantity = 0;
				offeredPrice = 10000;
				wantedPrice = 0;
				
				previousStocks = 0;
				lastTradeVolume = 0;
				lastTradePrice = 0;
				wasISeller = -1;
				latestPrice = 0;
				
				// for local computation
				dummy = 0;
				
				
				
			}
		}
		program{
			table = contracts;
			do{
				Seller = -1;
				Buyer = -1; 
				Group = -1;
				p = 0;
				traded =0;
				volume = 0;
				active=0;
				fromTradingPeriod =0;
				start = -1; // time at which the offer was made public
				end = -1; // time at which the offer was accepted
				sell=0; //not important, only needed for the graph
				actualVolume=0; //actual volume that was traded
			}
		}
		screen action{
			usesbg = TRUE;
			withalertscreen = FALSE;
			noalertscreen = FALSE;
		}
		screen wait{
			usesbg = TRUE;
			withalertscreen = FALSE;
			noalertscreen = FALSE;
			standardbox "Text"{
				hasframe = TRUE;
				buttonposition = BOTTOMRIGHT;
				buttonsequence = HORIZONTAL;
				item{
					label = "Bitte warten Sie, bis das Experiment weitergeht.";
				}
			}
		}
	}
	stage "ControlQuestionIntro"{
		startwaitforall = TRUE;
		singleentry = FALSE;
		singleentrycontinuation = FALSE;
		timeouttype = never;
		timeout = 30;
		program{
			table = subjects;
			do{
				Participate=if(Period==1,1,0);
			}
		}
		screen action{
			usesbg = TRUE;
			withalertscreen = FALSE;
			noalertscreen = FALSE;
			standardbox "Standard"{
				hasframe = FALSE;
				left = 10%;
				right = 10%;
				top = 20%;
				bottom = 40%;
				buttonposition = BOTTOMRIGHT;
				buttonsequence = HORIZONTAL;
				item{
					label = "{\\rtf\\fs24\\ql Sie knnen die Kopfhrer jetzt absetzen.\r\n\\par\r\nNun folgen 5 Verstndnisfragen zum Video.\r\n}";
				}
			}
			standardbox "Buttonbox"{
				hasframe = FALSE;
				top = 90%;
				bottom = 0%;
				cutbottom = TRUE;
				buttonposition = BOTTOMRIGHT;
				buttonsequence = HORIZONTAL;
				button "Weiter"{
					clearinputafterok = FALSE;
					norecordmadeorselected = FALSE;
					terminatestage = TRUE;
					donotterminatestage = FALSE;
					specialbuttoncolor = TRUE;
					buttoncolor = 5921535;
				}
			}
		}
		screen wait{
			usesbg = TRUE;
			withalertscreen = FALSE;
			noalertscreen = FALSE;
		}
	}
	stage "ControlQuestion1"{
		startwaitforall = TRUE;
		singleentry = FALSE;
		singleentrycontinuation = FALSE;
		timeouttype = never;
		timeout = 30;
		program{
			table = subjects;
			do{
				Participate=if(Period==1,1,0);
			}
		}
		screen action{
			usesbg = TRUE;
			withalertscreen = FALSE;
			noalertscreen = FALSE;
			headerbox "Header"{
				hasframe = TRUE;
				height = 10%;
				top = 0p;
				cuttop = TRUE;
				showPeriods = TRUE;
				showNumPeriods = TRUE;
				periodtext = "Periode";
				periodoftext = "von";
				practiceperiodprefix = "Probe ";
				showtime = TRUE;
				timestr = "Verbleibende Zeit [sec]:";
				pleasedecidetext = "Bitte entscheiden Sie sich jetzt!";
			}
			standardbox "Standard"{
				hasframe = FALSE;
				left = 10%;
				right = 10%;
				top = 20%;
				bottom = 40%;
				buttonposition = BOTTOMRIGHT;
				buttonsequence = HORIZONTAL;
				item{
					label = "{\\rtf\\fs24\\ql Stellen Sie sich vor: \r\n\\par\r\nSie befinden sich kurz vor dem Ende der 4. Runde des Marktexperimentes. In Runde 1 wurde pro Aktie eine Dividende von 0 ECU gezahlt, in Runde 2 eine von 60 ECU und in Runde 3 eine von 8 ECU. Welche Dividende wird der Computer wahrscheinlich fr Runde 4 auswhlen?\r\n\\par\\par\r\n(Mgliche Dividenden sind 0, 8. 28 und 60 ECU)\r\n}";
					variable = Control1;
					format = "!radio: 1=\"0 ECU\";2=\"8 ECU\";3=\"28 ECU\";4=\"60 ECU\";5=\"Alle Dividenden sind gleich wahrscheinlich\";";
					input = TRUE;
					showdefault = TRUE;
					emptyallowed = FALSE;
					min = 0;
					max = 100;
				}
			}
			standardbox "Buttonbox"{
				hasframe = FALSE;
				top = 90%;
				bottom = 0%;
				cutbottom = TRUE;
				buttonposition = BOTTOMRIGHT;
				buttonsequence = HORIZONTAL;
				button "Weiter"{
					clearinputafterok = FALSE;
					norecordmadeorselected = FALSE;
					terminatestage = TRUE;
					donotterminatestage = FALSE;
					specialbuttoncolor = TRUE;
					buttoncolor = 5921535;
				}
			}
		}
		screen wait{
			usesbg = TRUE;
			withalertscreen = FALSE;
			noalertscreen = FALSE;
		}
	}
	stage "ControlQuestion1Check"{
		startwaitforall = TRUE;
		singleentry = FALSE;
		singleentrycontinuation = FALSE;
		timeouttype = never;
		timeout = 30;
		program{
			table = subjects;
			do{
				Participate=if(Period==1,1,0);
			}
		}
		screen action{
			usesbg = TRUE;
			withalertscreen = FALSE;
			noalertscreen = FALSE;
			headerbox "Header"{
				hasframe = TRUE;
				height = 10%;
				top = 0p;
				cuttop = TRUE;
				showPeriods = TRUE;
				showNumPeriods = TRUE;
				periodtext = "Periode";
				periodoftext = "von";
				practiceperiodprefix = "Probe ";
				showtime = TRUE;
				timestr = "Verbleibende Zeit [sec]:";
				pleasedecidetext = "Bitte entscheiden Sie sich jetzt!";
			}
			standardbox "Standard"{
				hasframe = FALSE;
				left = 10%;
				right = 10%;
				top = 20%;
				bottom = 40%;
				displaycondition = Control1!=5;
				buttonposition = BOTTOMRIGHT;
				buttonsequence = HORIZONTAL;
				item{
					label = "{\\rtf\\fs24\\ql Ihre Antwort ist leider falsch! \r\n\\par\r\nJede Runde gibt es 4 mgliche Dividenden pro Aktie (0, 8, 28 und 60 ECU). Jede dieser Dividenden ist in jeder Runde gleich wahrscheinlich. Welche Dividende in der letzten Runde gezahlt wurde spielt also keine Rolle, wenn der Computer zufllig entscheidet welche Dividende in dieser Runde gezahlt wird.\r\n\\par\\par\r\nKlicken Sie auf \"Weiter\" fr die nchste Frage.\r\n}";
				}
			}
			standardbox "Standard"{
				hasframe = FALSE;
				left = 10%;
				right = 10%;
				top = 20%;
				bottom = 40%;
				displaycondition = Control1==5;
				buttonposition = BOTTOMRIGHT;
				buttonsequence = HORIZONTAL;
				item{
					label = "{\\rtf\\fs24\\ql Ihre Antwort ist richtig! \r\n\\par\r\nKlicken Sie auf \"Weiter\" fr die nchste Frage.\r\n}";
				}
			}
			standardbox "Buttonbox"{
				hasframe = FALSE;
				top = 90%;
				bottom = 0%;
				cutbottom = TRUE;
				buttonposition = BOTTOMRIGHT;
				buttonsequence = HORIZONTAL;
				button "Weiter"{
					clearinputafterok = FALSE;
					norecordmadeorselected = FALSE;
					terminatestage = TRUE;
					donotterminatestage = FALSE;
					specialbuttoncolor = TRUE;
					buttoncolor = 5921535;
				}
			}
		}
		screen wait{
			usesbg = TRUE;
			withalertscreen = FALSE;
			noalertscreen = FALSE;
		}
	}
	stage "ControlQuestion2"{
		startwaitforall = TRUE;
		singleentry = FALSE;
		singleentrycontinuation = FALSE;
		timeouttype = never;
		timeout = 30;
		program{
			table = subjects;
			do{
				Participate=if(Period==1,1,0);
			}
		}
		screen action{
			usesbg = TRUE;
			withalertscreen = FALSE;
			noalertscreen = FALSE;
			headerbox "Header"{
				hasframe = TRUE;
				height = 10%;
				top = 0p;
				cuttop = TRUE;
				showPeriods = TRUE;
				showNumPeriods = TRUE;
				periodtext = "Periode";
				periodoftext = "von";
				practiceperiodprefix = "Probe ";
				showtime = TRUE;
				timestr = "Verbleibende Zeit [sec]:";
				pleasedecidetext = "Bitte entscheiden Sie sich jetzt!";
			}
			standardbox "Standard"{
				hasframe = FALSE;
				left = 10%;
				right = 10%;
				top = 20%;
				bottom = 40%;
				buttonposition = BOTTOMRIGHT;
				buttonsequence = HORIZONTAL;
				item{
					label = "{\\rtf\\fs24\\ql Zur Beantwortung dieser Frage bentigen Sie die ausgedruckte Tabelle.\r\n\\par\r\nStellen Sie sich vor: \r\n\\par\r\nSie befinden sich in der 14. Runde und besitzen 2 Aktien. Angenommen Sie wrden nicht mehr kaufen oder verkaufen, wie hoch wre die Dividende, welche Sie bis zum Ende des Experimentes INSGESAMT erhalten durchschnittlich?\r\n}";
					variable = Control2;
					format = "!radio: 1=\"48 ECU\";2=\"24 ECU\";3=\"96 ECU\";";
					input = TRUE;
					showdefault = TRUE;
					emptyallowed = FALSE;
					min = 0;
					max = 100;
				}
			}
			standardbox "Buttonbox"{
				hasframe = FALSE;
				top = 90%;
				bottom = 0%;
				cutbottom = TRUE;
				buttonposition = BOTTOMRIGHT;
				buttonsequence = HORIZONTAL;
				button "Weiter"{
					clearinputafterok = FALSE;
					norecordmadeorselected = FALSE;
					terminatestage = TRUE;
					donotterminatestage = FALSE;
					specialbuttoncolor = TRUE;
					buttoncolor = 5921535;
				}
			}
		}
		screen wait{
			usesbg = TRUE;
			withalertscreen = FALSE;
			noalertscreen = FALSE;
		}
	}
	stage "ControlQuestion2Check"{
		startwaitforall = TRUE;
		singleentry = FALSE;
		singleentrycontinuation = FALSE;
		timeouttype = never;
		timeout = 30;
		program{
			table = subjects;
			do{
				Participate=if(Period==1,1,0);
			}
		}
		screen action{
			usesbg = TRUE;
			withalertscreen = FALSE;
			noalertscreen = FALSE;
			headerbox "Header"{
				hasframe = TRUE;
				height = 10%;
				top = 0p;
				cuttop = TRUE;
				showPeriods = TRUE;
				showNumPeriods = TRUE;
				periodtext = "Periode";
				periodoftext = "von";
				practiceperiodprefix = "Probe ";
				showtime = TRUE;
				timestr = "Verbleibende Zeit [sec]:";
				pleasedecidetext = "Bitte entscheiden Sie sich jetzt!";
			}
			standardbox "Standard"{
				hasframe = FALSE;
				left = 10%;
				right = 10%;
				top = 20%;
				bottom = 40%;
				displaycondition = Control2!=3;
				buttonposition = BOTTOMRIGHT;
				buttonsequence = HORIZONTAL;
				item{
					label = "{\\rtf\\fs24\\ql Ihre Antwort ist leider falsch! \r\n\\par\r\nJede Runde gibt es 4 mgliche Dividenden pro Aktie (0, 8, 28 und 60 ECU). Jede dieser Dividenden ist in jeder Runde gleich wahrscheinlich. Der Durchschnitt der 4 Dividenden ist 24 ECU. Dies ist also die Dividende die Sie durchschnittlich pro Runde erwarten knnen. Da in Runde 14 noch 2 Dividenden ausstehen, nmlich die 14. und 15., werden Sie durchschnittlich 2*24 ECU erhalten. Da Sie im Beispiel 2 Aktien hatten erhalten Sie durchschnittlich 2*2*24 ECU, also 96 ECU.\r\n\\par\\par\r\nKlicken Sie auf \"Weiter\" fr die nchste Frage.\r\n}";
				}
			}
			standardbox "Standard"{
				hasframe = FALSE;
				left = 10%;
				right = 10%;
				top = 20%;
				bottom = 40%;
				displaycondition = Control2==3;
				buttonposition = BOTTOMRIGHT;
				buttonsequence = HORIZONTAL;
				item{
					label = "{\\rtf\\fs24\\ql Ihre Antwort ist richtig!\r\n\\par\r\nKlicken Sie auf \"Weiter\" fr die nchste Frage.\r\n}";
				}
			}
			standardbox "Buttonbox"{
				hasframe = FALSE;
				top = 90%;
				bottom = 0%;
				cutbottom = TRUE;
				buttonposition = BOTTOMRIGHT;
				buttonsequence = HORIZONTAL;
				button "Weiter"{
					clearinputafterok = FALSE;
					norecordmadeorselected = FALSE;
					terminatestage = TRUE;
					donotterminatestage = FALSE;
					specialbuttoncolor = TRUE;
					buttoncolor = 5921535;
				}
			}
		}
		screen wait{
			usesbg = TRUE;
			withalertscreen = FALSE;
			noalertscreen = FALSE;
		}
	}
	stage "ControlQuestion3"{
		startwaitforall = TRUE;
		singleentry = FALSE;
		singleentrycontinuation = FALSE;
		timeouttype = never;
		timeout = 30;
		program{
			table = subjects;
			do{
				Participate=if(Period==1,1,0);
			}
		}
		screen action{
			usesbg = TRUE;
			withalertscreen = FALSE;
			noalertscreen = FALSE;
			headerbox "Header"{
				hasframe = TRUE;
				height = 10%;
				top = 0p;
				cuttop = TRUE;
				showPeriods = TRUE;
				showNumPeriods = TRUE;
				periodtext = "Periode";
				periodoftext = "von";
				practiceperiodprefix = "Probe ";
				showtime = TRUE;
				timestr = "Verbleibende Zeit [sec]:";
				pleasedecidetext = "Bitte entscheiden Sie sich jetzt!";
			}
			standardbox "Standard"{
				hasframe = FALSE;
				left = 10%;
				right = 10%;
				top = 20%;
				bottom = 40%;
				buttonposition = BOTTOMRIGHT;
				buttonsequence = HORIZONTAL;
				item{
					label = "{\\rtf\\fs24\\ql Stellen Sie sich vor: \r\n\\par\r\nAuf Ihrer Benutzeroberflche sehen Sie, dass eine Versuchsperson Aktien zu minimal 100 ECU verkaufen wrde. Sie wollen auf das Verkaufsangebot eingehen und geben ein Kaufangebot ein. Mit welchem der folgenden Kaufangebote wren Sie {\\i nicht} erfolgreich?\r\n}";
					variable = Control3;
					format = "!radio: 1=\"99 ECU\";2=\"100 ECU\";3=\"101 ECU\";";
					input = TRUE;
					showdefault = TRUE;
					emptyallowed = FALSE;
					min = 0;
					max = 100;
				}
			}
			standardbox "Buttonbox"{
				hasframe = FALSE;
				top = 90%;
				bottom = 0%;
				cutbottom = TRUE;
				buttonposition = BOTTOMRIGHT;
				buttonsequence = HORIZONTAL;
				button "Weiter"{
					clearinputafterok = FALSE;
					norecordmadeorselected = FALSE;
					terminatestage = TRUE;
					donotterminatestage = FALSE;
					specialbuttoncolor = TRUE;
					buttoncolor = 5921535;
				}
			}
		}
		screen wait{
			usesbg = TRUE;
			withalertscreen = FALSE;
			noalertscreen = FALSE;
		}
	}
	stage "ControlQuestion3Check"{
		startwaitforall = TRUE;
		singleentry = FALSE;
		singleentrycontinuation = FALSE;
		timeouttype = never;
		timeout = 30;
		program{
			table = subjects;
			do{
				Participate=if(Period==1,1,0);
			}
		}
		screen action{
			usesbg = TRUE;
			withalertscreen = FALSE;
			noalertscreen = FALSE;
			headerbox "Header"{
				hasframe = TRUE;
				height = 10%;
				top = 0p;
				cuttop = TRUE;
				showPeriods = TRUE;
				showNumPeriods = TRUE;
				periodtext = "Periode";
				periodoftext = "von";
				practiceperiodprefix = "Probe ";
				showtime = TRUE;
				timestr = "Verbleibende Zeit [sec]:";
				pleasedecidetext = "Bitte entscheiden Sie sich jetzt!";
			}
			standardbox "Standard"{
				hasframe = FALSE;
				left = 10%;
				right = 10%;
				top = 20%;
				bottom = 40%;
				displaycondition = Control3!=1;
				buttonposition = BOTTOMRIGHT;
				buttonsequence = HORIZONTAL;
				item{
					label = "{\\rtf\\fs24\\ql Ihre Antwort ist leider falsch! \r\n\\par\r\nEin Spieler hat ein Verkaufsangebot von mindestens 100 ECU gemacht.\r\nWrden Sie 99 ECU bieten, wre dies weniger als die 100 ECU die im Verkaufsangebot mindestens gefordert werden.\r\n\\par\\par\r\nBitte klicken Sie auf \"Weiter\".\r\n}";
				}
			}
			standardbox "Standard"{
				hasframe = FALSE;
				left = 10%;
				right = 10%;
				top = 20%;
				bottom = 40%;
				displaycondition = Control3==1;
				buttonposition = BOTTOMRIGHT;
				buttonsequence = HORIZONTAL;
				item{
					label = "{\\rtf\\fs24\\ql Ihre Antwort ist richtig! \r\n\\par\r\nBitte klicken Sie auf \"Weiter\".\r\n}";
				}
			}
			standardbox "Buttonbox"{
				hasframe = FALSE;
				top = 90%;
				bottom = 0%;
				cutbottom = TRUE;
				buttonposition = BOTTOMRIGHT;
				buttonsequence = HORIZONTAL;
				button "Weiter"{
					clearinputafterok = FALSE;
					norecordmadeorselected = FALSE;
					terminatestage = TRUE;
					donotterminatestage = FALSE;
					specialbuttoncolor = TRUE;
					buttoncolor = 5921535;
				}
			}
		}
		screen wait{
			usesbg = TRUE;
			withalertscreen = FALSE;
			noalertscreen = FALSE;
		}
	}
	stage "ControlQuestion4"{
		startwaitforall = TRUE;
		singleentry = FALSE;
		singleentrycontinuation = FALSE;
		timeouttype = never;
		timeout = 30;
		program{
			table = subjects;
			do{
				Participate=if(Period==1,1,0);
			}
		}
		screen action{
			usesbg = TRUE;
			withalertscreen = FALSE;
			noalertscreen = FALSE;
			headerbox "Header"{
				hasframe = TRUE;
				height = 10%;
				top = 0p;
				cuttop = TRUE;
				showPeriods = TRUE;
				showNumPeriods = TRUE;
				periodtext = "Periode";
				periodoftext = "von";
				practiceperiodprefix = "Probe ";
				showtime = TRUE;
				timestr = "Verbleibende Zeit [sec]:";
				pleasedecidetext = "Bitte entscheiden Sie sich jetzt!";
			}
			standardbox "Standard"{
				hasframe = FALSE;
				left = 10%;
				right = 10%;
				top = 20%;
				bottom = 40%;
				buttonposition = BOTTOMRIGHT;
				buttonsequence = HORIZONTAL;
				item{
					label = "{\\rtf\\fs24\\ql Dasselbe Szenario wie in der letzten Frage: \r\n\\par\r\nAuf Ihrer Benutzeroberflche sehen Sie, dass eine Versuchsperson Aktien zu minimal 100 ECU verkaufen wrde. Sie wollen auf das Verkaufsangebot eingehen und geben ein Kaufangebot von 101 ECU ein. Zu welchem Preis wrde die Aktie an Sie verkauft?\r\n}";
					variable = Control4;
					format = "!radio: 1=\"99 ECU\";2=\"100 ECU\";3=\"101 ECU\";";
					input = TRUE;
					showdefault = TRUE;
					emptyallowed = FALSE;
					min = 0;
					max = 100;
				}
			}
			standardbox "Buttonbox"{
				hasframe = FALSE;
				top = 90%;
				bottom = 0%;
				cutbottom = TRUE;
				buttonposition = BOTTOMRIGHT;
				buttonsequence = HORIZONTAL;
				button "Weiter"{
					clearinputafterok = FALSE;
					norecordmadeorselected = FALSE;
					terminatestage = TRUE;
					donotterminatestage = FALSE;
					specialbuttoncolor = TRUE;
					buttoncolor = 5921535;
				}
			}
		}
		screen wait{
			usesbg = TRUE;
			withalertscreen = FALSE;
			noalertscreen = FALSE;
		}
	}
	stage "ControlQuestion4Check"{
		startwaitforall = TRUE;
		singleentry = FALSE;
		singleentrycontinuation = FALSE;
		timeouttype = never;
		timeout = 30;
		program{
			table = subjects;
			do{
				Participate=if(Period==1,1,0);
			}
		}
		screen action{
			usesbg = TRUE;
			withalertscreen = FALSE;
			noalertscreen = FALSE;
			headerbox "Header"{
				hasframe = TRUE;
				height = 10%;
				top = 0p;
				cuttop = TRUE;
				showPeriods = TRUE;
				showNumPeriods = TRUE;
				periodtext = "Periode";
				periodoftext = "von";
				practiceperiodprefix = "Probe ";
				showtime = TRUE;
				timestr = "Verbleibende Zeit [sec]:";
				pleasedecidetext = "Bitte entscheiden Sie sich jetzt!";
			}
			standardbox "Standard"{
				hasframe = FALSE;
				left = 10%;
				right = 10%;
				top = 20%;
				bottom = 40%;
				displaycondition = Control4!=2;
				buttonposition = BOTTOMRIGHT;
				buttonsequence = HORIZONTAL;
				item{
					label = "{\\rtf\\fs24\\ql Ihre Antwort ist leider falsch! \r\n\\par\r\nJemand hat ein Verkaufsangebot von mindestens 100 ECU gemacht, Sie ein Kaufangebot von 101. Aktien werden immer zum Verkaufspreis verkauft.\r\n\\par\\par\r\n\r\nBitte klicken Sie auf \"Weiter\".\r\n}";
				}
			}
			standardbox "Standard"{
				hasframe = FALSE;
				left = 10%;
				right = 10%;
				top = 20%;
				bottom = 40%;
				displaycondition = Control4==2;
				buttonposition = BOTTOMRIGHT;
				buttonsequence = HORIZONTAL;
				item{
					label = "{\\rtf\\fs24\\ql Ihre Antwort ist richtig! \r\n\\par\r\nBitte klicken Sie auf \"Weiter\".\r\n}";
				}
			}
			standardbox "Buttonbox"{
				hasframe = FALSE;
				top = 90%;
				bottom = 0%;
				cutbottom = TRUE;
				buttonposition = BOTTOMRIGHT;
				buttonsequence = HORIZONTAL;
				button "Weiter"{
					clearinputafterok = FALSE;
					norecordmadeorselected = FALSE;
					terminatestage = TRUE;
					donotterminatestage = FALSE;
					specialbuttoncolor = TRUE;
					buttoncolor = 5921535;
				}
			}
		}
		screen wait{
			usesbg = TRUE;
			withalertscreen = FALSE;
			noalertscreen = FALSE;
		}
	}
	stage "ControlQuestion5"{
		startwaitforall = TRUE;
		singleentry = FALSE;
		singleentrycontinuation = FALSE;
		timeouttype = never;
		timeout = 30;
		program{
			table = subjects;
			do{
				Participate=if(Period==1,1,0);
			}
		}
		screen action{
			usesbg = TRUE;
			withalertscreen = FALSE;
			noalertscreen = FALSE;
			headerbox "Header"{
				hasframe = TRUE;
				height = 10%;
				top = 0p;
				cuttop = TRUE;
				showPeriods = TRUE;
				showNumPeriods = TRUE;
				periodtext = "Periode";
				periodoftext = "von";
				practiceperiodprefix = "Probe ";
				showtime = TRUE;
				timestr = "Verbleibende Zeit [sec]:";
				pleasedecidetext = "Bitte entscheiden Sie sich jetzt!";
			}
			standardbox "Standard"{
				hasframe = FALSE;
				left = 10%;
				right = 10%;
				top = 20%;
				bottom = 40%;
				buttonposition = BOTTOMRIGHT;
				buttonsequence = HORIZONTAL;
				item{
					label = "{\\rtf\\fs24\\ql Stellen Sie sich vor: \r\n\\par\r\nSie mchten Aktien kaufen. Sie geben ein Kaufangebot von 100 ECU ein. Nach 1 Minute entscheiden Sie, dass sie nur fr 90 ECU kaufen mchten und geben das dementsprechende neue Kaufangebot ein. Was passiert mit dem Kaufangebot von 100 ECU?\r\n\\par\r\n(Dieses Szenario spielt sich innerhalb einer Runde ab)}";
					variable = Control5;
					format = "!radio: 1=\"Es ist nicht mehr gltig\"; 2=\"Es ist gltig\";";
					input = TRUE;
					showdefault = TRUE;
					emptyallowed = FALSE;
					min = 0;
					max = 100;
				}
			}
			standardbox "Buttonbox"{
				hasframe = FALSE;
				top = 90%;
				bottom = 0%;
				cutbottom = TRUE;
				buttonposition = BOTTOMRIGHT;
				buttonsequence = HORIZONTAL;
				button "Weiter"{
					clearinputafterok = FALSE;
					norecordmadeorselected = FALSE;
					terminatestage = TRUE;
					donotterminatestage = FALSE;
					specialbuttoncolor = TRUE;
					buttoncolor = 5921535;
				}
			}
		}
		screen wait{
			usesbg = TRUE;
			withalertscreen = FALSE;
			noalertscreen = FALSE;
		}
	}
	stage "ControlQuestion5Check"{
		startwaitforall = TRUE;
		singleentry = FALSE;
		singleentrycontinuation = FALSE;
		timeouttype = never;
		timeout = 30;
		program{
			table = subjects;
			do{
				Participate=if(Period==1,1,0);
			}
		}
		screen action{
			usesbg = TRUE;
			withalertscreen = FALSE;
			noalertscreen = FALSE;
			headerbox "Header"{
				hasframe = TRUE;
				height = 10%;
				top = 0p;
				cuttop = TRUE;
				showPeriods = TRUE;
				showNumPeriods = TRUE;
				periodtext = "Periode";
				periodoftext = "von";
				practiceperiodprefix = "Probe ";
				showtime = TRUE;
				timestr = "Verbleibende Zeit [sec]:";
				pleasedecidetext = "Bitte entscheiden Sie sich jetzt!";
			}
			standardbox "Standard"{
				hasframe = FALSE;
				left = 10%;
				right = 10%;
				top = 20%;
				bottom = 40%;
				displaycondition = Control5==2;
				buttonposition = BOTTOMRIGHT;
				buttonsequence = HORIZONTAL;
				item{
					label = "{\\rtf\\fs24\\ql Ihre Antwort ist leider falsch! \r\n\\par\r\nGeben Sie ein neues Kaufangebot ab, wird Ihr altes gelscht.\r\n\\par\\par\r\n\r\nBitte klicken Sie auf \"Weiter\".\r\n}";
				}
			}
			standardbox "Standard"{
				hasframe = FALSE;
				left = 10%;
				right = 10%;
				top = 20%;
				bottom = 40%;
				displaycondition = Control5==1;
				buttonposition = BOTTOMRIGHT;
				buttonsequence = HORIZONTAL;
				item{
					label = "{\\rtf\\fs24\\ql Ihre Antwort ist richtig! \r\n\\par\r\nBitte klicken Sie auf \"Weiter\".\r\n}";
				}
			}
			standardbox "Buttonbox"{
				hasframe = FALSE;
				top = 90%;
				bottom = 0%;
				cutbottom = TRUE;
				buttonposition = BOTTOMRIGHT;
				buttonsequence = HORIZONTAL;
				button "Weiter"{
					clearinputafterok = FALSE;
					norecordmadeorselected = FALSE;
					terminatestage = TRUE;
					donotterminatestage = FALSE;
					specialbuttoncolor = TRUE;
					buttoncolor = 5921535;
				}
			}
		}
		screen wait{
			usesbg = TRUE;
			withalertscreen = FALSE;
			noalertscreen = FALSE;
		}
	}
	stage "IntroTrading"{
		startwaitforall = TRUE;
		singleentry = FALSE;
		singleentrycontinuation = FALSE;
		timeouttype = never;
		timeout = 30;
		program{
			table = subjects;
			do{
				Participate=if(Period==1,1,0);
			}
		}
		screen action{
			usesbg = TRUE;
			withalertscreen = FALSE;
			noalertscreen = FALSE;
			standardbox "Standard"{
				hasframe = FALSE;
				left = 10%;
				right = 10%;
				top = 20%;
				bottom = 40%;
				buttonposition = BOTTOMRIGHT;
				buttonsequence = HORIZONTAL;
				item{
					label = "{\\rtf\\fs24\\ql Gleich startet, wie im Video erklrt, das erste Marktexperiment. Am Ende des ersten Marktexperimentes werden Sie eine kurze Pause haben, bevor das zweite Marktexperiment startet.\r\n\\par\r\nEines der Marktexperimente kann durch den Computer zufllig zur Auszahlung ausgewhlt werden. Am Ende des Experimentes werden Sie ber Ihre Auszahlung informiert.\r\n}";
				}
			}
			standardbox "Buttonbox"{
				hasframe = FALSE;
				top = 90%;
				bottom = 0%;
				cutbottom = TRUE;
				buttonposition = BOTTOMRIGHT;
				buttonsequence = HORIZONTAL;
				button "Weiter"{
					clearinputafterok = FALSE;
					norecordmadeorselected = FALSE;
					terminatestage = TRUE;
					donotterminatestage = FALSE;
					specialbuttoncolor = TRUE;
					buttoncolor = 5921535;
				}
			}
		}
		screen wait{
			usesbg = TRUE;
			withalertscreen = FALSE;
			noalertscreen = FALSE;
		}
	}
	stage "Condition"{
		startwaitforall = TRUE;
		singleentry = FALSE;
		singleentrycontinuation = FALSE;
		timeouttype = never;
		timeout = 30;
		program{
			table = subjects;
			do{
				Participate=if(Period==1,1,0);
			}
		}
		screen action{
			usesbg = TRUE;
			withalertscreen = FALSE;
			noalertscreen = FALSE;
			standardbox "Standard"{
				hasframe = FALSE;
				left = 10%;
				right = 10%;
				top = 20%;
				bottom = 40%;
				buttonposition = BOTTOMRIGHT;
				buttonsequence = HORIZONTAL;
				item{
					label = "{\\rtf\\fs24\\ql Sie befinden sich in Gruppe 2 oder 3. Es besteht also eine 50% Chance, dass ein Computerhndler in Ihrem Markt handelt. Sollte der Computer entscheiden, dass ein Computerhndler teilnimmt, nimmt der Computerhndler teil an BEIDEN Runden des Marktexperimentes.\r\n}";
				}
			}
			standardbox "Buttonbox"{
				hasframe = FALSE;
				top = 90%;
				bottom = 0%;
				cutbottom = TRUE;
				buttonposition = BOTTOMRIGHT;
				buttonsequence = HORIZONTAL;
				button "Weiter"{
					clearinputafterok = FALSE;
					norecordmadeorselected = FALSE;
					terminatestage = TRUE;
					donotterminatestage = FALSE;
					specialbuttoncolor = TRUE;
					buttoncolor = 5921535;
				}
			}
		}
		screen wait{
			usesbg = TRUE;
			withalertscreen = FALSE;
			noalertscreen = FALSE;
		}
	}
	stage "Trading"{
		startwaitforall = TRUE;
		singleentry = FALSE;
		singleentrycontinuation = FALSE;
		timeouttype = always;
		timeout = TimeRound;
		program{
			table = subjects;
			do{
				//SETTING VARIABLES FOR A NEW ROUND
				offeredQuantity = 0;
				wantedQuantity = 0;
				offeredPrice = 10000;
				wantedPrice = 0;
				
				//Copyin values of previous round into variables of this round
				if(Period>1&Period!=expectedDividends+1)
				{ stocks = OLDsubjects.find(same(Subject), stocks);
				 money = OLDsubjects.find(same(Subject), money);
				 previousStocks = stocks;
				}
				
				if(Period>=expectedDividends){profitFirstTrading=OLDsubjects.find(same(Subject),profitFirstTrading);}
				
				
				
			}
		}
		program{
			table = globals;
			do{
				//SETTING VARIABLES FOR THE NEW ROUND
				
				//in the beginning of the first round of on marketsimulation
				if (Period==1|Period==(expectedDividends+1))
				{
				 NumberOfContracts = 0 ; // per round
				 numTrades = 0;
				 start=0;
				}
				
				//if it is not the first round of a marketsimulation
				if(Period!=1&Period!=(expectedDividends+1))
				{
				 numTrades = OLDglobals.find(numTrades); 
				 numTrades2 = OLDglobals.find(numTrades2); 
				 numTrades3 = OLDglobals.find(numTrades3); 
				 NumberOfContracts = OLDglobals.find(NumberOfContracts) ;
				 start=OLDglobals.find(start);
				 payedDividends =  OLDglobals.find(payedDividends)+1;
				 previousDividend = OLDglobals.find(previousDividend);
				 time=payedDividends*TimeRound;
				 SecondsLeft=TimeRound;
				 contracts.do{active=0;}
				}
				
				FV = 24*(expectedDividends-payedDividends);
			}
		}
		program{
			table = globals;
			condition = Period!=1&Period!=(expectedDividends+1);
			do{
				// COPYING THE OLD PRICE TABLE INTO THE NEW ONE
				it=0;
				while(it<numTrades)
				{ \it=\it+1;
				  prices.new{  id=\it;}
				}
				prices.do
				{price = OLDprices.find(same(id), price);
				 Seller = OLDprices.find(same(id),Seller);
				 Buyer = OLDprices.find(same(id),Buyer);
				 end = OLDprices.find(same(id),end);
				 Group = OLDprices.find(same(id),Group);
				}
				
				it=0;
				while(it<numTrades2)
				{ \it=\it+1;
				  prices2.new{  id=\it;}
				}
				prices2.do
				{price = OLDprices2.find(same(id), price);
				 Seller = OLDprices2.find(same(id),Seller);
				 Buyer = OLDprices2.find(same(id),Buyer);
				 end = OLDprices2.find(same(id),end);
				 Group = OLDprices2.find(same(id),Group);
				}
				
				it=0;
				while(it<numTrades3)
				{ \it=\it+1;
				  prices3.new{  id=\it;}
				}
				prices3.do
				{price = OLDprices3.find(same(id), price);
				 Seller = OLDprices3.find(same(id),Seller);
				 Buyer = OLDprices3.find(same(id),Buyer);
				 end = OLDprices3.find(same(id),end);
				 Group = OLDprices3.find(same(id),Group);
				}
			}
		}
		program{
			table = globals;
			do{
				later (1) repeat {time = time+1; SecondsLeft=SecondsLeft-1;}
			}
		}
		program{
			table = globals;
			condition = Period==1|Period==expectedDividends+1;
			do{
				algotrader.new{stocks=4;money=720;ID=19;Group=1;}
				algotrader.new{stocks=4;money=720;ID=20;Group=2;}
				algotrader.new{stocks=4;money=720;ID=21;Group=3;}
			}
		}
		program{
			table = globals;
			condition = Period!=1&Period!=(expectedDividends+1);
			do{
				// COPYING THE algotrader TABLE INTO THE NEW ONE
				it=0;
				while(it<3)
				{ \it=\it+1;
				  algotrader.new{  ID=\it+18;}
				}
				algotrader.do
				{money = OLDalgotrader.find(same(ID), money);
				 stocks = OLDalgotrader.find(same(ID), stocks);
				 Group = OLDalgotrader.find(same(ID), Group);
				}
			}
		}
		program{
			table = algotrader;
			condition = Period>1&Period!=expectedDividends+1;
			do{
				//algos get Dividend
				money = money + stocks*\previousDividend;
			}
		}
		program{
			table = algotrader;
			condition = AT==1;
			do{
				// ALGORITHMIC TRADERS MAKE FIRST OFFER
				
				//offer assets
				if(stocks>0)
				{
				 contracts.new{
				 Seller = :ID;
				 Buyer = -1;
				 maker = Seller;
				 Group = :Group;
				 \NumberOfContracts = \NumberOfContracts +1;
				 traded =0;
				 start = time;
				 sell=1;
				 active=1;
				 p=\FV;
				 volume=stocks;
				 }
				
				
				 subjects.do{ if(Group==:Group){bestSellPrice = \FV;}}
				}
				
				//offer price
				if(rounddown(money/ \FV,1)>0)
				{
				 contracts.new{
				 Seller = -1;
				 Buyer = :ID;
				 maker = Buyer;
				 Group = :Group;
				 \NumberOfContracts = \NumberOfContracts +1;
				 traded =0;
				 active = 1;
				 start = time;
				 sell = 0;
				 p=\FV-1;
				 volume = min (rounddown(:money/ \FV,1), 24);
				 }
				 
				 subjects.do{ if(Group==:Group){bestBuyPrice = \FV-1;}}
				}
				
				globals.do
				{
				//MATCH BIDS AND OFFERS
				//make sure that Buyer and Seller are not identical
				
				bestBuyPriceGroup = contracts.maximum(active==1& Seller==-1 & Group == \groupConsidered,p);
				bestSellPriceGroup = contracts.minimum(active==1& Buyer==-1 & Group == \groupConsidered,p);
				
				if(bestBuyPriceGroup>=bestSellPriceGroup)
				{B = contracts.find(p==bestBuyPriceGroup& active==1&Seller==-1& Group == \groupConsidered,Buyer);
				 S = contracts.find(p==bestSellPriceGroup& active==1&Buyer==-1& Group == \groupConsidered,Seller);
				 if (B==S)
				 {if (contracts.maximum(active==1& Seller==-1& Buyer!=B & Group == \groupConsidered,p) >= bestSellPriceGroup) 
				  { B = contracts.find(p==contracts.maximum(active==1& Seller==-1& Buyer!=B& Group == \groupConsidered,p),Buyer);
				  }
				  elsif ( bestBuyPriceGroup>= contracts.minimum(active==1& Buyer==-1& Seller!=S& Group == \groupConsidered,p)) 
				  { S = contracts.find(p==contracts.minimum(active==1& Buyer==-1& Seller!=S& Group == \groupConsidered,p),Seller);
				  }
				  else
				  {B=-1;}
				 }
				 
				 //stocks and money are exchanged and respective contracts deactivated
				 if(B!=-1)
				 {subjects.do{if(Group==groupConsidered) {latestPrice =bestSellPriceGroup;}}
				  volumeTraded = min(contracts.find(Buyer==\B& active==1,volume),  contracts.find(Seller==S& active==1,volume));
				  if(groupConsidered==1)
				  { numTrades=numTrades+1;
				   prices.new
				   {
				    price = bestSellPriceGroup;
				    end=time;
				    Buyer=\B;
				    Seller=\S;
				    id=numTrades;
				    Group=\groupConsidered;
				   }
				  }
				  if(groupConsidered==2)
				  { numTrades2=numTrades2+1;
				   prices2.new
				   {
				    price = bestSellPriceGroup;
				    end=time;
				    Buyer=\B;
				    Seller=\S;
				    id=numTrades2;
				    Group=\groupConsidered;
				   }
				  }
				  if(groupConsidered==3)
				  { numTrades3=numTrades3+1;
				   prices3.new
				   {
				    price = bestSellPriceGroup;
				    end=time;
				    Buyer=\B;
				    Seller=\S;
				    id=numTrades3;
				    Group=\groupConsidered;
				   }
				  }
				  //update contracts
				  contracts.do
				  {if(Buyer==\B& active==1& \bought==0) {traded=1; \bought=1; active=0;Seller=\S; end=time; actualVolume = volumeTraded;}
				   if(Seller==\S& active==1& \sold==0) {traded=1; \sold=1; active=0; Buyer=\B; end=time; actualVolume = volumeTraded;}
				  }
				  bought = 0;
				  sold = 0;
				  
				  //update Buyer/B and Seller/S
				  subjects.do
				  {if (Subject==\B) 
				   {money=money-\volumeTraded*\bestSellPriceGroup; stocks=stocks+\volumeTraded; wantedPrice=0; wantedQuantity=0; 
				    offeredPrice=10000; offeredQuantity =0;wasISeller=0;lastTradePrice = \bestSellPriceGroup; lastTradeVolume=\volumeTraded;
				   }
				   if (Subject==\S) 
				   {money=money+\volumeTraded*\bestSellPriceGroup; stocks=stocks-\volumeTraded; wantedPrice=0; wantedQuantity=0; 
				    offeredPrice=10000; offeredQuantity =0; wasISeller=1;lastTradePrice = \bestSellPriceGroup; lastTradeVolume=\volumeTraded;
				   }
				  }
				  if(\B>18|\S>18)
				  {algotrader.do
				   {if (ID==\B) 
				    {money=money-\volumeTraded*\bestSellPriceGroup; stocks=stocks+\volumeTraded;
				    }
				    if (ID==\S) 
				    {money=money+\volumeTraded*\bestSellPriceGroup; stocks=stocks-\volumeTraded; 
				    }
				   }
				  }
				
				
				  //deactivate all contracts made by Buyer and Seller
				  contracts.do
				  {
				   if (Buyer == \S | Seller == \S | Buyer == \B | Seller== \B){active=0;}
				  } 
				  //find new bestBuyPrice and bestSellPrice and tell subjects
				  subjects.do
				  {if(Group==groupConsidered)
				   {
				    bestBuyPrice = contracts.maximum(active==1& Seller==-1 & Group == \groupConsidered,p);
				    bestSellPrice = contracts.minimum(active==1& Buyer==-1 & Group == \groupConsidered,p);
				   } 
				  }
				 }
				}
				// END OF BLOCK
				}
				
			}
		}
		program{
			table = algotrader;
			condition = AT==1;
			do{
				// ALGORITHMIC TRADERS GET ACTIVE
				
				later (20) repeat {
				
				//offer assets
				if(stocks>0)
				{
				 contracts.new{
				 Seller = :ID;
				 Buyer = -1;
				 maker = Seller;
				 Group = :Group;
				 \NumberOfContracts = \NumberOfContracts +1;
				 traded =0;
				 start = time;
				 sell=1;
				 active=1;
				 p=\FV;
				 volume=stocks;
				 }
				
				
				 subjects.do{ if(Group==:Group){bestSellPrice = \FV;}}
				}
				
				//offer price
				if(rounddown(money/ \FV,1)>0)
				{
				 contracts.new{
				 Seller = -1;
				 Buyer = :ID;
				 maker = Buyer;
				 Group = :Group;
				 \NumberOfContracts = \NumberOfContracts +1;
				 traded =0;
				 active = 1;
				 start = time;
				 sell = 0;
				 p=\FV-1;
				 volume = min (rounddown(:money/ \FV,1), 24);
				 }
				 
				 subjects.do{ if(Group==:Group){bestBuyPrice = \FV-1;}}
				}
				
				globals.do
				{
				//MATCH BIDS AND OFFERS
				//make sure that Buyer and Seller are not identical
				
				bestBuyPriceGroup = contracts.maximum(active==1& Seller==-1 & Group == \groupConsidered,p);
				bestSellPriceGroup = contracts.minimum(active==1& Buyer==-1 & Group == \groupConsidered,p);
				
				if(bestBuyPriceGroup>=bestSellPriceGroup)
				{B = contracts.find(p==bestBuyPriceGroup& active==1&Seller==-1& Group == \groupConsidered,Buyer);
				 S = contracts.find(p==bestSellPriceGroup& active==1&Buyer==-1& Group == \groupConsidered,Seller);
				 if (B==S)
				 {if (contracts.maximum(active==1& Seller==-1& Buyer!=B & Group == \groupConsidered,p) >= bestSellPriceGroup) 
				  { B = contracts.find(p==contracts.maximum(active==1& Seller==-1& Buyer!=B& Group == \groupConsidered,p),Buyer);
				  }
				  elsif ( bestBuyPriceGroup>= contracts.minimum(active==1& Buyer==-1& Seller!=S& Group == \groupConsidered,p)) 
				  { S = contracts.find(p==contracts.minimum(active==1& Buyer==-1& Seller!=S& Group == \groupConsidered,p),Seller);
				  }
				  else
				  {B=-1;}
				 }
				 
				 //stocks and money are exchanged and respective contracts deactivated
				 if(B!=-1)
				 {subjects.do{if(Group==groupConsidered) {latestPrice =bestSellPriceGroup;}}
				  volumeTraded = min(contracts.find(Buyer==\B& active==1,volume),  contracts.find(Seller==S& active==1,volume));
				  if(groupConsidered==1)
				  { numTrades=numTrades+1;
				   prices.new
				   {
				    price = bestSellPriceGroup;
				    end=time;
				    Buyer=\B;
				    Seller=\S;
				    id=numTrades;
				    Group=\groupConsidered;
				   }
				  }
				  if(groupConsidered==2)
				  { numTrades2=numTrades2+1;
				   prices2.new
				   {
				    price = bestSellPriceGroup;
				    end=time;
				    Buyer=\B;
				    Seller=\S;
				    id=numTrades2;
				    Group=\groupConsidered;
				   }
				  }
				  if(groupConsidered==3)
				  { numTrades3=numTrades3+1;
				   prices3.new
				   {
				    price = bestSellPriceGroup;
				    end=time;
				    Buyer=\B;
				    Seller=\S;
				    id=numTrades3;
				    Group=\groupConsidered;
				   }
				  }
				  //update contracts
				  contracts.do
				  {if(Buyer==\B& active==1& \bought==0) {traded=1; \bought=1; active=0;Seller=\S; end=time; actualVolume = volumeTraded;}
				   if(Seller==\S& active==1& \sold==0) {traded=1; \sold=1; active=0; Buyer=\B; end=time; actualVolume = volumeTraded;}
				  }
				  bought = 0;
				  sold = 0;
				  
				  //update Buyer/B and Seller/S
				  subjects.do
				  {if (Subject==\B) 
				   {money=money-\volumeTraded*\bestSellPriceGroup; stocks=stocks+\volumeTraded; wantedPrice=0; wantedQuantity=0; 
				    offeredPrice=10000; offeredQuantity =0;wasISeller=0;lastTradePrice = \bestSellPriceGroup; lastTradeVolume=\volumeTraded;
				   }
				   if (Subject==\S) 
				   {money=money+\volumeTraded*\bestSellPriceGroup; stocks=stocks-\volumeTraded; wantedPrice=0; wantedQuantity=0; 
				    offeredPrice=10000; offeredQuantity =0; wasISeller=1;lastTradePrice = \bestSellPriceGroup; lastTradeVolume=\volumeTraded;
				   }
				  }
				  if(\B>18|\S>18)
				  {algotrader.do
				   {if (ID==\B) 
				    {money=money-\volumeTraded*\bestSellPriceGroup; stocks=stocks+\volumeTraded;
				    }
				    if (ID==\S) 
				    {money=money+\volumeTraded*\bestSellPriceGroup; stocks=stocks-\volumeTraded; 
				    }
				   }
				  }
				
				
				  //deactivate all contracts made by Buyer and Seller
				  contracts.do
				  {
				   if (Buyer == \S | Seller == \S | Buyer == \B | Seller== \B){active=0;}
				  } 
				  //find new bestBuyPrice and bestSellPrice and tell subjects
				  subjects.do
				  {if(Group==groupConsidered)
				   {
				    bestBuyPrice = contracts.maximum(active==1& Seller==-1 & Group == \groupConsidered,p);
				    bestSellPrice = contracts.minimum(active==1& Buyer==-1 & Group == \groupConsidered,p);
				   } 
				  }
				 }
				}
				// END OF BLOCK
				}
				
				
				
				}
			}
		}
		screen action{
			usesbg = TRUE;
			withalertscreen = FALSE;
			noalertscreen = FALSE;
			standardbox "InformationRound"{
				hasframe = TRUE;
				left = 50%;
				right = 0%;
				top = 0%;
				bottom = 80%;
				buttonposition = BOTTOMRIGHT;
				buttonsequence = HORIZONTAL;
				item{
					label = "Zeit bis Auszahlung:";
					variable = SecondsLeft;
					format = "1";
					input = FALSE;
				}
				item{
					label = "Ausstehende Dividenden: ";
					variable = expectedDividends-payedDividends;
					format = "1";
					input = FALSE;
				}
			}
			standardbox "Standard"{
				hasframe = FALSE;
				left = 75%;
				bottom = 92%;
				buttonposition = BOTTOMRIGHT;
				buttonsequence = HORIZONTAL;
				item{
					label = "{\\rtf \\fs30 Zeit }";
				}
			}
			plotbox "PricePath"{
				hasframe = TRUE;
				left = 50%;
				right = 0;
				top = 20%;
				bottom = 0%;
				displaycondition = Group==1;
				maintainaspectratio = FALSE;
				xborderdist = 25;
				yborderdist = 20;
				xaxistype = LINEAR;
				yaxistype = LINEAR;
				xleft = 0;
				xright = TimeAuction;
				ybottom = 0;
				ytop = 500;
				movepointertox = 0;
				movepointertoy = 0;
				plotline "1.Dividend"{
					x1 = TimeAuction/expectedDividends;
					y1 = 0;
					x2 = TimeAuction/expectedDividends;
					y2 = 500;
					linecolor = rgb(0.45,0.85,0.85);
					linewidth = 1;
					arrowclosed = FALSE;
				}
				plotline "2.Dividend"{
					x1 = TimeAuction/expectedDividends*2;
					y1 = 0;
					x2 = TimeAuction/expectedDividends*2;
					y2 = 500;
					linecolor = rgb(0.45,0.85,0.85);
					linewidth = 1;
					arrowclosed = FALSE;
				}
				plotline "3.Dividend"{
					x1 = TimeAuction/expectedDividends*3;
					y1 = 0;
					x2 = TimeAuction/expectedDividends*3;
					y2 = 500;
					linecolor = rgb(0.45,0.85,0.85);
					linewidth = 1;
					arrowclosed = FALSE;
				}
				plotline "4.Dividend"{
					x1 = TimeAuction/expectedDividends*4;
					y1 = 0;
					x2 = TimeAuction/expectedDividends*4;
					y2 = 500;
					linecolor = rgb(0.45,0.85,0.85);
					linewidth = 1;
					arrowclosed = FALSE;
				}
				plotline "5.Dividend"{
					x1 = TimeAuction/expectedDividends*5;
					y1 = 0;
					x2 = TimeAuction/expectedDividends*5;
					y2 = 500;
					linecolor = rgb(0.45,0.85,0.85);
					linewidth = 1;
					arrowclosed = FALSE;
				}
				plotline "6.Dividend"{
					x1 = TimeAuction/expectedDividends*6;
					y1 = 0;
					x2 = TimeAuction/expectedDividends*6;
					y2 = 500;
					linecolor = rgb(0.45,0.85,0.85);
					linewidth = 1;
					arrowclosed = FALSE;
				}
				plotline "7.Dividend"{
					x1 = TimeAuction/expectedDividends*7;
					y1 = 0;
					x2 = TimeAuction/expectedDividends*7;
					y2 = 500;
					linecolor = rgb(0.45,0.85,0.85);
					linewidth = 1;
					arrowclosed = FALSE;
				}
				plotline "8.Dividend"{
					x1 = TimeAuction/expectedDividends*8;
					y1 = 0;
					x2 = TimeAuction/expectedDividends*8;
					y2 = 500;
					linecolor = rgb(0.45,0.85,0.85);
					linewidth = 1;
					arrowclosed = FALSE;
				}
				plotline "9.Dividend"{
					x1 = TimeAuction/expectedDividends*9;
					y1 = 0;
					x2 = TimeAuction/expectedDividends*9;
					y2 = 500;
					linecolor = rgb(0.45,0.85,0.85);
					linewidth = 1;
					arrowclosed = FALSE;
				}
				plotline "10.Dividend"{
					x1 = TimeAuction/expectedDividends*10;
					y1 = 0;
					x2 = TimeAuction/expectedDividends*10;
					y2 = 500;
					linecolor = rgb(0.45,0.85,0.85);
					linewidth = 1;
					arrowclosed = FALSE;
				}
				plotline "11.Dividend"{
					x1 = TimeAuction/expectedDividends*11;
					y1 = 0;
					x2 = TimeAuction/expectedDividends*11;
					y2 = 500;
					linecolor = rgb(0.45,0.85,0.85);
					linewidth = 1;
					arrowclosed = FALSE;
				}
				plotline "12.Dividend"{
					x1 = TimeAuction/expectedDividends*12;
					y1 = 0;
					x2 = TimeAuction/expectedDividends*12;
					y2 = 500;
					linecolor = rgb(0.45,0.85,0.85);
					linewidth = 1;
					arrowclosed = FALSE;
				}
				plotline "13.Dividend"{
					x1 = TimeAuction/expectedDividends*13;
					y1 = 0;
					x2 = TimeAuction/expectedDividends*13;
					y2 = 500;
					linecolor = rgb(0.45,0.85,0.85);
					linewidth = 1;
					arrowclosed = FALSE;
				}
				plotline "14.Dividend"{
					x1 = TimeAuction/expectedDividends*14;
					y1 = 0;
					x2 = TimeAuction/expectedDividends*14;
					y2 = 500;
					linecolor = rgb(0.45,0.85,0.85);
					linewidth = 1;
					arrowclosed = FALSE;
				}
				plotline "15.Dividend"{
					x1 = TimeAuction/expectedDividends*15;
					y1 = 0;
					x2 = TimeAuction/expectedDividends*15;
					y2 = 500;
					linecolor = rgb(0.45,0.85,0.85);
					linewidth = 1;
					arrowclosed = FALSE;
				}
				plotgraph "graph"{
					table = prices;
					condition = TRUE;
					connectioncolor = rgb( .3,.3,0);
					connectionwidth = 1;
					filltoxaxis = FALSE;
					connecttopreviouspoint = FALSE;
					plotpoint "transaction"{
						displaycondition = end!=0 & Group==:Group;
						x = end;
						y = price;
						isstar = TRUE;
						size = 1;
						numedges = 1;
						startat = 45;
						linecolor = rgb(0.00,0.00,0.00);
						linewidth = 1;
						fillcolor = rgb(0.00,0.00,0.00);
					}
					plotpoint "transaction"{
						displaycondition = (Seller==:Subject | Buyer==:Subject) & Group==:Group;
						x = end;
						y = price;
						isstar = TRUE;
						size = 2;
						numedges = 4;
						startat = 45;
						linecolor = rgb(0.00,0.00,0.00);
						linewidth = 1;
					}
					plotpoint ""{
						x = 1;
						y = 0;
						isstar = FALSE;
						size = 0;
						numedges = 4;
						startat = 45;
						linecolor = rgb(0,0,0);
						linewidth = 0;
					}
					plotpoint ""{
						x = 0;
						y = 0;
						isstar = FALSE;
						size = 0;
						numedges = 4;
						startat = 45;
						linecolor = rgb(0,0,0);
						linewidth = 0;
					}
				}
				plotaxis "price"{
					axis = Y;
					from = 0;
					to = 500;
					tickdistance = 10;
					datalabeldistance = 50;
					datalabelformat = 1;
					linecolor = rgb(0.00,0.00,0.00);
					linewidth = 1;
				}
				plotaxis "seconds"{
					axis = X;
					position = 0;
					from = 0;
					to = TimeAuction;
					tickdistance = 100;
					datalabeldistance = 100;
					datalabelformat = 1;
					linecolor = rgb(0.00,0.00,0.00);
					linewidth = 1;
				}
			}
			plotbox "PricePath2"{
				hasframe = TRUE;
				left = 50%;
				right = 0;
				top = 20%;
				bottom = 0%;
				displaycondition = Group==2;
				maintainaspectratio = FALSE;
				xborderdist = 25;
				yborderdist = 20;
				xaxistype = LINEAR;
				yaxistype = LINEAR;
				xleft = 0;
				xright = TimeAuction;
				ybottom = 0;
				ytop = 500;
				movepointertox = 0;
				movepointertoy = 0;
				plotline "1.Dividend"{
					x1 = TimeAuction/expectedDividends;
					y1 = 0;
					x2 = TimeAuction/expectedDividends;
					y2 = 500;
					linecolor = rgb(0.45,0.85,0.85);
					linewidth = 1;
					arrowclosed = FALSE;
				}
				plotline "2.Dividend"{
					x1 = TimeAuction/expectedDividends*2;
					y1 = 0;
					x2 = TimeAuction/expectedDividends*2;
					y2 = 500;
					linecolor = rgb(0.45,0.85,0.85);
					linewidth = 1;
					arrowclosed = FALSE;
				}
				plotline "3.Dividend"{
					x1 = TimeAuction/expectedDividends*3;
					y1 = 0;
					x2 = TimeAuction/expectedDividends*3;
					y2 = 500;
					linecolor = rgb(0.45,0.85,0.85);
					linewidth = 1;
					arrowclosed = FALSE;
				}
				plotline "4.Dividend"{
					x1 = TimeAuction/expectedDividends*4;
					y1 = 0;
					x2 = TimeAuction/expectedDividends*4;
					y2 = 500;
					linecolor = rgb(0.45,0.85,0.85);
					linewidth = 1;
					arrowclosed = FALSE;
				}
				plotline "5.Dividend"{
					x1 = TimeAuction/expectedDividends*5;
					y1 = 0;
					x2 = TimeAuction/expectedDividends*5;
					y2 = 500;
					linecolor = rgb(0.45,0.85,0.85);
					linewidth = 1;
					arrowclosed = FALSE;
				}
				plotline "6.Dividend"{
					x1 = TimeAuction/expectedDividends*6;
					y1 = 0;
					x2 = TimeAuction/expectedDividends*6;
					y2 = 500;
					linecolor = rgb(0.45,0.85,0.85);
					linewidth = 1;
					arrowclosed = FALSE;
				}
				plotline "7.Dividend"{
					x1 = TimeAuction/expectedDividends*7;
					y1 = 0;
					x2 = TimeAuction/expectedDividends*7;
					y2 = 500;
					linecolor = rgb(0.45,0.85,0.85);
					linewidth = 1;
					arrowclosed = FALSE;
				}
				plotline "8.Dividend"{
					x1 = TimeAuction/expectedDividends*8;
					y1 = 0;
					x2 = TimeAuction/expectedDividends*8;
					y2 = 500;
					linecolor = rgb(0.45,0.85,0.85);
					linewidth = 1;
					arrowclosed = FALSE;
				}
				plotline "9.Dividend"{
					x1 = TimeAuction/expectedDividends*9;
					y1 = 0;
					x2 = TimeAuction/expectedDividends*9;
					y2 = 500;
					linecolor = rgb(0.45,0.85,0.85);
					linewidth = 1;
					arrowclosed = FALSE;
				}
				plotline "10.Dividend"{
					x1 = TimeAuction/expectedDividends*10;
					y1 = 0;
					x2 = TimeAuction/expectedDividends*10;
					y2 = 500;
					linecolor = rgb(0.45,0.85,0.85);
					linewidth = 1;
					arrowclosed = FALSE;
				}
				plotline "11.Dividend"{
					x1 = TimeAuction/expectedDividends*11;
					y1 = 0;
					x2 = TimeAuction/expectedDividends*11;
					y2 = 500;
					linecolor = rgb(0.45,0.85,0.85);
					linewidth = 1;
					arrowclosed = FALSE;
				}
				plotline "12.Dividend"{
					x1 = TimeAuction/expectedDividends*12;
					y1 = 0;
					x2 = TimeAuction/expectedDividends*12;
					y2 = 500;
					linecolor = rgb(0.45,0.85,0.85);
					linewidth = 1;
					arrowclosed = FALSE;
				}
				plotline "13.Dividend"{
					x1 = TimeAuction/expectedDividends*13;
					y1 = 0;
					x2 = TimeAuction/expectedDividends*13;
					y2 = 500;
					linecolor = rgb(0.45,0.85,0.85);
					linewidth = 1;
					arrowclosed = FALSE;
				}
				plotline "14.Dividend"{
					x1 = TimeAuction/expectedDividends*14;
					y1 = 0;
					x2 = TimeAuction/expectedDividends*14;
					y2 = 500;
					linecolor = rgb(0.45,0.85,0.85);
					linewidth = 1;
					arrowclosed = FALSE;
				}
				plotline "15.Dividend"{
					x1 = TimeAuction/expectedDividends*15;
					y1 = 0;
					x2 = TimeAuction/expectedDividends*15;
					y2 = 500;
					linecolor = rgb(0.45,0.85,0.85);
					linewidth = 1;
					arrowclosed = FALSE;
				}
				plotgraph "graph"{
					table = prices2;
					condition = TRUE;
					connectioncolor = rgb( .3,.3,0);
					connectionwidth = 1;
					filltoxaxis = FALSE;
					connecttopreviouspoint = FALSE;
					plotpoint "transaction"{
						displaycondition = end!=0 & Group==:Group;
						x = end;
						y = price;
						isstar = TRUE;
						size = 1;
						numedges = 1;
						startat = 45;
						linecolor = rgb(0.00,0.00,0.00);
						linewidth = 1;
						fillcolor = rgb(0.00,0.00,0.00);
					}
					plotpoint "transaction"{
						displaycondition = (Seller==:Subject | Buyer==:Subject) & Group==:Group;
						x = end;
						y = price;
						isstar = TRUE;
						size = 2;
						numedges = 4;
						startat = 45;
						linecolor = rgb(0.00,0.00,0.00);
						linewidth = 1;
					}
					plotpoint ""{
						x = 1;
						y = 0;
						isstar = FALSE;
						size = 0;
						numedges = 4;
						startat = 45;
						linecolor = rgb(0,0,0);
						linewidth = 0;
					}
					plotpoint ""{
						x = 0;
						y = 0;
						isstar = FALSE;
						size = 0;
						numedges = 4;
						startat = 45;
						linecolor = rgb(0,0,0);
						linewidth = 0;
					}
				}
				plotaxis "price"{
					axis = Y;
					from = 0;
					to = 500;
					tickdistance = 10;
					datalabeldistance = 50;
					datalabelformat = 1;
					linecolor = rgb(0.00,0.00,0.00);
					linewidth = 1;
				}
				plotaxis "seconds"{
					axis = X;
					position = 0;
					from = 0;
					to = TimeAuction;
					tickdistance = 100;
					datalabeldistance = 100;
					datalabelformat = 1;
					linecolor = rgb(0.00,0.00,0.00);
					linewidth = 1;
				}
			}
			plotbox "PricePath3"{
				hasframe = TRUE;
				left = 50%;
				right = 0;
				top = 20%;
				bottom = 0%;
				displaycondition = Group==3;
				maintainaspectratio = FALSE;
				xborderdist = 25;
				yborderdist = 20;
				xaxistype = LINEAR;
				yaxistype = LINEAR;
				xleft = 0;
				xright = TimeAuction;
				ybottom = 0;
				ytop = 500;
				movepointertox = 0;
				movepointertoy = 0;
				plotline "1.Dividend"{
					x1 = TimeAuction/expectedDividends;
					y1 = 0;
					x2 = TimeAuction/expectedDividends;
					y2 = 500;
					linecolor = rgb(0.45,0.85,0.85);
					linewidth = 1;
					arrowclosed = FALSE;
				}
				plotline "2.Dividend"{
					x1 = TimeAuction/expectedDividends*2;
					y1 = 0;
					x2 = TimeAuction/expectedDividends*2;
					y2 = 500;
					linecolor = rgb(0.45,0.85,0.85);
					linewidth = 1;
					arrowclosed = FALSE;
				}
				plotline "3.Dividend"{
					x1 = TimeAuction/expectedDividends*3;
					y1 = 0;
					x2 = TimeAuction/expectedDividends*3;
					y2 = 500;
					linecolor = rgb(0.45,0.85,0.85);
					linewidth = 1;
					arrowclosed = FALSE;
				}
				plotline "4.Dividend"{
					x1 = TimeAuction/expectedDividends*4;
					y1 = 0;
					x2 = TimeAuction/expectedDividends*4;
					y2 = 500;
					linecolor = rgb(0.45,0.85,0.85);
					linewidth = 1;
					arrowclosed = FALSE;
				}
				plotline "5.Dividend"{
					x1 = TimeAuction/expectedDividends*5;
					y1 = 0;
					x2 = TimeAuction/expectedDividends*5;
					y2 = 500;
					linecolor = rgb(0.45,0.85,0.85);
					linewidth = 1;
					arrowclosed = FALSE;
				}
				plotline "6.Dividend"{
					x1 = TimeAuction/expectedDividends*6;
					y1 = 0;
					x2 = TimeAuction/expectedDividends*6;
					y2 = 500;
					linecolor = rgb(0.45,0.85,0.85);
					linewidth = 1;
					arrowclosed = FALSE;
				}
				plotline "7.Dividend"{
					x1 = TimeAuction/expectedDividends*7;
					y1 = 0;
					x2 = TimeAuction/expectedDividends*7;
					y2 = 500;
					linecolor = rgb(0.45,0.85,0.85);
					linewidth = 1;
					arrowclosed = FALSE;
				}
				plotline "8.Dividend"{
					x1 = TimeAuction/expectedDividends*8;
					y1 = 0;
					x2 = TimeAuction/expectedDividends*8;
					y2 = 500;
					linecolor = rgb(0.45,0.85,0.85);
					linewidth = 1;
					arrowclosed = FALSE;
				}
				plotline "9.Dividend"{
					x1 = TimeAuction/expectedDividends*9;
					y1 = 0;
					x2 = TimeAuction/expectedDividends*9;
					y2 = 500;
					linecolor = rgb(0.45,0.85,0.85);
					linewidth = 1;
					arrowclosed = FALSE;
				}
				plotline "10.Dividend"{
					x1 = TimeAuction/expectedDividends*10;
					y1 = 0;
					x2 = TimeAuction/expectedDividends*10;
					y2 = 500;
					linecolor = rgb(0.45,0.85,0.85);
					linewidth = 1;
					arrowclosed = FALSE;
				}
				plotline "11.Dividend"{
					x1 = TimeAuction/expectedDividends*11;
					y1 = 0;
					x2 = TimeAuction/expectedDividends*11;
					y2 = 500;
					linecolor = rgb(0.45,0.85,0.85);
					linewidth = 1;
					arrowclosed = FALSE;
				}
				plotline "12.Dividend"{
					x1 = TimeAuction/expectedDividends*12;
					y1 = 0;
					x2 = TimeAuction/expectedDividends*12;
					y2 = 500;
					linecolor = rgb(0.45,0.85,0.85);
					linewidth = 1;
					arrowclosed = FALSE;
				}
				plotline "13.Dividend"{
					x1 = TimeAuction/expectedDividends*13;
					y1 = 0;
					x2 = TimeAuction/expectedDividends*13;
					y2 = 500;
					linecolor = rgb(0.45,0.85,0.85);
					linewidth = 1;
					arrowclosed = FALSE;
				}
				plotline "14.Dividend"{
					x1 = TimeAuction/expectedDividends*14;
					y1 = 0;
					x2 = TimeAuction/expectedDividends*14;
					y2 = 500;
					linecolor = rgb(0.45,0.85,0.85);
					linewidth = 1;
					arrowclosed = FALSE;
				}
				plotline "15.Dividend"{
					x1 = TimeAuction/expectedDividends*15;
					y1 = 0;
					x2 = TimeAuction/expectedDividends*15;
					y2 = 500;
					linecolor = rgb(0.45,0.85,0.85);
					linewidth = 1;
					arrowclosed = FALSE;
				}
				plotgraph "graph"{
					table = prices3;
					condition = TRUE;
					connectioncolor = rgb( .3,.3,0);
					connectionwidth = 1;
					filltoxaxis = FALSE;
					connecttopreviouspoint = FALSE;
					plotpoint "transaction"{
						displaycondition = end!=0 & Group==:Group;
						x = end;
						y = price;
						isstar = TRUE;
						size = 1;
						numedges = 1;
						startat = 45;
						linecolor = rgb(0.00,0.00,0.00);
						linewidth = 1;
						fillcolor = rgb(0.00,0.00,0.00);
					}
					plotpoint "transaction"{
						displaycondition = (Seller==:Subject | Buyer==:Subject) & Group==:Group;
						x = end;
						y = price;
						isstar = TRUE;
						size = 2;
						numedges = 4;
						startat = 45;
						linecolor = rgb(0.00,0.00,0.00);
						linewidth = 1;
					}
					plotpoint ""{
						x = 1;
						y = 0;
						isstar = FALSE;
						size = 0;
						numedges = 4;
						startat = 45;
						linecolor = rgb(0,0,0);
						linewidth = 0;
					}
					plotpoint ""{
						x = 0;
						y = 0;
						isstar = FALSE;
						size = 0;
						numedges = 4;
						startat = 45;
						linecolor = rgb(0,0,0);
						linewidth = 0;
					}
				}
				plotaxis "price"{
					axis = Y;
					from = 0;
					to = 500;
					tickdistance = 10;
					datalabeldistance = 50;
					datalabelformat = 1;
					linecolor = rgb(0.00,0.00,0.00);
					linewidth = 1;
				}
				plotaxis "seconds"{
					axis = X;
					position = 0;
					from = 0;
					to = TimeAuction;
					tickdistance = 100;
					datalabeldistance = 100;
					datalabelformat = 1;
					linecolor = rgb(0.00,0.00,0.00);
					linewidth = 1;
				}
			}
			standardbox "latestPrice"{
				hasframe = FALSE;
				width = 18%;
				left = 53%;
				top = 20%;
				bottom = 75%;
				displaycondition = latestPrice>0;
				buttonposition = BOTTOMRIGHT;
				buttonsequence = HORIZONTAL;
				item{
					label = "Letzter Preis:";
					variable = latestPrice;
					format = "1";
					input = FALSE;
				}
			}
			standardbox "InformationSubject"{
				hasframe = TRUE;
				left = 0%;
				right = 50%;
				top = 0%;
				bottom = 80%;
				buttonposition = BOTTOMRIGHT;
				buttonsequence = HORIZONTAL;
				item{
				}
				item{
					label = "Mein Guthaben:";
					variable = 1;
					format = "<> !text: 1=\"{\\rtf <money|1> ECU    }\"";
					input = FALSE;
				}
				item{
					label = "Meine Aktien:";
					variable = stocks;
					format = "1";
					input = FALSE;
				}
			}
			standardbox "Standard"{
				hasframe = FALSE;
				left = 25%;
				right = 50%;
				bottom = 92%;
				buttonposition = BOTTOMRIGHT;
				buttonsequence = HORIZONTAL;
				item{
					label = "{\\rtf \\fs30 Ich }";
				}
			}
			standardbox "InformationLastTrade"{
				hasframe = FALSE;
				left = 28%;
				right = 50%;
				bottom = 80%;
				displaycondition = wasISeller != -1;
				buttonposition = BOTTOMRIGHT;
				buttonsequence = HORIZONTAL;
				item{
					label = "Ihr letzter Handel:";
				}
				item{
					variable = 1;
					format = "<> !text: 1=\"{\\rtf <wasISeller| !text: 1=\"+ \"  0=\"- \"> <lastTradePrice|1> ECU    }\"";
					input = FALSE;
				}
				item{
					variable = 1;
					format = "<> !text: 1=\"{\\rtf <wasISeller| !text: 1=\"-\" 0=\"+\"> <lastTradeVolume|1> Aktie<lastTradeVolume| !text: 1=\"\" 2=\"n\">     }\"";
					input = FALSE;
				}
			}
			standardbox "InformationDividend"{
				hasframe = FALSE;
				right = 57%;
				top = 16%;
				bottom = 81%;
				displaycondition = payedDividends>0;
				buttonposition = BOTTOMRIGHT;
				buttonsequence = HORIZONTAL;
				item{
					variable = 1;
					format = "<> !text: 1= \"Letzte Dividende: <previousDividend|1> * <previousStocks|1> Aktie<lastTradeVolume| !text: 1=\"\" 2=\"n\"> = <previousDividend*previousStocks|1>      \"";
					input = FALSE;
				}
			}
			containerbox "Trade"{
				hasframe = TRUE;
				right = 50%;
				top = 20%;
				containerbox "Sell assets"{
					hasframe = TRUE;
					left = 0%;
					bottom = 50%;
					standardbox "Standard"{
						hasframe = FALSE;
						left = 45%;
						bottom = 80%;
						buttonposition = BOTTOMRIGHT;
						buttonsequence = HORIZONTAL;
						item{
							label = "{\\rtf \\fs30 Verkaufen}";
						}
					}
					standardbox "Standard"{
						hasframe = TRUE;
						left = 62%;
						top = 70%;
						displaycondition = bestSellPrice<10000;
						buttonposition = BOTTOMRIGHT;
						buttonsequence = HORIZONTAL;
						item{
							label = "Bestes Angebot:";
							variable = bestSellPrice;
							format = "1";
							input = FALSE;
						}
					}
					standardbox "Standard"{
						hasframe = FALSE;
						left = 62%;
						top = 25%;
						bottom = 50%;
						displaycondition = offeredQuantity>0;
						buttonposition = BOTTOMRIGHT;
						buttonsequence = HORIZONTAL;
						item{
							label = "Preis bisher:";
							variable = offeredPrice;
							format = "1";
							input = FALSE;
						}
						item{
							label = "Menge bisher:";
							variable = offeredQuantity;
							format = "1";
							input = FALSE;
						}
					}
					standardbox "Standard"{
						hasframe = FALSE;
						left = 63%;
						top = 25%;
						bottom = 50%;
						displaycondition = offeredQuantity==0;
						buttonposition = BOTTOMRIGHT;
						buttonsequence = HORIZONTAL;
						item{
							label = "Von ihnen liegt kein gltiges Angebot vor";
						}
					}
					makecontractbox "make ask"{
						hasframe = FALSE;
						right = 35%;
						top = 0%;
						table = contracts;
						buttonposition = BOTTOMMIDDLE;
						buttonsequence = VERTICAL;
						emptyallowed = FALSE;
						allemptyallowed = FALSE;
						numrecords = 1;
						tablelayout = VERTICAL;
						item{
							label = "Min. Preis pro Aktie zu dem ich verkaufe:";
							variable = p;
							format = "1";
							input = TRUE;
							showdefault = FALSE;
							emptyallowed = FALSE;
							min = 0;
							max = 9999;
						}
						item{
							label = "Max Menge die ich verkaufe:";
							variable = volume;
							format = "1";
							input = TRUE;
							showdefault = FALSE;
							emptyallowed = FALSE;
							min = 1;
							max = 10000;
						}
						button "Aktie(n) anbieten"{
							clearinputafterok = FALSE;
							norecordmadeorselected = FALSE;
							terminatestage = FALSE;
							donotterminatestage = FALSE;
							specialbuttoncolor = TRUE;
							buttoncolor = 13158600;
							checker{
								condition = stocks >= volume;
								message = "Sie besitzen fr das Angebot nicht gengend Aktien";
								noButtonStr = "OK";
							}
							program{
								table = subjects;
								do{
									\groupConsidered=Group;
									contracts.do
									{if (Seller==:Subject) 
									 {
									  active=0;
									 }
									}
									
								}
							}
							program{
								table = contracts;
								ownervariable = Seller;
								do{
									Seller = :Subject;
									Buyer = -1;
									maker = :Subject;
									Group = :Group;
									\NumberOfContracts = \NumberOfContracts +1;
									traded =0;
									start = time;
									sell=1;
									active=1;
									
									if (p<bestSellPrice)
									{ subjects.do{if(Group==:Group){bestSellPrice=p;}}
									}
									
									subjects.do
									{  if ( :Seller == Subject ) 
									  {offeredPrice = :p;
									   offeredQuantity = :volume;
									  }
									}
								}
							}
							program{
								table = globals;
								condition = TRUE;
								do{
									//MATCH BIDS AND OFFERS
									//make sure that Buyer and Seller are not identical
									
									bestBuyPriceGroup = contracts.maximum(active==1& Seller==-1 & Group == \groupConsidered,p);
									bestSellPriceGroup = contracts.minimum(active==1& Buyer==-1 & Group == \groupConsidered,p);
									
									if(bestBuyPriceGroup>=bestSellPriceGroup)
									{B = contracts.find(p==bestBuyPriceGroup& active==1&Seller==-1& Group == \groupConsidered,Buyer);
									 S = contracts.find(p==bestSellPriceGroup& active==1&Buyer==-1& Group == \groupConsidered,Seller);
									 if (B==S)
									 {if (contracts.maximum(active==1& Seller==-1& Buyer!=B & Group == \groupConsidered,p) >= bestSellPriceGroup) 
									  { B = contracts.find(p==contracts.maximum(active==1& Seller==-1& Buyer!=B& Group == \groupConsidered,p),Buyer);
									  }
									  elsif ( bestBuyPriceGroup>= contracts.minimum(active==1& Buyer==-1& Seller!=S& Group == \groupConsidered,p)) 
									  { S = contracts.find(p==contracts.minimum(active==1& Buyer==-1& Seller!=S& Group == \groupConsidered,p),Seller);
									  }
									  else
									  {B=-1;}
									 }
									 
									 //stocks and money are exchanged and respective contracts deactivated
									 if(B!=-1)
									 {subjects.do{if(Group==groupConsidered) {latestPrice =bestSellPriceGroup;}}
									  volumeTraded = min(contracts.find(Buyer==\B& active==1,volume),  contracts.find(Seller==S& active==1,volume));
									  if(groupConsidered==1)
									  { numTrades=numTrades+1;
									   prices.new
									   {
									    price = bestSellPriceGroup;
									    end=time;
									    Buyer=\B;
									    Seller=\S;
									    id=numTrades;
									    Group=\groupConsidered;
									   }
									  }
									  if(groupConsidered==2)
									  { numTrades2=numTrades2+1;
									   prices2.new
									   {
									    price = bestSellPriceGroup;
									    end=time;
									    Buyer=\B;
									    Seller=\S;
									    id=numTrades2;
									    Group=\groupConsidered;
									   }
									  }
									  if(groupConsidered==3)
									  { numTrades3=numTrades3+1;
									   prices3.new
									   {
									    price = bestSellPriceGroup;
									    end=time;
									    Buyer=\B;
									    Seller=\S;
									    id=numTrades3;
									    Group=\groupConsidered;
									   }
									  }
									  //update contracts
									  contracts.do
									  {if(Buyer==\B& active==1& \bought==0) {traded=1; \bought=1; active=0;Seller=\S; end=time; actualVolume = volumeTraded;}
									   if(Seller==\S& active==1& \sold==0) {traded=1; \sold=1; active=0; Buyer=\B; end=time; actualVolume = volumeTraded;}
									  }
									  bought = 0;
									  sold = 0;
									  
									  //update Buyer/B and Seller/S
									  subjects.do
									  {if (Subject==\B) 
									   {money=money-\volumeTraded*\bestSellPriceGroup; stocks=stocks+\volumeTraded; wantedPrice=0; wantedQuantity=0; 
									    offeredPrice=10000; offeredQuantity =0;wasISeller=0;lastTradePrice = \bestSellPriceGroup; lastTradeVolume=\volumeTraded;
									   }
									   if (Subject==\S) 
									   {money=money+\volumeTraded*\bestSellPriceGroup; stocks=stocks-\volumeTraded; wantedPrice=0; wantedQuantity=0; 
									    offeredPrice=10000; offeredQuantity =0; wasISeller=1;lastTradePrice = \bestSellPriceGroup; lastTradeVolume=\volumeTraded;
									   }
									  }
									  if(\B>18|\S>18)
									  {algotrader.do
									   {if (ID==\B) 
									    {money=money-\volumeTraded*\bestSellPriceGroup; stocks=stocks+\volumeTraded;
									    }
									    if (ID==\S) 
									    {money=money+\volumeTraded*\bestSellPriceGroup; stocks=stocks-\volumeTraded; 
									    }
									   }
									  }
									
									
									  //deactivate all contracts made by Buyer and Seller
									  contracts.do
									  {
									   if (Buyer == \S | Seller == \S | Buyer == \B | Seller== \B){active=0;}
									  } 
									  //find new bestBuyPrice and bestSellPrice and tell subjects
									  subjects.do
									  {if(Group==groupConsidered)
									   {
									    bestBuyPrice = contracts.maximum(active==1& Seller==-1 & Group == \groupConsidered,p);
									    bestSellPrice = contracts.minimum(active==1& Buyer==-1 & Group == \groupConsidered,p);
									   } 
									  }
									 }
									}
									// END OF BLOCK
								}
							}
						}
						button "stornieren"{
							clearinputafterok = FALSE;
							norecordmadeorselected = FALSE;
							terminatestage = FALSE;
							donotterminatestage = FALSE;
							specialbuttoncolor = TRUE;
							buttoncolor = 5921535;
							program{
								table = contracts;
								ownervariable = Seller;
								do{
									end = time;
									start = time;
									
									subjects.do
									{  if ( :Seller == Subject ) 
									  { offeredQuantity = 0;
									  }
									}
								}
							}
							program{
								table = subjects;
								do{
									contracts.do
									{ if (Seller==:Subject) {active=0;}
									}
								}
							}
							program{
								table = subjects;
								do{
									bestBuyPrice = contracts.maximum(active==1& Seller==-1&Group==:Group,p);
									bestSellPrice = contracts.minimum(active==1& Buyer==-1&Group==:Group,p);
									
								}
							}
						}
					}
				}
				containerbox "Buy assets"{
					hasframe = TRUE;
					right = 0%;
					top = 50%;
					standardbox "Standard"{
						hasframe = FALSE;
						left = 45%;
						bottom = 80%;
						buttonposition = BOTTOMRIGHT;
						buttonsequence = HORIZONTAL;
						item{
							label = "{\\rtf \\fs30 Kaufen}";
						}
					}
					standardbox "Standard"{
						hasframe = TRUE;
						left = 62%;
						top = 70%;
						displaycondition = bestBuyPrice>0;
						buttonposition = BOTTOMRIGHT;
						buttonsequence = HORIZONTAL;
						item{
							label = "Bestes Angebot:";
							variable = bestBuyPrice;
							format = "1";
							input = FALSE;
						}
					}
					standardbox "Standard"{
						hasframe = FALSE;
						left = 62%;
						top = 25%;
						bottom = 50%;
						displaycondition = wantedQuantity>0;
						buttonposition = BOTTOMRIGHT;
						buttonsequence = HORIZONTAL;
						item{
							label = "Preis bisher:";
							variable = wantedPrice;
							format = "1";
							input = FALSE;
						}
						item{
							label = "Menge bisher:";
							variable = wantedQuantity;
							format = "1";
							input = FALSE;
						}
					}
					standardbox "Standard"{
						hasframe = FALSE;
						left = 63%;
						top = 25%;
						bottom = 50%;
						displaycondition = wantedQuantity==0;
						buttonposition = BOTTOMRIGHT;
						buttonsequence = HORIZONTAL;
						item{
							label = "Von ihnen liegt kein gltiges Angebot vor";
						}
					}
					makecontractbox "make ask"{
						hasframe = FALSE;
						right = 35%;
						top = 0%;
						table = contracts;
						buttonposition = BOTTOMMIDDLE;
						buttonsequence = HORIZONTAL;
						emptyallowed = FALSE;
						allemptyallowed = FALSE;
						numrecords = 1;
						tablelayout = VERTICAL;
						item{
							label = "Max. Preis pro Aktie zu dem ich kaufe:";
							variable = p;
							format = "1";
							input = TRUE;
							showdefault = FALSE;
							emptyallowed = FALSE;
							min = 0;
							max = 9999;
						}
						item{
							label = "Max Menge die ich kaufe:";
							variable = volume;
							format = "1";
							input = TRUE;
							showdefault = FALSE;
							emptyallowed = FALSE;
							min = 1;
							max = 10000;
						}
						button "    Preis bieten    "{
							clearinputafterok = FALSE;
							norecordmadeorselected = FALSE;
							terminatestage = FALSE;
							donotterminatestage = FALSE;
							specialbuttoncolor = TRUE;
							buttoncolor = 13158600;
							checker{
								condition = p*volume <= money;
								message = "Sie besitzen nicht gengend Kapital fr dieses Angebot.";
								noButtonStr = "OK";
							}
							program{
								table = subjects;
								do{
									\groupConsidered=Group;
									contracts.do
									{if (Buyer==:Subject) 
									 {
									  active=0;
									 }
									}
								}
							}
							program{
								table = contracts;
								ownervariable = Buyer;
								do{
									Seller = -1;
									Buyer = :Subject;
									maker = :Subject;
									Group = :Group;
									\NumberOfContracts = \NumberOfContracts +1;
									traded =0;
									active = 1;
									start = time;
									sell = 0;
									
									if (p>bestBuyPrice)
									{
									 subjects.do{if(Group==:Group){bestBuyPrice = p;}}
									}
									
									subjects.do
									{  if ( :Buyer == Subject ) 
									  { wantedPrice = :p;
									    wantedQuantity = :volume;
									  }
									}
									
								}
							}
							program{
								table = globals;
								condition = TRUE;
								do{
									//MATCH BIDS AND OFFERS
									//make sure that Buyer and Seller are not identical
									
									bestBuyPriceGroup = contracts.maximum(active==1& Seller==-1 & Group == \groupConsidered,p);
									bestSellPriceGroup = contracts.minimum(active==1& Buyer==-1 & Group == \groupConsidered,p);
									
									if(bestBuyPriceGroup>=bestSellPriceGroup)
									{B = contracts.find(p==bestBuyPriceGroup& active==1&Seller==-1& Group == \groupConsidered,Buyer);
									 S = contracts.find(p==bestSellPriceGroup& active==1&Buyer==-1& Group == \groupConsidered,Seller);
									 if (B==S)
									 {if (contracts.maximum(active==1& Seller==-1& Buyer!=B & Group == \groupConsidered,p) >= bestSellPriceGroup) 
									  { B = contracts.find(p==contracts.maximum(active==1& Seller==-1& Buyer!=B& Group == \groupConsidered,p),Buyer);
									  }
									  elsif ( bestBuyPriceGroup>= contracts.minimum(active==1& Buyer==-1& Seller!=S& Group == \groupConsidered,p)) 
									  { S = contracts.find(p==contracts.minimum(active==1& Buyer==-1& Seller!=S& Group == \groupConsidered,p),Seller);
									  }
									  else
									  {B=-1;}
									 }
									 
									 //stocks and money are exchanged and respective contracts deactivated
									 if(B!=-1)
									 {subjects.do{if(Group==groupConsidered) {latestPrice =bestSellPriceGroup;}}
									  volumeTraded = min(contracts.find(Buyer==\B& active==1,volume),  contracts.find(Seller==S& active==1,volume));
									  if(groupConsidered==1)
									  { numTrades=numTrades+1;
									   prices.new
									   {
									    price = bestSellPriceGroup;
									    end=time;
									    Buyer=\B;
									    Seller=\S;
									    id=numTrades;
									    Group=\groupConsidered;
									   }
									  }
									  if(groupConsidered==2)
									  { numTrades2=numTrades2+1;
									   prices2.new
									   {
									    price = bestSellPriceGroup;
									    end=time;
									    Buyer=\B;
									    Seller=\S;
									    id=numTrades2;
									    Group=\groupConsidered;
									   }
									  }
									  if(groupConsidered==3)
									  { numTrades3=numTrades3+1;
									   prices3.new
									   {
									    price = bestSellPriceGroup;
									    end=time;
									    Buyer=\B;
									    Seller=\S;
									    id=numTrades3;
									    Group=\groupConsidered;
									   }
									  }
									  //update contracts
									  contracts.do
									  {if(Buyer==\B& active==1& \bought==0) {traded=1; \bought=1; active=0;Seller=\S; end=time; actualVolume = volumeTraded;}
									   if(Seller==\S& active==1& \sold==0) {traded=1; \sold=1; active=0; Buyer=\B; end=time; actualVolume = volumeTraded;}
									  }
									  bought = 0;
									  sold = 0;
									  
									  //update Buyer/B and Seller/S
									  subjects.do
									  {if (Subject==\B) 
									   {money=money-\volumeTraded*\bestSellPriceGroup; stocks=stocks+\volumeTraded; wantedPrice=0; wantedQuantity=0; 
									    offeredPrice=10000; offeredQuantity =0;wasISeller=0;lastTradePrice = \bestSellPriceGroup; lastTradeVolume=\volumeTraded;
									   }
									   if (Subject==\S) 
									   {money=money+\volumeTraded*\bestSellPriceGroup; stocks=stocks-\volumeTraded; wantedPrice=0; wantedQuantity=0; 
									    offeredPrice=10000; offeredQuantity =0; wasISeller=1;lastTradePrice = \bestSellPriceGroup; lastTradeVolume=\volumeTraded;
									   }
									  }
									  if(\B>18|\S>18)
									  {algotrader.do
									   {if (ID==\B) 
									    {money=money-\volumeTraded*\bestSellPriceGroup; stocks=stocks+\volumeTraded;
									    }
									    if (ID==\S) 
									    {money=money+\volumeTraded*\bestSellPriceGroup; stocks=stocks-\volumeTraded; 
									    }
									   }
									  }
									
									
									  //deactivate all contracts made by Buyer and Seller
									  contracts.do
									  {
									   if (Buyer == \S | Seller == \S | Buyer == \B | Seller== \B){active=0;}
									  } 
									  //find new bestBuyPrice and bestSellPrice and tell subjects
									  subjects.do
									  {if(Group==groupConsidered)
									   {
									    bestBuyPrice = contracts.maximum(active==1& Seller==-1 & Group == \groupConsidered,p);
									    bestSellPrice = contracts.minimum(active==1& Buyer==-1 & Group == \groupConsidered,p);
									   } 
									  }
									 }
									}
									// END OF BLOCK
								}
							}
						}
						button "stornieren"{
							clearinputafterok = FALSE;
							norecordmadeorselected = FALSE;
							terminatestage = FALSE;
							donotterminatestage = FALSE;
							specialbuttoncolor = TRUE;
							buttoncolor = 5921535;
							program{
								table = contracts;
								ownervariable = Buyer;
								do{
									end = time;
									start = time;
									
									subjects.do
									{  if ( :Buyer == Subject ) 
									  { wantedQuantity = 0;
									  }
									}
								}
							}
							program{
								table = subjects;
								do{
									contracts.do
									{ if (Buyer==:Subject) {active=0;}
									}
								}
							}
							program{
								table = subjects;
								do{
									bestBuyPrice = contracts.maximum(active==1& Seller==-1&Group==:Group,p);
									bestSellPrice = contracts.minimum(active==1& Buyer==-1&Group==:Group,p);
									
								}
							}
						}
					}
				}
			}
		}
		screen wait{
			usesbg = TRUE;
			withalertscreen = FALSE;
			noalertscreen = FALSE;
		}
	}
	stage "EndTrading"{
		startwaitforall = TRUE;
		singleentry = FALSE;
		singleentrycontinuation = FALSE;
		timeouttype = always;
		timeout = 30;
		program{
			table = globals;
			do{
				// PAYING DIVIDENDS
				r = random();
				previousDividend = if (\r>0.75, 0, if (\r>0.5, 8, if (\r> 0.25, 28, 60)));
				subjects.do
				{money = money+ stocks*previousDividend;
				}
			}
		}
		program{
			table = subjects;
			do{
				Participate=if(Period==expectedDividends|Period==expectedDividends*2,1,0);
			}
		}
		program{
			table = subjects;
			condition = Period==expectedDividends;
			do{
				profitFirstTrading=money;
			}
		}
		screen action{
			usesbg = TRUE;
			withalertscreen = FALSE;
			noalertscreen = FALSE;
			standardbox "Standard"{
				hasframe = FALSE;
				left = 10%;
				right = 10%;
				top = 20%;
				bottom = 40%;
				displaycondition = Period==expectedDividends;
				buttonposition = BOTTOMRIGHT;
				buttonsequence = HORIZONTAL;
				item{
					label = "<>Das war die erste Runde des Marktexperimentes. Die letzte Dividende pro Aktie war  <previousDividend|1>.\r\nIhr Gesamtguthaben fr die erste Runde betrgt daher <money|1> ECU.\r\n\r\nDieses Guthaben wurde gespeichert. Gleich startet der 2. Durchgang. Sie beginnen erneut mit 720 ECU und 4 Aktien.";
				}
			}
			standardbox "Standard"{
				hasframe = FALSE;
				left = 10%;
				right = 10%;
				top = 20%;
				bottom = 40%;
				displaycondition = Period==expectedDividends*2;
				buttonposition = BOTTOMRIGHT;
				buttonsequence = HORIZONTAL;
				item{
					label = "<>Das war die zweite und letzte Runde. \r\nDie letzte Dividende pro Aktie war  <previousDividend|1>.\r\nIhr Gesamtguthaben fr die zweite Runde betrgt daher <money|1> ECU.\r\nDieses Guthaben wurde gespeichert. \r\n\r\nKlicken Sie auf \"weiter\" um zu sehen wie hoch Ihre Auszahlung fr das gesamte Experiment ist.\r\n";
				}
			}
			standardbox "Buttonbox"{
				hasframe = FALSE;
				top = 90%;
				bottom = 0%;
				cutbottom = TRUE;
				displaycondition = Period==expectedDividends*2;
				buttonposition = BOTTOMRIGHT;
				buttonsequence = HORIZONTAL;
				button "Weiter"{
					clearinputafterok = FALSE;
					norecordmadeorselected = FALSE;
					terminatestage = TRUE;
					donotterminatestage = FALSE;
					specialbuttoncolor = TRUE;
					buttoncolor = 5921535;
				}
			}
		}
		screen wait{
			usesbg = TRUE;
			withalertscreen = FALSE;
			noalertscreen = FALSE;
		}
	}
	stage "ShowPayoff"{
		startwaitforall = TRUE;
		singleentry = FALSE;
		singleentrycontinuation = FALSE;
		timeouttype = always;
		timeout = 120;
		program{
			table = subjects;
			do{
				Participate=if(Period==(expectedDividends*2),1,0);
			}
		}
		program{
			table = subjects;
			condition = Period==(expectedDividends*2);
			do{
				r=random();
				taskPayed=session.find(same(Subject),Task);
				// payoff for Trading (one of two marketsimulations)
				if(taskPayed==3) 
				{
				 Profit = if(r<0.5,profitFirstTrading,money);
				 taskPayed=if(r<0.5,3,4);
				}
				else
				{
				 profitFirstTreatment=session.find(same(Subject), FinalProfit);
				}
			}
		}
		screen action{
			usesbg = TRUE;
			withalertscreen = FALSE;
			noalertscreen = FALSE;
			standardbox "RiskPayed"{
				hasframe = FALSE;
				left = 10%;
				right = 10%;
				top = 20%;
				bottom = 40%;
				displaycondition = taskPayed==1;
				buttonposition = BOTTOMRIGHT;
				buttonsequence = HORIZONTAL;
				item{
					label = "{\\rtf\\fs24\\ql Der Zufallsgenerator hat ergeben, dass eine der ersten 10 Lotterien die Sie gespielt haben fr Sie ausgezahlt wird. \r\n\\par\r\nFr die zufllig ausgewhlten Lotterie erhalten Sie in Euro:\r\n}";
					variable = profitFirstTreatment;
					format = "0.1";
					input = FALSE;
				}
			}
			standardbox "LossAversionPayed"{
				hasframe = FALSE;
				left = 10%;
				right = 10%;
				top = 20%;
				bottom = 40%;
				displaycondition = taskPayed==2;
				buttonposition = BOTTOMRIGHT;
				buttonsequence = HORIZONTAL;
				item{
					label = "{\\rtf\\fs24\\ql Der Zufallsgenerator hat ergeben, dass eine der 6 Lotterien (die Sie in der zweiten Aufgabe gespielt haben) fr Sie ausgezahlt wird. Haben Sie die entsprechende Lotterie angenommen, ist es mglich, dass Ihre Auszahlung relativ niedrig, aber auch hoch ausfllt.\r\n\\par\r\nFr die zufllig ausgewhlten Lotterie erhalten Sie in Euro:\r\n}";
					variable = profitFirstTreatment;
					format = "0.1";
					input = FALSE;
				}
			}
			standardbox "FirstTradingPayed"{
				hasframe = FALSE;
				left = 10%;
				right = 10%;
				top = 20%;
				bottom = 40%;
				displaycondition = taskPayed==3;
				buttonposition = BOTTOMRIGHT;
				buttonsequence = HORIZONTAL;
				item{
					label = "{\\rtf\\fs24\\ql Der Zufallsgenerator hat ergeben, dass das erste Marktexperiment fr Sie ausgezahlt wird. Der entsprechende Betrag wird Ihnen umgerechnet in Euro ausgezahlt.\r\n\\par\r\nAm Ende dieses Marktexperimentes hatten Sie in ECU: \r\n}";
					variable = Profit;
					format = "1";
					input = FALSE;
				}
			}
			standardbox "SecondTradingPayed"{
				hasframe = FALSE;
				left = 10%;
				right = 10%;
				top = 20%;
				bottom = 40%;
				displaycondition = taskPayed==4;
				buttonposition = BOTTOMRIGHT;
				buttonsequence = HORIZONTAL;
				item{
					label = "{\\rtf\\fs24\\ql Der Zufallsgenerator hat ergeben, dass das zweite Marktexperiment fr Sie ausgezahlt wird. Der entsprechende Betrag wird Ihnen umgerechnet in Euro ausgezahlt.\r\n\\par\r\nAm Ende dieses Marktexperimentes hatten Sie in ECU: \r\n}";
					variable = Profit;
					format = "1";
					input = FALSE;
				}
			}
			standardbox "Buttonbox"{
				hasframe = FALSE;
				top = 90%;
				bottom = 0%;
				cutbottom = TRUE;
				buttonposition = BOTTOMRIGHT;
				buttonsequence = HORIZONTAL;
				button "Weiter"{
					clearinputafterok = FALSE;
					norecordmadeorselected = FALSE;
					terminatestage = TRUE;
					donotterminatestage = FALSE;
					specialbuttoncolor = TRUE;
					buttoncolor = 5921535;
				}
			}
		}
		screen wait{
			usesbg = TRUE;
			withalertscreen = FALSE;
			noalertscreen = FALSE;
			standardbox "Text"{
				hasframe = TRUE;
				buttonposition = BOTTOMRIGHT;
				buttonsequence = HORIZONTAL;
				item{
					label = "Bitte warten Sie, bis der abschlieende Fragebogen gestartet wird.";
				}
			}
		}
	}
	roles{
		role "S 1"{
		}
		role "S 2"{
		}
		role "S 3"{
		}
		role "S 4"{
		}
		role "S 5"{
		}
		role "S 6"{
		}
		role "S 7"{
		}
		role "S 8"{
		}
		role "S 9"{
		}
		role "S 10"{
		}
		role "S 11"{
		}
		role "S 12"{
		}
	}
	period "1"{
		subject 1{
			group = 1;
		}
		subject 2{
			group = 1;
		}
		subject 3{
			group = 1;
		}
		subject 4{
			group = 1;
		}
		subject 5{
			group = 1;
		}
		subject 6{
			group = 1;
		}
		subject 7{
			group = 2;
		}
		subject 8{
			group = 2;
		}
		subject 9{
			group = 2;
		}
		subject 10{
			group = 2;
		}
		subject 11{
			group = 2;
		}
		subject 12{
			group = 2;
		}
	}
	period "2"{
		subject 1{
			group = 1;
		}
		subject 2{
			group = 1;
		}
		subject 3{
			group = 1;
		}
		subject 4{
			group = 1;
		}
		subject 5{
			group = 1;
		}
		subject 6{
			group = 1;
		}
		subject 7{
			group = 2;
		}
		subject 8{
			group = 2;
		}
		subject 9{
			group = 2;
		}
		subject 10{
			group = 2;
		}
		subject 11{
			group = 2;
		}
		subject 12{
			group = 2;
		}
	}
	period "3"{
		subject 1{
			group = 1;
		}
		subject 2{
			group = 1;
		}
		subject 3{
			group = 1;
		}
		subject 4{
			group = 1;
		}
		subject 5{
			group = 1;
		}
		subject 6{
			group = 1;
		}
		subject 7{
			group = 2;
		}
		subject 8{
			group = 2;
		}
		subject 9{
			group = 2;
		}
		subject 10{
			group = 2;
		}
		subject 11{
			group = 2;
		}
		subject 12{
			group = 2;
		}
	}
	period "4"{
		subject 1{
			group = 1;
		}
		subject 2{
			group = 1;
		}
		subject 3{
			group = 1;
		}
		subject 4{
			group = 1;
		}
		subject 5{
			group = 1;
		}
		subject 6{
			group = 1;
		}
		subject 7{
			group = 2;
		}
		subject 8{
			group = 2;
		}
		subject 9{
			group = 2;
		}
		subject 10{
			group = 2;
		}
		subject 11{
			group = 2;
		}
		subject 12{
			group = 2;
		}
	}
	period "5"{
		subject 1{
			group = 1;
		}
		subject 2{
			group = 1;
		}
		subject 3{
			group = 1;
		}
		subject 4{
			group = 1;
		}
		subject 5{
			group = 1;
		}
		subject 6{
			group = 1;
		}
		subject 7{
			group = 2;
		}
		subject 8{
			group = 2;
		}
		subject 9{
			group = 2;
		}
		subject 10{
			group = 2;
		}
		subject 11{
			group = 2;
		}
		subject 12{
			group = 2;
		}
	}
	period "6"{
		subject 1{
			group = 1;
		}
		subject 2{
			group = 1;
		}
		subject 3{
			group = 1;
		}
		subject 4{
			group = 1;
		}
		subject 5{
			group = 1;
		}
		subject 6{
			group = 1;
		}
		subject 7{
			group = 2;
		}
		subject 8{
			group = 2;
		}
		subject 9{
			group = 2;
		}
		subject 10{
			group = 2;
		}
		subject 11{
			group = 2;
		}
		subject 12{
			group = 2;
		}
	}
	period "7"{
		subject 1{
			group = 1;
		}
		subject 2{
			group = 1;
		}
		subject 3{
			group = 1;
		}
		subject 4{
			group = 1;
		}
		subject 5{
			group = 1;
		}
		subject 6{
			group = 1;
		}
		subject 7{
			group = 2;
		}
		subject 8{
			group = 2;
		}
		subject 9{
			group = 2;
		}
		subject 10{
			group = 2;
		}
		subject 11{
			group = 2;
		}
		subject 12{
			group = 2;
		}
	}
	period "8"{
		subject 1{
			group = 1;
		}
		subject 2{
			group = 1;
		}
		subject 3{
			group = 1;
		}
		subject 4{
			group = 1;
		}
		subject 5{
			group = 1;
		}
		subject 6{
			group = 1;
		}
		subject 7{
			group = 2;
		}
		subject 8{
			group = 2;
		}
		subject 9{
			group = 2;
		}
		subject 10{
			group = 2;
		}
		subject 11{
			group = 2;
		}
		subject 12{
			group = 2;
		}
	}
	period "9"{
		subject 1{
			group = 1;
		}
		subject 2{
			group = 1;
		}
		subject 3{
			group = 1;
		}
		subject 4{
			group = 1;
		}
		subject 5{
			group = 1;
		}
		subject 6{
			group = 1;
		}
		subject 7{
			group = 2;
		}
		subject 8{
			group = 2;
		}
		subject 9{
			group = 2;
		}
		subject 10{
			group = 2;
		}
		subject 11{
			group = 2;
		}
		subject 12{
			group = 2;
		}
	}
	period "10"{
		subject 1{
			group = 1;
		}
		subject 2{
			group = 1;
		}
		subject 3{
			group = 1;
		}
		subject 4{
			group = 1;
		}
		subject 5{
			group = 1;
		}
		subject 6{
			group = 1;
		}
		subject 7{
			group = 2;
		}
		subject 8{
			group = 2;
		}
		subject 9{
			group = 2;
		}
		subject 10{
			group = 2;
		}
		subject 11{
			group = 2;
		}
		subject 12{
			group = 2;
		}
	}
	period "11"{
		subject 1{
			group = 1;
		}
		subject 2{
			group = 1;
		}
		subject 3{
			group = 1;
		}
		subject 4{
			group = 1;
		}
		subject 5{
			group = 1;
		}
		subject 6{
			group = 1;
		}
		subject 7{
			group = 2;
		}
		subject 8{
			group = 2;
		}
		subject 9{
			group = 2;
		}
		subject 10{
			group = 2;
		}
		subject 11{
			group = 2;
		}
		subject 12{
			group = 2;
		}
	}
	period "12"{
		subject 1{
			group = 1;
		}
		subject 2{
			group = 1;
		}
		subject 3{
			group = 1;
		}
		subject 4{
			group = 1;
		}
		subject 5{
			group = 1;
		}
		subject 6{
			group = 1;
		}
		subject 7{
			group = 2;
		}
		subject 8{
			group = 2;
		}
		subject 9{
			group = 2;
		}
		subject 10{
			group = 2;
		}
		subject 11{
			group = 2;
		}
		subject 12{
			group = 2;
		}
	}
	period "13"{
		subject 1{
			group = 1;
		}
		subject 2{
			group = 1;
		}
		subject 3{
			group = 1;
		}
		subject 4{
			group = 1;
		}
		subject 5{
			group = 1;
		}
		subject 6{
			group = 1;
		}
		subject 7{
			group = 2;
		}
		subject 8{
			group = 2;
		}
		subject 9{
			group = 2;
		}
		subject 10{
			group = 2;
		}
		subject 11{
			group = 2;
		}
		subject 12{
			group = 2;
		}
	}
	period "14"{
		subject 1{
			group = 1;
		}
		subject 2{
			group = 1;
		}
		subject 3{
			group = 1;
		}
		subject 4{
			group = 1;
		}
		subject 5{
			group = 1;
		}
		subject 6{
			group = 1;
		}
		subject 7{
			group = 2;
		}
		subject 8{
			group = 2;
		}
		subject 9{
			group = 2;
		}
		subject 10{
			group = 2;
		}
		subject 11{
			group = 2;
		}
		subject 12{
			group = 2;
		}
	}
	period "15"{
		subject 1{
			group = 1;
		}
		subject 2{
			group = 1;
		}
		subject 3{
			group = 1;
		}
		subject 4{
			group = 1;
		}
		subject 5{
			group = 1;
		}
		subject 6{
			group = 1;
		}
		subject 7{
			group = 2;
		}
		subject 8{
			group = 2;
		}
		subject 9{
			group = 2;
		}
		subject 10{
			group = 2;
		}
		subject 11{
			group = 2;
		}
		subject 12{
			group = 2;
		}
	}
	period "16"{
		subject 1{
			group = 1;
		}
		subject 2{
			group = 1;
		}
		subject 3{
			group = 1;
		}
		subject 4{
			group = 1;
		}
		subject 5{
			group = 1;
		}
		subject 6{
			group = 1;
		}
		subject 7{
			group = 2;
		}
		subject 8{
			group = 2;
		}
		subject 9{
			group = 2;
		}
		subject 10{
			group = 2;
		}
		subject 11{
			group = 2;
		}
		subject 12{
			group = 2;
		}
	}
	period "17"{
		subject 1{
			group = 1;
		}
		subject 2{
			group = 1;
		}
		subject 3{
			group = 1;
		}
		subject 4{
			group = 1;
		}
		subject 5{
			group = 1;
		}
		subject 6{
			group = 1;
		}
		subject 7{
			group = 2;
		}
		subject 8{
			group = 2;
		}
		subject 9{
			group = 2;
		}
		subject 10{
			group = 2;
		}
		subject 11{
			group = 2;
		}
		subject 12{
			group = 2;
		}
	}
	period "18"{
		subject 1{
			group = 1;
		}
		subject 2{
			group = 1;
		}
		subject 3{
			group = 1;
		}
		subject 4{
			group = 1;
		}
		subject 5{
			group = 1;
		}
		subject 6{
			group = 1;
		}
		subject 7{
			group = 2;
		}
		subject 8{
			group = 2;
		}
		subject 9{
			group = 2;
		}
		subject 10{
			group = 2;
		}
		subject 11{
			group = 2;
		}
		subject 12{
			group = 2;
		}
	}
	period "19"{
		subject 1{
			group = 1;
		}
		subject 2{
			group = 1;
		}
		subject 3{
			group = 1;
		}
		subject 4{
			group = 1;
		}
		subject 5{
			group = 1;
		}
		subject 6{
			group = 1;
		}
		subject 7{
			group = 2;
		}
		subject 8{
			group = 2;
		}
		subject 9{
			group = 2;
		}
		subject 10{
			group = 2;
		}
		subject 11{
			group = 2;
		}
		subject 12{
			group = 2;
		}
	}
	period "20"{
		subject 1{
			group = 1;
		}
		subject 2{
			group = 1;
		}
		subject 3{
			group = 1;
		}
		subject 4{
			group = 1;
		}
		subject 5{
			group = 1;
		}
		subject 6{
			group = 1;
		}
		subject 7{
			group = 2;
		}
		subject 8{
			group = 2;
		}
		subject 9{
			group = 2;
		}
		subject 10{
			group = 2;
		}
		subject 11{
			group = 2;
		}
		subject 12{
			group = 2;
		}
	}
	period "21"{
		subject 1{
			group = 1;
		}
		subject 2{
			group = 1;
		}
		subject 3{
			group = 1;
		}
		subject 4{
			group = 1;
		}
		subject 5{
			group = 1;
		}
		subject 6{
			group = 1;
		}
		subject 7{
			group = 2;
		}
		subject 8{
			group = 2;
		}
		subject 9{
			group = 2;
		}
		subject 10{
			group = 2;
		}
		subject 11{
			group = 2;
		}
		subject 12{
			group = 2;
		}
	}
	period "22"{
		subject 1{
			group = 1;
		}
		subject 2{
			group = 1;
		}
		subject 3{
			group = 1;
		}
		subject 4{
			group = 1;
		}
		subject 5{
			group = 1;
		}
		subject 6{
			group = 1;
		}
		subject 7{
			group = 2;
		}
		subject 8{
			group = 2;
		}
		subject 9{
			group = 2;
		}
		subject 10{
			group = 2;
		}
		subject 11{
			group = 2;
		}
		subject 12{
			group = 2;
		}
	}
	period "23"{
		subject 1{
			group = 1;
		}
		subject 2{
			group = 1;
		}
		subject 3{
			group = 1;
		}
		subject 4{
			group = 1;
		}
		subject 5{
			group = 1;
		}
		subject 6{
			group = 1;
		}
		subject 7{
			group = 2;
		}
		subject 8{
			group = 2;
		}
		subject 9{
			group = 2;
		}
		subject 10{
			group = 2;
		}
		subject 11{
			group = 2;
		}
		subject 12{
			group = 2;
		}
	}
	period "24"{
		subject 1{
			group = 1;
		}
		subject 2{
			group = 1;
		}
		subject 3{
			group = 1;
		}
		subject 4{
			group = 1;
		}
		subject 5{
			group = 1;
		}
		subject 6{
			group = 1;
		}
		subject 7{
			group = 2;
		}
		subject 8{
			group = 2;
		}
		subject 9{
			group = 2;
		}
		subject 10{
			group = 2;
		}
		subject 11{
			group = 2;
		}
		subject 12{
			group = 2;
		}
	}
	period "25"{
		subject 1{
			group = 1;
		}
		subject 2{
			group = 1;
		}
		subject 3{
			group = 1;
		}
		subject 4{
			group = 1;
		}
		subject 5{
			group = 1;
		}
		subject 6{
			group = 1;
		}
		subject 7{
			group = 2;
		}
		subject 8{
			group = 2;
		}
		subject 9{
			group = 2;
		}
		subject 10{
			group = 2;
		}
		subject 11{
			group = 2;
		}
		subject 12{
			group = 2;
		}
	}
	period "26"{
		subject 1{
			group = 1;
		}
		subject 2{
			group = 1;
		}
		subject 3{
			group = 1;
		}
		subject 4{
			group = 1;
		}
		subject 5{
			group = 1;
		}
		subject 6{
			group = 1;
		}
		subject 7{
			group = 2;
		}
		subject 8{
			group = 2;
		}
		subject 9{
			group = 2;
		}
		subject 10{
			group = 2;
		}
		subject 11{
			group = 2;
		}
		subject 12{
			group = 2;
		}
	}
	period "27"{
		subject 1{
			group = 1;
		}
		subject 2{
			group = 1;
		}
		subject 3{
			group = 1;
		}
		subject 4{
			group = 1;
		}
		subject 5{
			group = 1;
		}
		subject 6{
			group = 1;
		}
		subject 7{
			group = 2;
		}
		subject 8{
			group = 2;
		}
		subject 9{
			group = 2;
		}
		subject 10{
			group = 2;
		}
		subject 11{
			group = 2;
		}
		subject 12{
			group = 2;
		}
	}
	period "28"{
		subject 1{
			group = 1;
		}
		subject 2{
			group = 1;
		}
		subject 3{
			group = 1;
		}
		subject 4{
			group = 1;
		}
		subject 5{
			group = 1;
		}
		subject 6{
			group = 1;
		}
		subject 7{
			group = 2;
		}
		subject 8{
			group = 2;
		}
		subject 9{
			group = 2;
		}
		subject 10{
			group = 2;
		}
		subject 11{
			group = 2;
		}
		subject 12{
			group = 2;
		}
	}
	period "29"{
		subject 1{
			group = 1;
		}
		subject 2{
			group = 1;
		}
		subject 3{
			group = 1;
		}
		subject 4{
			group = 1;
		}
		subject 5{
			group = 1;
		}
		subject 6{
			group = 1;
		}
		subject 7{
			group = 2;
		}
		subject 8{
			group = 2;
		}
		subject 9{
			group = 2;
		}
		subject 10{
			group = 2;
		}
		subject 11{
			group = 2;
		}
		subject 12{
			group = 2;
		}
	}
	period "30"{
		subject 1{
			group = 1;
		}
		subject 2{
			group = 1;
		}
		subject 3{
			group = 1;
		}
		subject 4{
			group = 1;
		}
		subject 5{
			group = 1;
		}
		subject 6{
			group = 1;
		}
		subject 7{
			group = 2;
		}
		subject 8{
			group = 2;
		}
		subject 9{
			group = 2;
		}
		subject 10{
			group = 2;
		}
		subject 11{
			group = 2;
		}
		subject 12{
			group = 2;
		}
	}
}