上記の広告は1ヶ月以上更新のないブログに表示されています。
新しい記事を書く事で広告が消せます。

さっきのプログラムの結果は ・・・

こっちのプログラムですた 。。。

このプログラムに何かしらのインディケーターを

いくつか絡ませたロジックを組むと ・・・

もしかすて ・・・






//+------------------------------------------------------------------+
//| YNNY.mq4 |
//| Copyright (c) 2009/04/09, ∞ |
//| †使用条件 // USD_JPY // Candle M15 |
//+------------------------------------------------------------------+

#property copyright "Copyright (c) 2009, ∞"
#property link "†††††††††††††††††††"

//マジックナンバー * 取引ナンバー OrderModify 関数で使用中*
#define MAGIC 100

//パラメーターの変数設定
extern int FastMA_Period = 30; // 短期移動平均の期間
extern int SlowMA_Period = 60; // 長期移動平均の期間
extern double Lots = 0.1; // 売買ロット数
extern int Slippage = 4; // スリッページ
extern int Profit=42; // リミット値
extern int StopLoss=41; // ストップロス値
extern double Threshold=0.30; // 移動平均乖離率
extern int MAPeriod=30; // 移動平均線の期間
extern int TrailingStop = 14; // トレイリングストップ値

//+------------------------------------------------------------------+
//| ポジションを決済する |
//+------------------------------------------------------------------+

void ClosePositions()
{

for( int i=0; i {
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES) == false) break;
if(OrderMagicNumber() != MAGIC || OrderSymbol() != Symbol()) continue;
//オーダータイプのチェック
if(OrderType()==OP_BUY)
{
OrderClose(OrderTicket(),OrderLots(),Bid,Slippage,White);
break;
}
if(OrderType()==OP_SELL)
{
OrderClose(OrderTicket(),OrderLots(),Ask,Slippage,White);
break;
}
}
}

/* コメントアウト中
int i, ticket, err;
// ボジション保有の判定
ticket = -1;
for (i = 0; i < OrdersTotal(); i++) {
if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES) == true) {
if(OrderSymbol() == Symbol()) {
if (OrderType() == OP_BUY || OrderType() == OP_SELL) {
ticket = OrderTicket();
break;
}
}
}
}
*/

//+------------------------------------------------------------------+
//| スタート関数 |
//+------------------------------------------------------------------+

int start()
{
//バーの始値でトレード可能かチェック
if(Volume[0]>1 || IsTradeAllowed()==false) return(0);

//移動平均の計算
double FastMA1 = iMA(NULL,0,FastMA_Period,0,MODE_SMA,PRICE_CLOSE,1);
double SlowMA1 = iMA(NULL,0,SlowMA_Period,0,MODE_SMA,PRICE_CLOSE,1);
double FastMA2 = iMA(NULL,0,FastMA_Period,0,MODE_SMA,PRICE_CLOSE,2);
double SlowMA2 = iMA(NULL,0,SlowMA_Period,0,MODE_SMA,PRICE_CLOSE,2);

// トレイリング機能でオーダー数を検索 コメントアウトで取引は複数となる
if( OrdersTotal() == 0){

// カスタムインディケータを minus と plus に代入 * 現在直接EAに使用なし
double minus = iCustom(Symbol(), NULL, " CustomIndicatorYNakashima", Threshold, MAPeriod, 2, 1);
double plus = iCustom(Symbol(), NULL, " CustomIndicatorYNakashima", Threshold, MAPeriod, 1, 1);

//買い条件 * 一部買い条件を売り条件に変更あり // 反 にて記載 *

// 01 三空叩き込み ******************** Profit_facter + 0.01 ********************
if (Open[4] > Close[4] && Open[3] > Close[3] && Open[2] > Close[2] && Open[1] > Close[1] && Close[5] > Open[4] && Close[4] > Open[3] && Close[3] > Open[2]) {

ClosePositions();
OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,
Ask-StopLoss*Point, Ask+Profit*Point, NULL, MAGIC, 0, Blue);
return(0);

/* 未使用
// 02 三手大陰線
}else if(Open[5] > Close[5] && Open[4] > Close[4] && Open[3] > Close[3] && Open[2] < Close[2] && Open[1] > Close[1] && Close[4] > Open[2]){

ClosePositions();
OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,
Ask-StopLoss*Point, Ask+Profit*Point, NULL, MAGIC, 0, Blue);
return(0);
*/

// 03 最後の抱き陰線 ******************** Profit_facter + 0.01 ********************
}else if(Open[5] > Close[5] && Open[4] > Close[4] && Open[3] > Close[3] && Open[2] < Close[2] && Open[1] > Close[1] && Close[2] <= Open[1]){

ClosePositions();
OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,
Ask-StopLoss*Point, Ask+Profit*Point, NULL, MAGIC, 0, Blue);
return(0);

// 04 明けの明星
}else if(Open[7] > Close[7] && Open[6] > Close[6] && Open[5] > Close[5] && Open[4] > Close[4] && Open[3] < Close[3] && Open[2] < Close[2] && Open[1] < Close[1] && Close[5] >= Open[4] &&Open[3] >= Close[4]){

ClosePositions();
OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,
Ask-StopLoss*Point, Ask+Profit*Point, NULL, MAGIC, 0, Blue);
return(0);
/*
// 05 捨て子底
}else if(Open[6] > Close[6] && Open [5] > Close[5] &&Open[4] > Close[4] && Open[3] == Close[3] && Open[2] < Close[2] && Open[1] < Close[1] && Open[3] == Close[3] && Close[4] >= Open[3] && Open[2] >= Close[3]){

ClosePositions();
OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,
Ask-StopLoss*Point, Ask+Profit*Point, NULL, MAGIC, 0, Blue);
return(0);
*/
// 06 大陰線のはらせ寄せ
}else if(Open[5] > Close[5] && Open[4] > Close[4] && Open[3] == Close[3] && Open[2] < Close[2] && Open[1] < Close[1] && Close[4] <= Close[3] && Close[4] <= Open[3]){

ClosePositions();
OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,
Ask-StopLoss*Point, Ask+Profit*Point, NULL, MAGIC, 0, Blue);
return(0);

