コーディングのヘルプ - ページ 667 1...660661662663664665666667668669670671672673674...786 新しいコメント dotmund 2016.08.12 17:24 #6661 青い矢印が現れたら買い、赤い矢印が現れたら売り、矢印の隣のキャンドルが閉じたら取引を終了します。 ファイル: EMA_Cross__SES__BDv8_12_31.ex4 6 kb EMA_Cross__SES__BDv8_12_31.mq4 5 kb Mladen Rakic 2016.08.12 18:45 #6662 dotmund: 青い矢印が表示されたら買い、赤い矢印が表示されたら売り、矢印の隣のキャンドルが閉じたら取引を終了します。 このポストをチェックしてください:https://www.mql5.com/en/forum/180648/page940 Entropy 2016.08.13 02:55 #6663 mladen: ローソク足については、それに特化したインジケータを使用するのがベストです(添付のようなもの)。ピリオドセパレータについては、すでにnmcになっているが、添付のものを使うとよい(CPUの負担が軽くなるはず)。 ありがとうございました。BarsLimitの オプションを追加 しようと思って いるのですが、うまく いきません。助けていただけませんか? お手数ですが、よろしくお願いします。 ファイル: Period Separator 2_3_1.mq4 3 kb Mladen Rakic 2016.08.13 08:57 #6664 Entropy: どうもありがとうございました。BarsLimit」のオプションを追加 しようと思って いるのですが、うまく いきません。助けていただけませんか? お忙しい中、誠にありがとうございます。 エントロピ以下は、そのオプションを追加したバージョンです。 ファイル: Period Separator 2_4.mq4 3 kb FxSteven 2016.08.13 21:39 #6665 こんにちはmladenは、私は宣言を解決するために教えることができます。これは、私は警告を得るものです。declaration of 'MinLots' hides global declaration at line 93 declaration of 'MaxLots' hides global declaration at line 94 declaration of 'Magic' hides global declaration at line 118 void CalculateMM() { double MinLots=MarketInfo(Symbol(),MODE_MINLOT); double MaxLots=MarketInfo(Symbol(),MODE_MAXLOT); Lots=AccountFreeMargin()/100000*RiskPercent; Lots=MathMin(MaxLots,MathMax(MinLots,Lots)); if(MinLots<0.1)Lots=NormalizeDouble(Lots,2); else { if(MinLots<1)Lots=NormalizeDouble(Lots,1); else Lots=NormalizeDouble(Lots,0); } if(Lots<MinLots)Lots=MinLots; if(Lots>MaxLots)Lots=MaxLots; return; int CloseBuyOrders(int Magic) { int total=OrdersTotal(); for (int cnt=total-1;cnt>=0;cnt--) { if (OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES)) if(OrderMagicNumber()==Magic&&OrderSymbol()==Symbol()) { if(OrderType()==OP_BUY) { ClTicket= OrderClose(OrderTicket(),OrderLots(),Bid,3); } } } return(0); } int CloseBuyOrdersHiddenTP(int Magic) { int total=OrdersTotal(); for (int cnt=total-1;cnt>=0;cnt--) { if (OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES)) if(OrderMagicNumber()==Magic&&OrderSymbol()==Symbol()) { if(OrderType()==OP_BUY&&Bid>(OrderOpenPrice()+TakeProfit*Point)) { ClTicket=OrderClose(OrderTicket(),OrderLots(),Bid,3); } } } return(0); }ありがとうございます。 Mladen Rakic 2016.08.14 06:19 #6666 stevenpun: こんにちはmladenは、私は宣言を解決するために教えることができます。これは、私は警告を得るものです。ありがとうございます。 まず、この。void CalculateMM() { double tMinLots=MarketInfo(Symbol(),MODE_MINLOT); double tMaxLots=MarketInfo(Symbol(),MODE_MAXLOT); Lots=AccountFreeMargin()/100000*RiskPercent; Lots=MathMin(tMaxLots,MathMax(tMinLots,Lots)); if(tMinLots<0.1)Lots=NormalizeDouble(Lots,2); else { if(tMinLots<1)Lots=NormalizeDouble(Lots,1); else Lots=NormalizeDouble(Lots,0); } if(Lots<tMinLots)Lots=tMinLots; if(Lots>tMaxLots)Lots=tMaxLots; return; とこれint CloseBuyOrders(int tMagic) { int total=OrdersTotal(); for (int cnt=total-1;cnt>=0;cnt--) { if (OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES)) if(OrderMagicNumber()==tMagic&&OrderSymbol()==Symbol()) { if(OrderType()==OP_BUY) { ClTicket= OrderClose(OrderTicket(),OrderLots(),Bid,3); } } } return(0); } int CloseBuyOrdersHiddenTP(int tMagic) { int total=OrdersTotal(); for (int cnt=total-1;cnt>=0;cnt--) { if (OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES)) if(OrderMagicNumber()==tMagic&&OrderSymbol()==Symbol()) { if(OrderType()==OP_BUY&&Bid>(OrderOpenPrice()+TakeProfit*Point)) { ClTicket=OrderClose(OrderTicket(),OrderLots(),Bid,3); } } } return(0); } murnathan32 2016.08.15 19:30 #6667 こんにちは、Mladen。このコードで、修正すべき点を教えていただけませんか?また、上位のタイムフレームになった場合、次のように変更することは可能でしょうか?===> 1分~30分 ==> 10pips毎===> 1時間足====> 50pips毎===> 4時間足、日足================================100pips毎===> 週足、月足 ===> 1000pips毎線ではなく、長方形が希望です。#プロパティ indicator_chart_window#define ONDA_BEGINS 0#define ONDA_CONTAINS 1//+------------------------------------------------------------------+//| カスタムインジケータ初期化関数//+------------------------------------------------------------------+int init(){//---- インジケーター//----return(0);}//+------------------------------------------------------------------+//| カスタムインジケータ初期化関数//+------------------------------------------------------------------+int deinit(){//----for (int ix = 0; ix < nLines; ix++) //横線を 削除する。{ObjectDelete("tensLines "+ix);}//----return(0);}//+------------------------------------------------------------------+//| カスタムインジケーターイテレーション関数//+------------------------------------------------------------------+int start(){int nLines = 40; // 描画する全ラインの数double lineInterval = 0.0010; // ラインとラインの間の間隔double normPrice = NormalizeDouble(Close[1],3); // 現在値は "10 "未満を四捨五入しています。for (int ix = 0; ix < nLines; ix++) // ループスパン回数{if(ObjectFind("tensLines "+ix) < 0)ObjectCreate("tensLines "+ix, OBJ_HLINE, 0, 0, normPrice+((ix-(nLines/2))*lineInterval)); // 現在の価格の上半分、下半分に配置する。else ObjectSet("tensLines "+ix, OBJPROP_PRICE1, normPrice+((ix-(nLines/2))*lineInterval));ObjectSet("tensLines "+ix,OBJPROP_COLOR,DarkSlateGray); // 線をきれいに見せる}//----return(0);}//+------------------------------------------------------------------+void ObjectNameDeleteAll(string name, int where=ONDA_BEGINS, int type=EMPTY){for(int iObj=ObjectsTotal()-1; iObj >= 0; iObj--){string on = ObjectName(iObj);int iPos = StringFind(on, name);if (iPos < 0) continue;if (iPos > 0 && where == ONDA_BEGINS) continue;if (type == EMPTY) ObjectDelete(on);else if (type == ObjectType(on))ObjectDelete(on);}}//--- Coding help コーディングの方法は? 初心者なのですが、HAを新しいウィンドウで表示させたいのですが...。 Mladen Rakic 2016.08.15 20:01 #6668 murnathan32: こんにちは、Mladen。このコードで、修正すべき点を教えていただけませんか?また、上位のタイムフレームになった場合、次のように変更することは可能でしょうか?===> 1分~30分 ==> 10pips毎===> 1時間足====> 50pips毎===> 4時間足、日足================================100pips毎===> 週足、月足 ===> 1000pips毎線ではなく、長方形が希望です。#プロパティ indicator_chart_window#define ONDA_BEGINS 0#define ONDA_CONTAINS 1//+------------------------------------------------------------------+//| カスタムインジケータ初期化関数//+------------------------------------------------------------------+int init(){//---- インジケーター//----return(0);}//+------------------------------------------------------------------+//| カスタムインジケータ初期化関数//+------------------------------------------------------------------+int deinit(){//----for (int ix = 0; ix < nLines; ix++) // 横線を削除する。{ObjectDelete("tensLines "+ix);}//----return(0);}//+------------------------------------------------------------------+//| カスタムインジケーターイテレーション関数//+------------------------------------------------------------------+int start(){int nLines = 40; // 描画する全ラインの数double lineInterval = 0.0010; // ラインとラインの間の間隔double normPrice = NormalizeDouble(Close[1],3); // 現在値は "10 "未満を四捨五入しています。for (int ix = 0; ix < nLines; ix++) // ループスパン回数{if(ObjectFind("tensLines "+ix) < 0)ObjectCreate("tensLines "+ix, OBJ_HLINE, 0, 0, normPrice+((ix-(nLines/2))*lineInterval)); // 現在の価格の上半分、下半分に配置する。else ObjectSet("tensLines "+ix, OBJPROP_PRICE1, normPrice+((ix-(nLines/2))*lineInterval));ObjectSet("tensLines "+ix,OBJPROP_COLOR,DarkSlateGray); // 線をきれいに見せる}//----return(0);}//+------------------------------------------------------------------+void ObjectNameDeleteAll(string name, int where=ONDA_BEGINS, int type=EMPTY){for(int iObj=ObjectsTotal()-1; iObj >= 0; iObj--){string on = ObjectName(iObj);int iPos = StringFind(on, name);if (iPos < 0) continue;if (iPos > 0 && where == ONDA_BEGINS) continue;if (type == EMPTY) ObjectDelete(on);else if (type == ObjectType(on))ObjectDelete(on);}}//--- このようにします。 #property indicator_chart_window #define ONDA_BEGINS 0 #define ONDA_CONTAINS 1 int nLines = 40; // Number of total line to draw //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- for (int ix = 0; ix < nLines; ix++) // delete my horizontal lines { ObjectDelete("tensLines"+ix); } //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { double lineInterval = 0.0010; // Interval between lines double normPrice = NormalizeDouble(Close[1],3); // Current price is rounded to nearest "10" for (int ix = 0; ix < nLines; ix++) // Loop span number of times { if(ObjectFind("tensLines"+ix) < 0) ObjectCreate("tensLines"+ix, OBJ_HLINE, 0, 0, normPrice+((ix-(nLines/2))*lineInterval)); // Place half above and half below the current price else ObjectSet("tensLines"+ix, OBJPROP_PRICE1, normPrice+((ix-(nLines/2))*lineInterval)); ObjectSet("tensLines"+ix,OBJPROP_COLOR,DarkSlateGray); // Make the lines look better } //---- return(0); } //+------------------------------------------------------------------+ void ObjectNameDeleteAll(string name, int where=ONDA_BEGINS, int type=EMPTY) { for(int iObj=ObjectsTotal()-1; iObj >= 0; iObj--) { string on = ObjectName(iObj); int iPos = StringFind(on, name); if (iPos < 0) continue; if (iPos > 0 && where == ONDA_BEGINS) continue; if (type == EMPTY) ObjectDelete(on); else if (type == ObjectType(on)) ObjectDelete(on); } } Johanson2424 2016.08.15 23:47 #6669 おい、みんな俺のためにパイソンでいくつかのコードを書くために誰かを雇うことを探して、誰かの仕事のために支払うことを喜んで、または誰かが無料でそれを行う場合は、それもクールだ(笑)しかし、いつでも私に戻って、誰かが私を助けることができれば私に知らせてください。 それは主にボリンジャーバンドと いくつかの他の指標になります。すべての助けをみんなありがとう murnathan32 2016.08.16 06:40 #6670 mladen:こんな風に試してみてくださいわああなたは男だ。mladenさん、祝福のお言葉ありがとうございます。もう一つお願いがあります。下の添付ファイル/ピックのようにグリッドを長方形にしていただけませんか。 例えば1つの長方形に10ピップス。長方形は未来を投影 させる。デフォルトのグリッドよりも目に優しいような気がします。また、何pips動いているか確認するのに半瞬かかります。 ObjectCreate("Rect02", OBJ_RECTANGLE, 0, Time[0], Bid, Time[Bars], (Bid+0.0010) ); //make bar above cur price ObjectSet("Rect02", OBJPROP_COLOR, Silver ); } //================= Move the Rect with new ticks/candles =========================== else { ObjectMove("Rect01", 0, Time[0], WindowPriceMin()*0.95); ObjectMove("Rect02", 0, Time[0], Bid); } ファイル: RoundPips.mq4 3 kb newnbarscmq4.jpg 105 kb 1...660661662663664665666667668669670671672673674...786 新しいコメント 取引の機会を逃しています。 無料取引アプリ 8千を超えるシグナルをコピー 金融ニュースで金融マーケットを探索 新規登録 ログイン スペースを含まないラテン文字 このメールにパスワードが送信されます エラーが発生しました Googleでログイン WebサイトポリシーおよびMQL5.COM利用規約に同意します。 新規登録 MQL5.com WebサイトへのログインにCookieの使用を許可します。 ログインするには、ブラウザで必要な設定を有効にしてください。 ログイン/パスワードをお忘れですか? Googleでログイン
青い矢印が表示されたら買い、赤い矢印が表示されたら売り、矢印の隣のキャンドルが閉じたら取引を終了します。
ローソク足については、それに特化したインジケータを使用するのがベストです(添付のようなもの)。
ピリオドセパレータについては、すでにnmcになっているが、添付のものを使うとよい(CPUの負担が軽くなるはず)。
どうもありがとうございました。BarsLimit」のオプションを追加 しようと思って いるのですが、うまく いきません。助けていただけませんか? お忙しい中、誠にありがとうございます。
エントロピ
以下は、そのオプションを追加したバージョンです。
こんにちはmladenは、私は宣言を解決するために教えることができます。
これは、私は警告を得るものです。
ありがとうございます。
こんにちはmladenは、私は宣言を解決するために教えることができます。
これは、私は警告を得るものです。
ありがとうございます。
まず、この。
とこれ
こんにちは、Mladen。
このコードで、修正すべき点を教えていただけませんか?
また、上位のタイムフレームになった場合、次のように変更することは可能でしょうか?
===> 1分~30分 ==> 10pips毎
===> 1時間足====> 50pips毎
===> 4時間足、日足================================100pips毎
===> 週足、月足 ===> 1000pips毎
線ではなく、長方形が希望です。
#プロパティ indicator_chart_window
#define ONDA_BEGINS 0
#define ONDA_CONTAINS 1
//+------------------------------------------------------------------+
//| カスタムインジケータ初期化関数
//+------------------------------------------------------------------+
int init()
{
//---- インジケーター
//----
return(0);
}
//+------------------------------------------------------------------+
//| カスタムインジケータ初期化関数
//+------------------------------------------------------------------+
int deinit()
{
//----
for (int ix = 0; ix < nLines; ix++) //横線を 削除する。
{
ObjectDelete("tensLines "+ix);
}
//----
return(0);
}
//+------------------------------------------------------------------+
//| カスタムインジケーターイテレーション関数
//+------------------------------------------------------------------+
int start()
{
int nLines = 40; // 描画する全ラインの数
double lineInterval = 0.0010; // ラインとラインの間の間隔
double normPrice = NormalizeDouble(Close[1],3); // 現在値は "10 "未満を四捨五入しています。
for (int ix = 0; ix < nLines; ix++) // ループスパン回数
{
if(ObjectFind("tensLines "+ix) < 0)
ObjectCreate("tensLines "+ix, OBJ_HLINE, 0, 0, normPrice+((ix-(nLines/2))*lineInterval)); // 現在の価格の上半分、下半分に配置する。
else ObjectSet("tensLines "+ix, OBJPROP_PRICE1, normPrice+((ix-(nLines/2))*lineInterval));
ObjectSet("tensLines "+ix,OBJPROP_COLOR,DarkSlateGray); // 線をきれいに見せる
}
//----
return(0);
}
//+------------------------------------------------------------------+
void ObjectNameDeleteAll(string name, int where=ONDA_BEGINS, int type=EMPTY)
{
for(int iObj=ObjectsTotal()-1; iObj >= 0; iObj--)
{
string on = ObjectName(iObj);
int iPos = StringFind(on, name);
if (iPos < 0) continue;
if (iPos > 0 && where == ONDA_BEGINS) continue;
if (type == EMPTY) ObjectDelete(on);
else if (type == ObjectType(on))ObjectDelete(on);
}
}
//---
こんにちは、Mladen。
このコードで、修正すべき点を教えていただけませんか?
また、上位のタイムフレームになった場合、次のように変更することは可能でしょうか?
===> 1分~30分 ==> 10pips毎
===> 1時間足====> 50pips毎
===> 4時間足、日足================================100pips毎
===> 週足、月足 ===> 1000pips毎
線ではなく、長方形が希望です。
#プロパティ indicator_chart_window
#define ONDA_BEGINS 0
#define ONDA_CONTAINS 1
//+------------------------------------------------------------------+
//| カスタムインジケータ初期化関数
//+------------------------------------------------------------------+
int init()
{
//---- インジケーター
//----
return(0);
}
//+------------------------------------------------------------------+
//| カスタムインジケータ初期化関数
//+------------------------------------------------------------------+
int deinit()
{
//----
for (int ix = 0; ix < nLines; ix++) // 横線を削除する。
{
ObjectDelete("tensLines "+ix);
}
//----
return(0);
}
//+------------------------------------------------------------------+
//| カスタムインジケーターイテレーション関数
//+------------------------------------------------------------------+
int start()
{
int nLines = 40; // 描画する全ラインの数
double lineInterval = 0.0010; // ラインとラインの間の間隔
double normPrice = NormalizeDouble(Close[1],3); // 現在値は "10 "未満を四捨五入しています。
for (int ix = 0; ix < nLines; ix++) // ループスパン回数
{
if(ObjectFind("tensLines "+ix) < 0)
ObjectCreate("tensLines "+ix, OBJ_HLINE, 0, 0, normPrice+((ix-(nLines/2))*lineInterval)); // 現在の価格の上半分、下半分に配置する。
else ObjectSet("tensLines "+ix, OBJPROP_PRICE1, normPrice+((ix-(nLines/2))*lineInterval));
ObjectSet("tensLines "+ix,OBJPROP_COLOR,DarkSlateGray); // 線をきれいに見せる
}
//----
return(0);
}
//+------------------------------------------------------------------+
void ObjectNameDeleteAll(string name, int where=ONDA_BEGINS, int type=EMPTY)
{
for(int iObj=ObjectsTotal()-1; iObj >= 0; iObj--)
{
string on = ObjectName(iObj);
int iPos = StringFind(on, name);
if (iPos < 0) continue;
if (iPos > 0 && where == ONDA_BEGINS) continue;
if (type == EMPTY) ObjectDelete(on);
else if (type == ObjectType(on))ObjectDelete(on);
}
}
//---
このようにします。
こんな風に試してみてください
わああなたは男だ。mladenさん、祝福のお言葉ありがとうございます。
もう一つお願いがあります。下の添付ファイル/ピックのようにグリッドを長方形にしていただけませんか。 例えば1つの長方形に10ピップス。長方形は未来を投影 させる。
デフォルトのグリッドよりも目に優しいような気がします。また、何pips動いているか確認するのに半瞬かかります。
}