ヘルプが必要です - ページ 2 12345678 新しいコメント Qæs 2014.02.15 18:24 #11 WHRoeder: tickvalueを 単体で使用しないhttps://www.mql5.com/en/forum/133792/page3#512466 あなたが伝えたかったことが理解できない。 pipValue = (MarketInfo(Symbol(),MODE_TICKVALUE))*10; 私でさえ、あなたが共有したリンクであなたのポイントを得ることができませんでした。私のコードで。 if (Digits == 5 || Digits == 3) { pips2dbl = Point*10; pips2point = 10; pipValue = (MarketInfo(Symbol(),MODE_TICKVALUE))*10; } else { pips2dbl = Point; pips2point = 1; pipValue = (MarketInfo(Symbol(),MODE_TICKVALUE))*1; } Slippage = pips2dbl*MaxSlippage; TP = pips2dbl*Limit_TP; SL = pips2dbl*Limit_SL; それを修正してもらえますか?そうすれば、もっと理解できると思います。 @RaptorUK 今回は... int i,j,k; and int i = 0, j, k; 両方ともうまくいき、エラーも出ませんでした。不思議です。でもやっぱり変更しました。 Qæs 2014.02.17 20:12 #12 https://docs.mql4.com/indicators/iama は今どこにあるのでしょうか? Simon Gniadkowski 2014.02.17 21:39 #13 qgmql: https://docs.mql4.com/indicators/iama は今どこにあるのでしょうか?壊れているので、サービスデスクにチケットを提出しました ... ... その間に... .... iMA 移動平均を計算し、その値を返します。 double iMA( string シンボル, // シンボル int timeframe, // timeframe int ma_period, // MA平均化期間 int ma_shift, // MAシフト int ma_method, // 平均化方法 int applied_price, // 適用価格 int shift // シフト ); パラメータ シンボル [インジケータが計算されるデータのシンボル名。NULL は現在のシンボルを表します。 タイムフレーム [in] タイムフレーム。ENUM_TIMEFRAMESの 列挙値のいずれかを指定することができます。0は現在のチャートのタイムフレームを意味します。 ma_period [in] 計算のための平均化期間。 ma_shift MAシフト[in] MAシフト。指標ラインのオフセットは、時間枠ごとのチャートに関連しています。 ma_method [in] 移動平均の算出方法。ENUM_MA_METHOD 列挙値のいずれかを指定可能。 Apply_price [in] 適用価格。ENUM_APPLIED_PRICE 列挙のいずれかの値である可能性があります。 シフト [in] インジケータ・バッファから取得した値のインデックス(現在のバーから指定された期間分前に相対的にシフト)。 返される値 移動平均インジケータの数値。 例 AlligatorJawsBuffer[i]=iMA(NULL,0,13,8,MODE_SMMA,PRICE_MEDIAN,i); Simon Gniadkowski 2014.02.18 08:25 #14 RaptorUK: 壊れています、サービスデスクにチケットを提出しました ... ... その間に... ... サポートチーム 2014.02.18 08:09直りました。ありがとうございます。 iMA() Qæs 2014.02.19 15:17 #15 Expert to Start機能には 何を使用すればよいのでしょうか? void ontick() { } return; //OR... int start() { } return(o); それとも、新しいメタ・エディターで両方使えるのでしょうか? (非常に基本的なことを聞いているつもりですが、実は知識ゼロで、これから勉強したいと思っています)。 Simon Gniadkowski 2014.02.19 16:20 #16 qgmql: Expert to Start機能には何を使用すればよいのでしょうか? それとも、新しいメタ・エディターで両方使えるのでしょうか? (非常に基本的なことを聞いているつもりですが、実は知識ゼロで、これから勉強したいと思っています)。 どちらを使ってもいいのですが、将来の互換性のためにOnTick() を使ってください。 Qæs 2014.02.24 18:31 #17 私のEAのための "LotsProgression "機能のコードを取得するために多くのことを試してみましたが、それは混乱しています。以下のソースで、ロットプログレッションのために書かれたコードをハイライトすることができますか?(そして、ここの ようにソースの一部をハイライトする方法も教えてください。 extern int expertId = 183547; extern int TakeProfit=40; extern int StopLoss=10; extern int BreakevenStop = 30; extern bool TimeEntry=true; extern string StartTime="7:00"; extern string StopTime="17:00"; extern bool PriceEntry=false; extern double Price=1.5500; extern bool FirstLong=false; extern string LotsProgression="0.1;0.1;0.2;0.3;0.4;0.6;0.8;1.1;1.5;2.0;2.7;3.6;4.7;6.2;8.0;10.2;13.0;16.5;20.8;26.3;33.1;41.6;52.2;65.5;82.5;103.9;130.9;165;207.9;262;330.1;416;524.7;661.1"; extern bool RestartNewCycle = true; extern int slippage=3; //slippage for market order processing extern int OrderTriesNumber=10; //to repeat sending orders when you receive an error or requote extern string EAName="PowerSM"; bool buysig,sellsig,cycleended; int tries,long,short,co,plen,lord,mord,lpos; double Lot,lots[],tlot,lop,lcp,lsl,ltp; double lbid = -1; int counter = 0; int init() { int i,j,k; string ls; while (true) { j=StringFind(LotsProgression,";",i); if (j>0) { ls=StringSubstr(LotsProgression,i,j-i); i=j+1; k++; ArrayResize(lots,k); lots[k-1]=StrToDouble(ls); } else { ls=StringSubstr(LotsProgression,i); k++; ArrayResize(lots,k); lots[k-1]=StrToDouble(ls); break; } } plen=ArraySize(lots); } void start() { //---- check for history and trading if(Bars<100 || IsTradeAllowed()==false) return; if (lbid == -1) lbid = Bid; co=CalculateCurrentOrders(); if (co > 0) counter = 1; CheckForSignals(); CheckForOpen(); DoBreakEven(BreakevenStop,0); lbid = Bid; } int CalculateCurrentOrders() { int ord; string c; //---- for(int i=0;i<OrdersTotal();i++) { if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==false) break; if(OrderSymbol()==Symbol() && OrderMagicNumber()==expertId) { ord++; if (OrderType()==OP_BUY) { mord=1; if (OrderClosePrice()-OrderOpenPrice()>BreakevenStop*Point) tlot=MathAbs(tlot); else tlot=-MathAbs(tlot); } if (OrderType()==OP_SELL) { mord=-1; if (-OrderClosePrice()+OrderOpenPrice()>BreakevenStop*Point) tlot=MathAbs(tlot); else tlot=-MathAbs(tlot); } c=StringSubstr(OrderComment(),0,StringFind(OrderComment(),"_",0)); lpos=StrToInteger(c); return(ord); } } //---- return orders volume return(ord); } double GetLastTrade() { int ord; lord=0; string c; //---- for(int i=OrdersHistoryTotal()-1;i>=0;i--) { if(!OrderSelect(i,SELECT_BY_POS,MODE_HISTORY)) continue; if(OrderSymbol()==Symbol() && OrderMagicNumber()==expertId) { if (OrderType()==OP_BUY) lord=1; if (OrderType()==OP_SELL) lord=-1; c=StringSubstr(OrderComment(),0,StringFind(OrderComment(),"_",0)); lpos=StrToInteger(c); lop = NormalizeDouble(OrderOpenPrice(), Digits); lcp = NormalizeDouble(OrderClosePrice(), Digits); lsl = NormalizeDouble(OrderStopLoss(), Digits); ltp = NormalizeDouble(OrderTakeProfit(), Digits); if (OrderProfit()>0) return(OrderLots()); else return(-OrderLots()); } } return(0); } bool IsEntryTime() { datetime tm0 = TimeCurrent(); datetime tm1 = StrToTime(TimeToStr(tm0, TIME_DATE) + " " + StartTime); datetime tm2 = StrToTime(TimeToStr(tm0, TIME_DATE) + " " + StopTime); bool isTm = false; if (tm1 <= tm2) isTm = isTm || (tm1 <= tm0 && tm0 < tm2); else isTm = isTm || (tm1 <= tm0 || tm0 < tm2); return (isTm); } void CheckForSignals() { buysig = false; sellsig = false; if (co > 0) return; if (TimeEntry) { bool cond = IsEntryTime(); if (!cond) return; } if (PriceEntry) { cond = ((Bid >= Price && lbid < Price) || (Bid <= Price && lbid > Price)); if (!cond) return; } double lastlot = GetLastTrade(); if (lastlot >= 0) { if (counter > 0) { if (!RestartNewCycle) return; } if (FirstLong) buysig = true; else sellsig = true; lpos = 0; Lot = lots[0]; } else { lpos++; int BE = 0; if (lord > 0 && lcp == lop+BE*Point) lpos--; if (lord < 0 && lcp == lop-BE*Point) lpos--; Lot = lots[lpos]; if (lord > 0) sellsig = true; else if (lord < 0) buysig = true; } } void CheckForOpen() { int res,tr,TP; //---- sell conditions if(sellsig && co==0) { Print("sell open ",Lot," ",lpos); res = OpenAtMarket(OP_SELL,Lot,TakeProfit,lpos); if (res>0) { tlot=Lot; } return; } //---- buy conditions if(buysig && co==0) { Print("buy open ",Lot," ",lpos); res = OpenAtMarket(OP_BUY,Lot,TakeProfit,lpos); if (res>0) { tlot=Lot; } return; } } int OpenAtMarket(int mode,double lot,int TP,int pos) { int res,tr,col; double openprice,sl,tp; tries=0; while (res<=0 && tries<OrderTriesNumber) { tr=0; while (tr<5 && !IsTradeAllowed()) { tr++; Sleep(2000); } RefreshRates(); if (mode==OP_SELL) { openprice=Bid; if (StopLoss>0) sl=openprice+StopLoss*Point; if (TP>0) tp=openprice-TP*Point; col=Red; } else { openprice=Ask; if (StopLoss>0) sl=openprice-StopLoss*Point; if (TP>0) tp=openprice+TP*Point; col=Blue; } res=OrderSend(Symbol(),mode,lot,openprice,slippage,sl,tp,pos+"_"+EAName+"_"+expertId,expertId,0,col); tries++; } Print("market order:: ",Symbol()," ",mode," ",lot," ",openprice," ",sl," ",tp," ",pos+"_"+EAName+"_"+expertId); if (res<=0) Print("error opening order : ",ErrorDescription(GetLastError())); return(res); } void DoBreakEven(int BP, int BE) { bool bres; for (int i = 0; i < OrdersTotal(); i++) { if ( !OrderSelect (i, SELECT_BY_POS) ) continue; if ( OrderSymbol() != Symbol() || OrderMagicNumber() != expertId ) continue; if ( OrderType() == OP_BUY ) { if (Bid<OrderOpenPrice()+BP*Point) continue; if ( OrderOpenPrice()+BE*Point-OrderStopLoss()>Point/10) { //Print(BP," ",BE," bestop"); bres=OrderModify (OrderTicket(), OrderOpenPrice(), OrderOpenPrice()+BE*Point, OrderTakeProfit(), 0, Black); if (!bres) Print("Error Modifying BE BUY order : ",ErrorDescription(GetLastError())); } } if ( OrderType() == OP_SELL ) { if (Ask>OrderOpenPrice()-BP*Point) continue; if ( OrderStopLoss()-(OrderOpenPrice()-BE*Point)>Point/10) { //Print(BP," ",BE," bestop"); bres=OrderModify (OrderTicket(), OrderOpenPrice(), OrderOpenPrice()-BE*Point, OrderTakeProfit(), 0, Gold); if (!bres) Print("Error Modifying BE SELL order : ",ErrorDescription(GetLastError())); } } } return; } /* int FindPos(double ls) { for (int i=0; i<plen; i++) { if (NormalizeDouble(MathAbs(lots[i]-ls),3)<0.001) return(i); } return(-1); } */ William Roeder 2014.02.24 19:03 #18 qgmql: 以下のソースの中で、lotsプログレッションのために書かれたコードをハイライトしてください。(また、ソースの一部をハイライト する方法を教えてください。 initではextern string LotsProgression="0.1;0.1;0.2;0.3;0.4;0.6;0.8;1.1;1.5;2.0;2.7;3.6;4.7;6.2;8.0;10.2;13.0;16.5;20.8;26.3;33.1;41.6;52.2;65.5;82.5;103.9;130.9;165;207.9;262;330.1;416;524.7;661.1"; になる double lots[] インデントを修正すれば、lots[] が使われていることがわかるはずです。double lastlot = GetLastTrade(); if (lastlot >= 0){ if (counter > 0){ if (!RestartNewCycle) return; } if (FirstLong) buysig = true; else sellsig = true; lpos = 0; Lot = lots[0]; } else{ lpos++; int BE = 0; if (lord > 0 && lcp == lop+BE*Point) lpos--; if (lord < 0 && lcp == lop-BE*Point) lpos--; Lot = lots[lpos]; if (lord > 0) sellsig = true; else if (lord < 0) buysig = true; } if (lord > 0 && lcp == lop+BE*Point) オペランドは==です。- MQL4フォーラム qjol 2014.02.24 19:10 #19 qgmql: 私のEAのための "LotsProgression "機能のコードを取得するためにたくさん試しましたが、それは混乱します。 何が問題なのか説明できますか? James Hodges 2014.02.24 19:45 #20 この#property strictでは、i,j,kを値で初期化する必要があると思うのですが...。 int i=0,j=0,k=0; PipPip...ジムダンディ 12345678 新しいコメント 取引の機会を逃しています。 無料取引アプリ 8千を超えるシグナルをコピー 金融ニュースで金融マーケットを探索 新規登録 ログイン スペースを含まないラテン文字 このメールにパスワードが送信されます エラーが発生しました Googleでログイン WebサイトポリシーおよびMQL5.COM利用規約に同意します。 新規登録 MQL5.com WebサイトへのログインにCookieの使用を許可します。 ログインするには、ブラウザで必要な設定を有効にしてください。 ログイン/パスワードをお忘れですか? Googleでログイン
tickvalueを 単体で使用しないhttps://www.mql5.com/en/forum/133792/page3#512466
あなたが伝えたかったことが理解できない。
私でさえ、あなたが共有したリンクであなたのポイントを得ることができませんでした。私のコードで。
それを修正してもらえますか?そうすれば、もっと理解できると思います。
@RaptorUK 今回は...
両方ともうまくいき、エラーも出ませんでした。不思議です。でもやっぱり変更しました。
https://docs.mql4.com/indicators/iama は今どこにあるのでしょうか?
壊れているので、サービスデスクにチケットを提出しました ... ... その間に... ....
iMA
移動平均を計算し、その値を返します。
double iMA(
string シンボル, // シンボル
int timeframe, // timeframe
int ma_period, // MA平均化期間
int ma_shift, // MAシフト
int ma_method, // 平均化方法
int applied_price, // 適用価格
int shift // シフト
);
パラメータ
シンボル
[インジケータが計算されるデータのシンボル名。NULL は現在のシンボルを表します。
タイムフレーム
[in] タイムフレーム。ENUM_TIMEFRAMESの 列挙値のいずれかを指定することができます。0は現在のチャートのタイムフレームを意味します。
ma_period
[in] 計算のための平均化期間。
ma_shift
MAシフト[in] MAシフト。指標ラインのオフセットは、時間枠ごとのチャートに関連しています。
ma_method
[in] 移動平均の算出方法。ENUM_MA_METHOD 列挙値のいずれかを指定可能。
Apply_price
[in] 適用価格。ENUM_APPLIED_PRICE 列挙のいずれかの値である可能性があります。
シフト
[in] インジケータ・バッファから取得した値のインデックス(現在のバーから指定された期間分前に相対的にシフト)。
返される値
移動平均インジケータの数値。
例
AlligatorJawsBuffer[i]=iMA(NULL,0,13,8,MODE_SMMA,PRICE_MEDIAN,i);
壊れています、サービスデスクにチケットを提出しました ... ... その間に... ...
Expert to Start機能には 何を使用すればよいのでしょうか?
それとも、新しいメタ・エディターで両方使えるのでしょうか?
(非常に基本的なことを聞いているつもりですが、実は知識ゼロで、これから勉強したいと思っています)。
Expert to Start機能には何を使用すればよいのでしょうか?
それとも、新しいメタ・エディターで両方使えるのでしょうか?
(非常に基本的なことを聞いているつもりですが、実は知識ゼロで、これから勉強したいと思っています)。
私のEAのための "LotsProgression "機能のコードを取得するために多くのことを試してみましたが、それは混乱しています。以下のソースで、ロットプログレッションのために書かれたコードをハイライトすることができますか?(そして、ここの ようにソースの一部をハイライトする方法も教えてください。
double lots[]
私のEAのための "LotsProgression "機能のコードを取得するためにたくさん試しましたが、それは混乱します。
何が問題なのか説明できますか?
この#property strictでは、i,j,kを値で初期化する必要があると思うのですが...。
int i=0,j=0,k=0;
PipPip...ジムダンディ