// 反
// 07 たくり線 ******************** Profit_facter + 0.02 ********************
}else if(Open[5] > Close[5] && Open[4] > Close[4] && Open[3] > Close[3] && Open[2] < Close[2] && Open[1] < Close[1] && Close[4] > Open[3] && Close[3] > Low[3]){

ClosePositions();
OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,
Bid+StopLoss*Point, Bid-Profit*Point, NULL, MAGIC, 0, Red);
return(0);

// 08 努力線 ******************** Profit_facter + 0.05 ********************
}else if(Open[5] > Close[5] && Open[4] > Close[4] && Open[3] > Close[3] && Open[2] > Close[2] && Open[1] > Close[1] && Close[4] > Close[3] && Open[3] > Low[3]){

ClosePositions();
OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,
Ask-StopLoss*Point, Ask+Profit*Point, NULL, MAGIC, 0, Blue);
return(0);

// 反
// 09 陰の陰はらみ
}else if(Open[6] > Close[6] && Open[5] > Close[5] && Open[4] > Close[4] && Open[3] > Close[3] && Open[2] < Close[2] && Open[1] < Close[1] && Open[3] >= Close[4]){

ClosePositions();
OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,
Bid+StopLoss*Point, Bid-Profit*Point, NULL, MAGIC, 0, Red);
return(0);

// 10 放れ五手黒一本底
}else if(Open[7] > Close[7] && Open[6] > Close[6] && Open[5] > Close[5] && Open[4] < Close[4] && Open[3] > Close[3] && Open[2] > Close[2] && Open[1] < Close[1] && Close[7] > Open[5]){

ClosePositions();
OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,
Ask-StopLoss*Point, Ask+Profit*Point, NULL, MAGIC, 0, Blue);
return(0);
// 反
// 11 やぐら底
}else if(Open[7] > Close[7] && Open[6] < Close[6] && Open[5] > Close[5] && Open[4] < Close[4] && Open[3] > Close[3] && Open[2] < Close[2] && Open[1] < Close[1] && Close[2] > Open[3] && Close[2] > Close[4] && Close[2] > Open[5] && Close[2] > Close[6]){

ClosePositions();
OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,
Bid+StopLoss*Point, Bid-Profit*Point, NULL, MAGIC, 0, Red);
return(0);

// 12 小幅上放れ黒線
}else if(Open[4] > Close[4] && Open[3] < Close[3] && Open[2] > Close[2] && Open[1] > Close[1] && Close[1] > Open[2] && Close[1] > Close[3]){

ClosePositions();
OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,
Ask-StopLoss*Point, Ask+Profit*Point, NULL, MAGIC, 0, Blue);
return(0);

