あ~~!
もう、12時間以上も、パソコンの前に座っています・・・ 笑。
現在、悪戦苦闘中です。
input : Period(16);
Input : Period1(5), Period2(20), Period3(60),
Period4(120), Period5(200);
Input : af(0.02), maxAF(0.2);
// 移動平均線5本
Value1 = (ma(C,Period1));
Value2 = (ma(C,Period2));
Value3 = (ma(C,Period3));
Value4 = (ma(C,Period4));
Value5 = (ma(C,Period5));
// 『売り』の時の MACD 設定
Input : shortPeriod1(12), longPeriod1(26), Period6(9);
Var : value6(0), value7(0), macdosc(0) ;
Value6 = MACD(shortPeriod1, longPeriod1);
macdosc = value6-ema(value6,Period6);
Value7= (ema(value6,Period6));
//---------------------------------------------------
// デイトレード
//---------------------------------------------------
Vars: MarketPosi(0), FlagNum1(0), FlagNum2(0), FlagNum3(0),
MACDFlag1(0), MACDFlag2(0), GapFlag(0), CrossFlag(0);
if Date<>Date[1] then begin
// チャートの日付の境目
MarketPosi = 0;
FlagNum1 = 0;
FlagNum2 = 0;
FlagNum3 = 0;
MACDFlag1 = 0;
MACDFlag2 = 0;
GapFlag = 0;
CrossFlag = 0;
end;
MarketPosi = MarketPosition(0);
Condition1 = Time > 150800;
Condition2 = Time >= 090800 and Time <= 110000;
Condition3 = Time >= 123000 and Time <= 150000;
//Condition4 = Time >= 163000 and Time <= 185000;
// 売りの条件
Condition5 = Value1 < Value2 and Value2 < Value3 and
Value3 < Value4 and Value4 < Value5;
Condition6 = Value1 > Value3 and Value2 > Value3 and
Value1 > Value2 ;
// MACDのオシレーターが負値であることを確認
Condition7 = macdosc < 0;
// 移動平均線の長期・超長期線の傾きを感知
Condition8 = (ma(C[4],Period4)) > (ma(C[1],Period4)) and
(ma(C[4],Period5)) > (ma(C[1],Period5));
FlagNum1 = (ma(C[31],Period3)) - (ma(C[16],Period3));
FlagNum2 = (ma(C[16],Period3)) - (ma(C[1],Period3));
FlagNum3 = Abs(FlagNum1 + FlagNum2);
Condition9 = FlagNum3 >= 10;
// MACDの動きを感知
Vars: MacPoint(15);
Condition10 = Time >= 100000 and Time <= 110000;
Condition11 = Time >= 130000 and Time <= 150000;
if Condition10 and value8 > MacPoint then MACDFlag1 = 1;
if Condition10 and value8 < -MacPoint then MACDFlag1 = 1;
if Condition11 and value8 > MacPoint then MACDFlag2 = 1;
if Condition11 and value8 < -MacPoint then MACDFlag2 = 1;
// 前場と後場のギャップアップを感知
if Abs(C[1]-C) > 40 then GapFlag = 1;
// MACDゴールデンクロス時排除条件
if CrossUp(value8, value9) then
CrossFlag = 1;
else
CrossFlag = 0;
# 売り決済
If Condition2 and CrossDown(value6,0) and Condition5 Then
{
Sell("Sell1",atlimit,C[1],def);
}
If Condition3 and CrossDown(value6,0) and Condition5 Then
{
Sell("Sell2",atlimit,C[1],def);
}
/*If Condition2 and Condition6 and Condition7 and
Condition8 and
GapFlag == 0 Then
{
Sell("SellZ",atlimit,C[1],def);
}
If Condition3 and Condition6 and Condition7 and
Condition8 and
GapFlag == 0 Then
{
Sell("SellG",atlimit,C[1],def);
}*/
// エグジット条件
Condition20 = Value2 > Value4;
Condition21 = C > (EntryPrice(0)+50); // ロスカット値の設定
# エグジット
If Condition2 and Condition20 Then
{
ExitShort("Exit1",atlimit,C[1],def);
}
If Condition3 and Condition20 Then
{
ExitShort("Exit2",atlimit,C[1],def);
}
/*If Condition4 and CrossDown(value9,0) Then
{
ExitShort("Exit3");
}
If Condition2 and Condition21 Then
{
ExitShort("Exit1S",atlimit,C[1],def);
}
If Condition3 and Condition21 Then
{
ExitShort("Exit2S",atlimit,C[1],def);
} */
//---------------------------------------------------
// エグジット
//---------------------------------------------------
if MarketPosi == -1 and Condition1 then ExitShort();
頭の中が、スパゲティー状態です。
もう寝ます。
早く完成させたいのですが、まだ、まだ×100 です。
おやすみなさい。
お帰りは、こちらからお願いします。
【 EXIT 】
↓ ↓ ↓ ↓ ↓ ↓
☆
フェニックス株式投資情報ポータルサイト への閲覧申請は・・・
➡ 月間 閲覧申請:CGI版
➡ 月間 閲覧申請:PHP版
☆
フェニックス:日経225倶楽部 への閲覧申請は・・・
➡ 月間 閲覧申請:CGI版
➡ 月間 閲覧申請:PHP版