Detta script används av PC-LINK för efterföljande testkonton som fungerar som virtuella portföljer vilket då ger kontroll över enskilda trades.
Slave testkonto 02-19
startstorage:=6000
object_num_fields:=2
testaccount:=2
steps_pct:=0.05
minmoney:=500
rsi_max:=35
pclinkid:=28
prevstorage=add(startstorage,mult(sub(testaccount,1),500))
nextstorage=add(startstorage,mult(sub(testaccount,0),500))
rsi_test=sub(rsi_max,mult(2,testaccount))
quarantine_days=add(1,0)
relative_pct=sub(1,mult(steps_pct,testaccount))
nextdatecell=scrpar(pclinkid)
storagenextcell=add(mult(nextdatecell,object_num_fields),prevstorage)
cell_date=add(storagenextcell,1)
cell_kurs=add(storagenextcell,0)
lastpay=lasttrade(b,p)
lastdate=lasttrade(b,d)
pengar=gt(cash(t),minmoney)
har_ej_innehav=eqv(portfolio(v),0)
har_innehav=gt(portfolio(v),0)
prevdate=scrpar(pclinkid)
storageprev=add(mult(prevdate,object_num_fields),prevstorage)
now=date()
today=int(now)
buy_day=int(getgvar(cell_date))
days_since_last=sub(today,buy_day)
quarantine_released=and(gt(buy_day,0),ge(days_since_last,quarantine_days))
rsi_current=rsiws(14)
rsi_a0=LT(aref(rsiws(14),1),rsi_max)
rsi_b0=LT(aref(rsiws(14),2),rsi_max)
rsi_c0=LT(aref(rsiws(14),3),rsi_max)
rsi_threedays=mult(mult(rsi_a0,rsi_b0),rsi_c0)
rsi_ok=and(rsi_threedays,lt(rsi_current,rsi_max))
cell_start_kurs=add(add(mult(nextdatecell,object_num_fields),startstorage),0)
value_start_buy=getgvar(cell_start_kurs)
value_pct=mult(value_start_buy,relative_pct)
lower_index=lt(c,cmpref(c,1,a))
{ signal=and(lower_index,and(quarantine_released,and(pengar,and(har_ej_innehav,lt(c,value_pct))))) }
signal=and(and(lower_index,and(quarantine_released,and(pengar,har_ej_innehav))),rsi_ok)
actual=add(c,0)
setgvarif(lastpay,cell_kurs,har_innehav)
setgvarif(actual,cell_kurs,signal)
setgvarif(lastdate,cell_date,har_innehav)
setgvarif(now,cell_date,signal)
value_kurs=getgvar(cell_kurs)
tidpunkt=getgvar(cell_date)
and(signal,1)
{@A(0,SX All-Sha)}