// 13 放れ七手の変化底改
}else if(Open[6] > Close[6] && Open[5] > Close[5] && Open[4] > Close[4] && Open[3] < Close[3] && Open[2] > Close[2] && Open[1] < Close[1] && Open[1] >Open[2] && Close[6] > Open[5]){

ClosePositions();
OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,
Ask-StopLoss*Point, Ask+Profit*Point, NULL, MAGIC, 0, Blue);
return(0);

// 反
// 14 連続下げ放れ三つ星改 ******************** Profit_facter + 0.01 ********************
}else if(Open[6] < Close[6] && Open[5] > Close[5] && Open[4] > Close[4] && Open[3] < Close[3] && Open[2] == Close[2] && Open[1] < Close[1] && Open[2] == Close[2] && Close[6] >= Open[5] && Close[1] > Open[4]){

ClosePositions();
OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,
Bid+StopLoss*Point, Bid-Profit*Point, NULL, MAGIC, 0, Red);
return(0);

// 15 逆襲線
}else if(Open[3] > Close[3] && Open[2] > Close[2] && Open[1] < Close[1] && Close[2] > Close[1] && Close[3] > Open[1]){

ClosePositions();
OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,
Ask-StopLoss*Point, Ask+Profit*Point, NULL, MAGIC, 0, Blue);
return(0);

// 16 抱き陽線 ******************** Profit_facter + 0.04 ********************
}else if(Open[4] < Close[4] && Open[3] > Close[3] && Open[2] > Close[2] && Open[1] < Close[1] && Close[1] > Open[2] && Open[1] < Open[2]){

ClosePositions();
OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,
Ask-StopLoss*Point, Ask+Profit*Point, NULL, MAGIC, 0, Blue);
return(0);

// 17 寄り切り陽線 1
}else if(Open[5] > Close[5] && Open[4] > Close[4] && Open[3] < Close[3] && Open[2] > Close[2] && Open[1] < Close[1] && Close[1] > Close[3] && Close[1] > Open[2] && Close[1] >Open[4] && Close[1] >Close[5]){

ClosePositions();
OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,
Ask-StopLoss*Point, Ask+Profit*Point, NULL, MAGIC, 0, Blue);
return(0);

// 18 寄り切り陽線 2
}else if(Open[5] < Close[5] && Open[4] > Close[4] && Open[3] < Close[3] && Open[2] > Close[2] && Open[1] < Close[1] && Close[1] > Close[3] && Close[1] > Open[2] && Close[1] >Open[4] && Close[1] >Close[5]){

ClosePositions();
OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,
Ask-StopLoss*Point, Ask+Profit*Point, NULL, MAGIC, 0, Blue);
return(0);

// 19 赤三兵

}else if(Open[6] > Close[6] && Open[5] > Close[5] && Open[4] > Close[4] && Open[3] < Close[3] && Open[2] < Close[2] && Open[1] < Close[1] && Open[1] > Open[3] && Open[1] > Open[4] && Open[1] > Open[5] && Open[1] > Open[6]){

ClosePositions();
OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,
Ask-StopLoss*Point, Ask+Profit*Point, NULL, MAGIC, 0, Blue);
return(0);

// 反
// 20 下位の陽線五本 ******************** Profit_facter + 0.09 ********************
}else if(Open[5] < Close[5] && Open[4] < Close[4] && Open[3] < Close[3] && Open[2] < Close[2] && Open[1] < Close[1]){

ClosePositions();
OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,
Bid+StopLoss*Point, Bid-Profit*Point, NULL, MAGIC, 0, Red);
return(0);

// 21 押さえ込み線
}else if(Open[7] < Close[7] && Open[6] < Close[6] && Open[5] > Close[5] && Open[4] > Close[4] && Open[3] > Close[3] && Open[2] < Close[2] && Open[1] < Close[1] && Close[3] > Open[6]){

ClosePositions();
OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,
Ask-StopLoss*Point, Ask+Profit*Point, NULL, MAGIC, 0, Blue);
return(0);

// 22 上げの差し込み線
}else if(Open[5] < Close[5] && Open[4] < Close[4] && Open[3] < Close[3] && Open[2] > Close[2] && Open[1] < Close[1] && Open[1] > Close[4]){

ClosePositions();
OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,
Ask-StopLoss*Point, Ask+Profit*Point, NULL, MAGIC, 0, Blue);
return(0);

