2016年9月27日 星期二

【MultiCharts】【指標】多空關卡價

inputs:
    ah((((highd(1)+lowd(1)+closed(1))/3)*2)-lowd(1)),
    al((((highd(1)+lowd(1)+closed(1))/3)*2)-highD(1));

plot1(ah,"up");
plot2(al,"down");



【MultiCharts】【訊號】站上均線買進,跌破布林通道賣出

input:len1(61),s1(0.025),aa(11),bb(2.575);

value1=BollingerBand(close,aa,bb);
value2=BollingerBand(close,aa,-bb);

if close cross over Average(close,len1) then
 buy next bar at market;
if close cross under Average(close,len1) then
 sellshort next bar at market;

 if marketposition> 0 then 
  sell next bar at entryprice*(1-s1) stop;
 if marketposition<0 then
  buytocover next bar at entryprice*(1+s1) stop;
 

 if marketposition> 0 and close cross under value1 then 
  sell next bar at entryprice*(1-s1) stop;
 if marketposition<0 and close cross over value2 then
  buytocover next bar at entryprice*(1+s1) stop;
 

【MultiCharts】【訊號】昨天收黑K,並且今天開高就進場的策略

昨天收黑K,並且今天開高就進場的策略,以60分K來看

input:len1(-1),len2(1);
value1 = closed(1)-opend(1);
value2 = opend(0)-closed(1);

condition1=len1*value1>0 and len2*value2>0;
condition2=len1*value1<0 and len2*value2<0;

if condition1 then
 buy next bar at market;
if condition2 then
 sellshort next bar at market;





2016年9月24日 星期六

【MultiCharts】【指標】以20根K棒算出多空平均價

以最近的20根K棒,找出 (最高價+最低價) /2,來算出最近的平均價格
若再線上,則為多,反之,則為空


input: Barlookback(20) ; 
  
Vars: HighBand(0),LowBand(0);  

   HighBand = Highest(High,BarLookBack) ;
   LowBand = Lowest(Low,BarLookBack) ;
  
  
for Value1 =1 to  Barlookback Begin
    if Close[Value1] > HighBand then HighBand  = Close[Value1] ;
End;


Plot1((HighBand +LowBand) /2 , "NearBarHigh" ) ;



【MultiCharts】布林通道

Inputs: blen(20),bnum(2);
Inputs: slen(20),snum(2);

value1 = BollingerBand(close,blen,bnum);
value2 = BollingerBand(close,slen,-snum);

if close cross over value1  then
    buy next bar at market;

if close cross under value2 then
    sellshort next bar at market;

【MultiCharts】MA

if close cross over Average(close,60)  then
    buy next bar at market;

if marketposition>0 and close<Average(close,60) then
    sellshort next bar at market;

【MultiCharts】MACD

if MACD(close,12,26) cross over 0  then
    buy next bar at market;

if MACD(close,12,26) cross  under 0 then
    sellshort next bar at market;

【MultiCharts】RSI

if RSI(close,14) cross over 80 then
    buy next bar at market;

if RSI(close,14) cross  under 20 then
    sellshort next bar at market;

【MultiCharts】KD

if SlowKCustom(high,low,close,9) cross over SlowDCustom(high,low,close,9) then
    buy next bar at market;

fastkcustom

【MultiCharts】highest/lowest

value1 = highest(high,5);
value2 = lowest(low,5);
if marketposition< 0 then
    buy next bar at value1 stop;//突破高點就買進
if marketposition>=0 then
    sellshort next bar at value2 stop;//跌破低點就賣出
   

2016年9月23日 星期五

【MultiCharts】基礎語法

open:開盤價
close:收盤價
high:最高價
low:最低價
volume:量

high[3]:往前第三根K棒的最高價
low[3]:往前第三根K棒的最低價

highest(low,3) :前三根K棒低點的最大值

 if close> high[1] then
    buy next bar at market;
 if close< high[1] then
    sellshort  next bar at market;

buy:買入
sellshort:平倉

sell:賣出
buytocover:平倉

買入後,30點停損
sell next bar at entryprice-30 stop;

買入後,30點停利
sell next bar at entryprice+30 limit;

2016年9月8日 星期四

2016年9月2日 星期五