M TimeSpan =15
V Next Timespan = if(OR(mod(simstep,15)=14, mod(simstep,15)=0), 15,5)
M StartTime = 0
M EndTime = 90
M InitialSteps=0
M TimeFormat = "回合#0"
M NumberFormat = "#,##0.##"
V myStep=SimStep
V NOTR=15
V NR=15
V TimeLeft=NOTR-mod(SimStep,NOTR)
V base = 0.5
V UpperInc = 1
V minCr0 = if(base+0.5*base*round(randbetween(0,UpperInc))1 & v0>=previous(price3)+minCR0 & previous(winner0)=0, previous(price3)+minCR0,NA)
V bid1=if(mod(simStep,15)>1 & v1>=previous(price3)+minCR1 & previous(winner1)=0, previous(price3)+minCR1,NA)
V bid2=if(mod(simStep,15)>1 & v2>=previous(price3)+minCR2 & previous(winner2)=0, previous(price3)+minCR2,NA)
V f_bid0=if(OR(bid0=na,bid0=none),-999,bid0)
V f_bid1=if(OR(bid1=na,bid1=none),-999,bid1)
V f_bid2=if(OR(bid2=na,bid2=none),-999,bid2)
V bidHistory=if(mod(SIMSTEP,15)=0,0,if(f_bid0=-999 & f_bid1=-999,previous(bidHistory),previous(bidHistory)+1))
p bidHistory.Label="出價次數"
V price1 = if(price3>=BIN_selected, if(previous(End1)=0 & End1=1, BIN_selected,NA), 0)
V price2 = if(OR(previous(Bestoffer)>=BIN_selected,price3>=BIN_selected), if(previous(End2)=0,BIN_selected,NA), previous(Bestoffer)*BestOfferAccept)
V BestOffer=if(formatSelected=2 & mod(simStep,15)>1, if(End2=1,NA,max(bid0,bid1,bid2)),NA)
V price3 =if(mod(SimStep,15)=0 & simStep=0,0,max(if(mod(SimStep,15)=1,minP,previous(price3)),bid0,bid1,bid2))
V price4 =if(mod(SimStep,15)>1,if(max(previous(price3),bid0,bid1,bid2)>=BIN_selected,BIN_selected,max(previous(price3),bid0,bid1,bid2)),minP)
V Price =if(formatSelected=1,Price1,if(formatSelected=2,price2,if(formatSelected=3,price3,price4)))
V SoldPrice=if(mod(simStep,15)=0,0,if(price>0,price,previous(soldPrice,0)))
P SoldPrice.label="成交價"
P BIN_selected.label="你設定的直接購買 BIN"
P BestOffer.label="此次賣方出價"
P myReward.label="當期獲利"
P acc_Reward.label="累計獲利"
V secondP=if(formatSelected>2,if(mod(SIMSTEP,15)previous(price),previous(price),previous(secondP))),price)
V winner0=if(mod(SIMSTEP,15)=0,0,if(max(f_bid1,f_bid2)1 & formatSelected=1,if(price3>=BIN_Selected,1,0),0)
V End2=if(mod(simStep,15)>2 & formatSelected=2,if(OR(price3>=BIN_selected,BestOfferAccept=1),1,previous(End2,0)),if(mod(simStep,15)=0 & formatSelected=2, BestofferAccept,0))
V End3=0
V End4 = if(mod(simStep,15)>1 & formatSelected=4 & price>=BIN_selected,1,0)
V Listfee = 0
V Comissionfee=0
V myCost=0
V myReward =if(OR(formatSelected=3,formatselected = 4 & price2,mod(simStep,15)=0),previous(BIN_selected,0),NA))
D BestOfferAccept=if(mod(simStep,15)>1 & formatSelected=2 & End2=0,{0,1},NA)
P BestOfferAccept.desc = {"拒絕","接受"}
P BestOfferAccept.label="接受此出價嗎?"
T Table 1 =if(formatSelected =1, {"soldPrice","BIN_selected","BestOffer","myReward","acc_Reward"},{"soldPrice","Price","BIN_selected","BestOffer","BestOfferAccept","bidHistory","myReward","acc_Reward"})
T Table 1.color = {"#CCCCCC", "#FFFFFF"}
T Table 1.Label = "Table 1. 拍賣紀錄"
M TextInformation =if(OR(End1=1,End2=1),"eBay.End.htm",if(formatselected=1, "eBay.format1.htm",if(formatselected=2,"eBay.format2.htm",if(formatselected=3,"eBay.format3.htm","eBay.format4.htm"))))
M TextInformation.Label = "拍賣主頁"