// 23 上げ三法
}else if(Open[6] < Close[6] && Open[5] < Close[5] && Open[4] > Close[4] && Open[3] > Close[3] && Open[2] > Close[2] && Open[1] < Close[1] && Close[4] > Open[1] && Open[1] > Open[5] && Close[3] > Open[5]){

ClosePositions();
OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,
Ask-StopLoss*Point, Ask+Profit*Point, NULL, MAGIC, 0, Blue);
return(0);

// 24 カブセ上抜け
}else if(Open[6] < Close[6] && Open[5] < Close[5] && Open[4] < Close[4] && Open[3] < Close[3] && Open[2] < Close[2] && Open[1] < Close[1] && Close[2] > Open[4] && Close[3] > Open[5]){

ClosePositions();
OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,
Ask-StopLoss*Point, Ask+Profit*Point, NULL, MAGIC, 0, Blue);
return(0);

/*
// コメントアウト中
// 25 上伸途上の連続タスキ
}else if(Open[6] < Close[6] && Open[5] < Close[5] && Open[4] < Close[4] && Open[3] > Close[3] && Open[2] < Close[2] && Open[1] < Close[1] && Close[4] < Open[3]){

ClosePositions();
OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,
Ask-StopLoss*Point, Ask+Profit*Point, NULL, MAGIC, 0, Blue);
return(0);
*/

// 反
// 26 上放れタスキ
}else if(Open[5] < Close[5] && Open[4] < Close[4] && Open[3] < Close[3] && Open[2] > Close[2] && Open[1] < Close[1] && Open[3] > Open[4] && Close[2] > Open[4]){

ClosePositions();
OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,
Bid+StopLoss*Point, Bid-Profit*Point, NULL, MAGIC, 0, Red);
return(0);

// 27 上伸び途上のクロス
}else if(Open[6] < Close[6] && Open[5] < Close[5] && Open[4] < Close[4] && Open[3] < Close[3] && Open[2] == Close[2] && Open[1] < Close[1] && Close[6] < Open[3]){

ClosePositions();
OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,
Ask-StopLoss*Point, Ask+Profit*Point, NULL, MAGIC, 0, Blue);
return(0);

// 28 上げの三つ星 ******************** Profit_facter + 0.03 ********************
}else if(Open[6] < Close[6] && Open[5] < Close[5] && Open[4] > Close[4] && Open[3] < Close[3] && Open[2] > Close[2] && Open[1] < Close[1] && Open[4] <= Close[3] && Close[3] <= Open[2] && Close[6] < Close[4] && Close[6] < Close[2] && Close[6] < Open[3]){

ClosePositions();
OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,
Ask-StopLoss*Point, Ask+Profit*Point, NULL, MAGIC, 0, Blue);
return(0);

// 29 並び赤
}else if(Open[5] < Close[5] && Open[4] < Close[4] && Open[3] < Close[3] && Open[2] < Close[2] && Open[1] < Close[1] && Close[3] < Open[2] && Close[3] < Open[1]){

ClosePositions();
OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,
Ask-StopLoss*Point, Ask+Profit*Point, NULL, MAGIC, 0, Blue);
return(0);

// 反
// 30 上放れ陰線二本連続 ******************** Profit_facter + 0.01 ********************
}else if(Open[5] > Close[5] && Open[4] > Close[4] && Open[3] < Close[3] && Open[2] < Close[2] && Open[1] > Close[1] && Close[6] > Close[5] && Close[1] > Close[2]){

ClosePositions();
OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,
Bid+StopLoss*Point, Bid-Profit*Point, NULL, MAGIC, 0, Red);
return(0);

// 31 上位の連続太陽線
}else if(Open[6] < Close[6] && Open[5] < Close[5] && Open[4] < Close[4] && Open[3] < Close[3] && Open[2] < Close[2] && Open[1] < Close[1] && Close[3] < Open[1] && Close[2] > Close[4]){

ClosePositions();
OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,
Ask-StopLoss*Point, Ask+Profit*Point, NULL, MAGIC, 0, Blue);
return(0);

// 32 波高い線
}else if(Open[5] < Close[5] && Open[4] < Close[4] && Open[3] < Close[3] && Open[2] < Close[2] && Open[1] < Close[1] && Close[1] < High[2]){

ClosePositions();
OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,
Ask-StopLoss*Point, Ask+Profit*Point, NULL, MAGIC, 0, Blue);
return(0);

// 売り条件 * 一部売り条件を買い条件に変更あり // 反 にて記載 **********************************************************************************************************

// 01 三空踏み上げ
}else if(Open[5] < Close[5] && Open[4] < Close[4] && Open[3] < Close[3] && Open[2] < Close[2] && Open[1] < Close[1] && Close[4] < Open[3] && Close[3] < Open[2] && Close[2] < Open[1]){

ClosePositions();
OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,
Bid+StopLoss*Point, Bid-Profit*Point, NULL, MAGIC, 0, Red);
return(0);

//反
// 02 新値八手利食い線
}else if(Open[7] < Close[7] && Open[6] > Close[6] && Open[5] <= Close[5] && Open[4] <= Close[4] && Open[3] <= Close[3] && Open[2] > Close[2] && Open[1] < Close[1] && Close[2] > Open[3] && Close[6] > Close[8]){

ClosePositions();
OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,
Ask-StopLoss*Point, Ask+Profit*Point, NULL, MAGIC, 0, Blue);
return(0);

// 03 三手放れ寄せ線
}else if(Open[6] < Close[6] && Open[5] < Close[5] && Open[4] < Close[4] && Open[3] < Close[3] && Open[2] < Close[2] && Open[1] == Close[1] && Close[5] < Open[4]){

ClosePositions();
OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,
Bid+StopLoss*Point, Bid-Profit*Point, NULL, MAGIC, 0, Red);
return(0);

// 04 行き詰まり線
}else if(Open[6] < Close[6] && Open[5] < Close[5] && Open[4] < Close[4] && Open[3] < Close[3] && Open[2] < Close[2] && Open[1] > Close[1] && High[3] > Close[2]){

ClosePositions();
OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,
Bid+StopLoss*Point, Bid-Profit*Point, NULL, MAGIC, 0, Red);
return(0);

// 反
// 05 三羽ガラス ******************** Profit_facter + 0.02 ********************
}else if(Open[6] < Close[6] && Open[5] < Close[5] && Open[4] < Close[4] && Open[3] > Close[3] && Open[2] > Close[2] && Open[1] > Close[1] && Open[5] < Close[3] && Open[5] < Close[2]){

ClosePositions();
OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,
Ask-StopLoss*Point, Ask+Profit*Point, NULL, MAGIC, 0, Blue);
return(0);

// 06 首吊り線
}else if(Open[5] < Close[5] && Open[4] < Close[4] && Open[3] < Close[3] && Open[2] < Close[2] && Open[1] > Close[1] && Close[3] < Open[2] && Close[3] > Low[2]){

ClosePositions();
OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,
Bid+StopLoss*Point, Bid-Profit*Point, NULL, MAGIC, 0, Red);
return(0);

// 07 上位の上放れ陰線
}else if(Open[6] < Close[6] && Open[5] < Close[5] && Open[4] < Close[4] && Open[3] < Close[3] && Open[2] > Close[2] && Open[1] > Close[1] && Close[3] < Close[2]){

ClosePositions();
OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,
Bid+StopLoss*Point, Bid-Profit*Point, NULL, MAGIC, 0, Red);
return(0);

// 08 宵の明星
}else if(Open[5] < Close[5] && Open[4] < Close[4] && Open[3] < Close[3] && Open[2] < Close[2] && Open[1] > Close[1] && Close[3] < Open[2] && Open[2] > Open[1]){

ClosePositions();
OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,
Bid+StopLoss*Point, Bid-Profit*Point, NULL, MAGIC, 0, Red);
return(0);
// 反
// 09 陽の陽のはらみ
}else if(Open[4] < Close[4] && Open[3] < Close[3] && Open[2] < Close[2] && Open[1] > Close[1] && Close[3] > Close[2] && Open[3] < Open[2]){

ClosePositions();
OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,
Ask-StopLoss*Point, Ask+Profit*Point, NULL, MAGIC, 0, Blue);
return(0);

// 10 最後の抱き陽線
}else if(Open[4] < Close[4] && Open[3] < Close[3] && Open[2] > Close[2] && Open[1] < Close[1] && Open[2] < Close[1] && Close[2] > Open[1]){

ClosePositions();
OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,
Bid+StopLoss*Point, Bid-Profit*Point, NULL, MAGIC, 0, Red);
return(0);

// 11 抱き陰線
}else if(Open[5] > Close[5] && Open[4] < Close[4] && Open[3] < Close[3] && Open[2] < Close[2] && Open[1] > Close[1] && Close[2] < Open[1] && Open[2] > Close[1]){

ClosePositions();
OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,
Bid+StopLoss*Point, Bid-Profit*Point, NULL, MAGIC, 0, Red);
return(0);

// 12 つたい線の打ち返し
}else if(Open[6] < Close[6] && Open[5] < Close[5] && Open[4] < Close[4] && Open[3] > Close[3] && Open[2] > Close[2] && Open[1] < Close[1] && Close[1] > Close[4] && Close[2] < Close[3]){

ClosePositions();
OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,
Bid+StopLoss*Point, Bid-Profit*Point, NULL, MAGIC, 0, Red);
return(0);

// 13 放れ五手赤一本
}else if(Open[6] < Close[6] && Open[5] < Close[5] && Open[4] > Close[4] && Open[3] < Close[3] && Open[2] > Close[2] && Open[1] < Close[1] && Open[5] > Close[6]){

ClosePositions();
OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,
Bid+StopLoss*Point, Bid-Profit*Point, NULL, MAGIC, 0, Red);
return(0);

// 14 放れ七手大黒 ******************** Profit_facter + 0.01 ********************
}else if(Open[8] < Close[8] && Open[7] < Close[7] && Open[6] > Close[6] && Open[5] < Close[5] && Open[4] > Close[4] && Open[3] < Close[3] && Open[2] < Close[2] && Open[1] > Close[1] && Close[8] < Open[7] && Close[7] > Open[1]){

ClosePositions();
OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,
Bid+StopLoss*Point, Bid-Profit*Point, NULL, MAGIC, 0, Red);
return(0);

// 15 差し込み線
}else if(Open[5] > Close[5] && Open[4] > Close[4] && Open[3] > Close[3] && Open[2] < Close[2] && Open[1] > Close[1] && Close[3] > Open[2]){

ClosePositions();
OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,
Bid+StopLoss*Point, Bid-Profit*Point, NULL, MAGIC, 0, Red);
return(0);

/*
// コメントアウト中
// 16 下放れ三手
}else if(Open[6] > Close[6] && Open[5] > Close[5] && Open[4] < Close[4] && Open[3] < Close[3] && Open[2] < Close[2] && Open[1] > Close[1] && Close[5] > Open[4]){

ClosePositions();
OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,
Bid+StopLoss*Point, Bid-Profit*Point, NULL, MAGIC, 0, Red);
return(0);
*/

// 反
// 17 下げ三法 ******************** Profit_facter + 0.01 ********************
}else if(Open[7] > Close[7] && Open[6] > Close[6] && Open[5] > Close[5] && Open[4] < Close[4] && Open[3] < Close[3] && Open[2] < Close[2] && Open[1] > Close[1] && Close[5] > Close[1]){

ClosePositions();
OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,
Ask-StopLoss*Point, Ask+Profit*Point, NULL, MAGIC, 0, Blue);
return(0);

// 18 三手打ち
}else if(Open[4] > Close[4] && Open[3] > Close[3] && Open[2] > Close[2] && Open[1] < Close[1] && Close[1] > Open[2] && Close[1] > Open[3] && Close[1] > Open[4] && Open[1] < Close[2] && Open[1] < Close[3] && Open[1] < Close[4]){
ClosePositions();

OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,
Bid+StopLoss*Point, Bid-Profit*Point, NULL, MAGIC, 0, Red);
return(0);

// 19 下落途上の連続タスキ
}else if(Open[5] > Close[5] && Open[4] > Close[4] && Open[3] > Close[3] && Open[2] < Close[2] && Open[1] > Close[1] && Close[2] < Open[4] && Open[2] > Close[3]){

ClosePositions();
OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,
Bid+StopLoss*Point, Bid-Profit*Point, NULL, MAGIC, 0, Red);
return(0);

// 20 化け線
}else if(Open[5] > Close[5] && Open[4] > Close[4] && Open[3] > Close[3] && Open[2] > Close[2] && Open[1] < Close[1] && High[5] < Open[1] && High[4] < Open[1] && High[3] < Open[1] && High[2] < Open[1]){

ClosePositions();
OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,
Bid+StopLoss*Point, Bid-Profit*Point, NULL, MAGIC, 0, Red);
return(0);

// 21 下げ足のクロス
}else if(Open[6] > Close[6] && Open[5] > Close[5] && Open[4] > Close[4] && Open[3] == Close[3] && Open[2] < Close[2] && Open[1] < Close[1] && Close[4] > Open[2]){

ClosePositions();
OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,
Bid+StopLoss*Point, Bid-Profit*Point, NULL, MAGIC, 0, Red);
return(0);

// 反
// 22 下放れ黒二本 ******************** Profit_facter + 0.01 ********************
}else if(Open[4] > Close[4] && Open[3] > Close[3] && Open[2] > Close[2] && Open[1] > Close[1] && Close[3] > Open[2] && Close[3] > Open[1]){

ClosePositions();
OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,
Ask-StopLoss*Point, Ask+Profit*Point, NULL, MAGIC, 0, Blue);
return(0);

// 23 下げの三つ星
}else if(Open[5] > Close[5] && Open[4] > Close[4] && Open[3] > Close[3] && Open[2] < Close[2] && Open[1] > Close[1] && High[2] == High[1] && Low[2] == Low[1]){

ClosePositions();
OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,
Bid+StopLoss*Point, Bid-Profit*Point, NULL, MAGIC, 0, Red);
return(0);

// 24 上位の陰線五本
}else if(Open[6] < Close[6] && Open[5] > Close[5] && Open[4] > Close[4] && Open[3] > Close[3] && Open[2] > Close[2] && Open[1] > Close[1] && Open[6] > Open[1]){

ClosePositions();
OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,
Bid+StopLoss*Point, Bid-Profit*Point, NULL, MAGIC, 0, Red);
return(0);

/*
// コメントアウト中
// 25 寄り切り陰線
}else if(Open[5] < Close[5] && Open[4] > Close[4] && Open[3] < Close[3] && Open[2] > Close[2] && Open[1] > Close[1] && Open[4] > Open[1] && Close[1] < Close[2] && Close[1] < Close[4] && Close[1] < Open[3] && Close[1] < Open[5]){

ClosePositions();
OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,
Ask-StopLoss*Point, Ask+Profit*Point, NULL, MAGIC, 0, Blue);
return(0);
*/

}
}

/*
// トレイリングストップ機能 * コメントアウト中 *

for(int i=0; i < OrdersTotal(); i++){
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES) == false) break;
if(OrderMagicNumber() != MAGIC || OrderSymbol() != Symbol()) continue;
if(OrderType() == OP_BUY){
if(Bid-OrderOpenPrice() >TrailingStop*Point && OrderStopLoss() < Bid-TrailingStop*Point){
OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TrailingStop,OrderTakeProfit(),0,Green);
return(0);
}
break;
}
if(OrderType() == OP_SELL){
if(OrderOpenPrice()-Ask > TrailingStop*Point && OrderStopLoss() > Ask+TrailingStop*Point){
OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*TrailingStop,OrderTakeProfit(),0,Green);
return(0);
}
break;
}
}
*/
/*
//トレイリングストップ機能 * 利益確定で追いかける機能追加
OrderSelect(0, SELECT_BY_POS, MODE_TRADES);
if(OrderType()<=OP_SELL && OrderSymbol()==Symbol()) {
if(OrderType()==OP_BUY) {
if(TrailingStop>0) {
if(Bid-OrderOpenPrice()>Point*TrailingStop) {
if(OrderStopLoss() OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TrailingStop,OrderTakeProfit(),0,Magenta);
return(0);
}
}
}
} else {
if(TrailingStop>0) {
if((OrderOpenPrice()-Ask)>(Point*TrailingStop)) {
if((OrderStopLoss()>(Ask+Point*TrailingStop)) || (OrderStopLoss()==0)) {
OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*TrailingStop,OrderTakeProfit(),0,Magenta);
return(0);
}
}
}
}
}
*/

//----
return(0);
}
//+------------------------------------------------------------------+


FC2blog テーマ:投資日記 - ジャンル:株式・投資・マネー

【2009/09/16 21:38】 | FX
トラックバック(0) |
コメント
この記事へのコメント
コメントを投稿
URL:

Pass:
秘密: 管理者にだけ表示を許可
 
トラックバック
この記事のトラックバックURL
この記事へのトラックバック
上記広告は1ヶ月以上更新のないブログに表示されています。新しい記事を書くことで広告を消せます。