und bitte beheben Sie die Fehler oder geben Sie mir einige Hinweise
//+------------------------------------------------------------------+//| every tick20.mq4 |//| mohsin mewati |//| |//+------------------------------------------------------------------+#property copyright"mohsin mewati"#property link""//+------------------------------------------------------------------+//| expert initialization function |//+------------------------------------------------------------------+int init()
{
//----int order_open_time_buy =0;//intiger to save buy open Timeint order_open_time_sell =0;//intiger to save sell open Timebool err_close_all_orders =0;//bolean to save get last error for close all opened orders codebool err_sell=0;
bool err_buy=0;
bool err_selection_buy=0;
bool err_selection_sell=0;
bool buy_modified=0;
bool sell_modified=0;
double mf_buy=0;
double mf_sell=0;
int buy_trail=0;
int err_trail_buy=0;
int err_modify_sell=0;
int buy_selection=0;
bool buy_open_price=0;
int sell_selection=0;
//----return(0);
}
//+------------------------------------------------------------------+//| expert start function |//+------------------------------------------------------------------+//----int start()
{
bool err_buy;
int buy_ticket;
bool err_sell;
int sell_ticket;
bool err_selection_buy;
int buy_selection;
double buy_open_price;
bool err_selection_sell;
int sell_selection;
bool err_mf_buy;
bool srr_mf_sell;
bool err_mf_sell;
bool err_trail_buy;
bool err_modify_sell;
bool buy_modified;
bool err_trail_sell;
bool err_modify_buy;
//coding startswhile(err_buy=1){//for loop started to execute a buy Order
buy_ticket=OrderSend(Symbol(),OP_BUY,1,Ask,3,Ask+20*Point,0,Green); //code to execute a buy (buy order placed without SL but with a TP of 20 pips
err_buy=GetLastError;//code to check either buy is executed or not?
}//for loop endwhile(err_sell=1){//for loop to place a sell order
sell_ticket = OrderSend(Symbol(),OP_SELL,1,Ask,3,Ask-20*Point,0,Red);//code to place a sell ,order placed without SL but with a TP of 20 pips
err_sell=GetLastError;//code to check either sell is placed or not?
}//for loop endsAlert();
//__________________________________________________________________________________________________________________________________while(err_selection_buy="true"){// for loop start to selection of first executed order for further procedure
buy_selection=OrderSelect("Buy_ticket",SELECT_BY_TICKET);//order select and stored in intiger
err_selection_buy=GetLastError;//code to check eithet order is selected or not
}//for loop ends
buy_open_price=OrderOpenPrice;//taking open price for the first selected orderwhile(err_selection_sell="true"){// for loop start to selection of second executed order for further procedure
sell_selection=OrderSelect("Sell_ticket",SELECT_BY_TICKET);//order select and stored in intiger
err_selection_sell=GetLastError;//code to check eithet order is selected or not
}//for loop endsint sell_open_price=OrderOpenPrice;//taking open price for the second selected orderwhile("buy_trail=1"; "Sell_trail=1"){// while loop started to check if thow of them or one is truewhile (err_mf_buy="true" && "err_mf_sell="true""){//while loop start to take price quote every time for buy and selldouble mf_buy=MarketInfo("GBPUSD",MODE_POINT);//code to store markeet info in integer mf_buy
err_mf_buy=GetLastError;//code to confirm the previous line of code executed? double mf_sell=MarketInfo("GBPUSD",MODE_POINT);//code to store markeet info in integer mf_sell
err_mf_sell=GetLastError;//code to confirm the previous line of code executed?
}
if(mf_buy-20=>buy_open_price && "Buy_trail=0"){//if condition to compare if current markeet quote which stored in mf_buy is 20 times greater than the open price of buy Order?while(err_trail_buy="true"){//if above condition true for loop started to start trailing on buy order.OrderModify(buy_ticket,buy_open_price,+20*TrailingStop);//code to start trailig stop on buy for 5 pips since our buy is in 20 pips profit the trail start at 15 pips
err_trail_buy=GetLastError;//code to confirm the previous line of code executed?
}
while(err_modify_sell="true"){//if buy is in profit for 20 pips and trailing stop started on it i want my sell to modify for take profit for just 5 pips.OrderModify("Sell_ticket", double stoploss,Order_Open_Price-5,"ORANGE" )//code to modify sell for tp just for 5 pips
err_modify_sell=GetLastError;//code to confirm the previous line of code executed?
buy_trail=1;//intiger use to remember that the buy was in profit and all the cooding associated with it was executed there is no need to check .
}
elseif (mf_sell+20<="Sell_open_price" && "Sell_trail=0"){//another logical test to check if buy was not in 20 pips if our sell is in 20 pips profit if so then in the next for loop statrtedwhile(err_trail_sell="true"){//for loop start to modify sell for trailOrderModify(sell_ticket),sell_open_price,-20*TrailingStop,);//code to modify sell for trailing as above mentioned for buy sell is also for 20 pips and if it is in 20 pips profit trailing start on 15 pips
err_trail_sell=GetLastError;//code to confirm the previous line of code executed?
}
while(err_modify_buy="true"){//if our sell is in 20 pips profit and trailing executed on it while loop start to modify buy for tp for just 5 pips OrderModify( buy_ticket, doubleOrderOpenPrice+5, color arrow_color="blue")//code to modify buy for tp just 5 pips
err_modify_buy=GetLastError;//code to confirm the previous line of code executed?
sell_trail=1;//intiger use to remember that the sell was in profit and all the cooding associated with it was executed there is no need to check .
}
}
}
}
//----return(0);
}
//+------------------------------------------------------------------+//+------------------------------------------------------------------+//| expert deinitialization function |//+------------------------------------------------------------------+int deinit()
{
//----//----return(0);
}
mohsin360: Wenn du ihn im Meta-Editor kompilierst, zeigt er dir einige Fehler an.
Also beheben Sie sie ... warum erwarten Sie, dass jemand anderes es für Sie tut?
Haben Sie durch diesen Code lesen?
bool err_buy; // as you can see err_buy is a bool//coding startswhile(err_buy=1){//for loop started to execute a buy Order // err_buy is a bool
buy_ticket=OrderSend(Symbol(),OP_BUY,1,Ask,3,Ask+20*Point,0,Green); //code to execute a buy (buy order placed without SL but with a TP of 20 pips
err_buy = GetLastError;//code to check either buy is executed or not? // err_buy is a bool
}//for loop end
ja err_buy ist ein bolean speichert zwei Werte true oder false 0 oder 1
zuerst deklariere ich es, dann verwende ich es in der Schleife, um einen Kaufauftrag auszuführen, und dann prüfe ich, ob der Kauf ausgeführt wird oder nicht. Bitte sagen Sie mir, was das Problem ist, und mein Programm hat nur 8 Fehler, und ich sehe auf dieser Website, die Sie Jungs helfen viel, ich weiß, dass Sie es tun können.
ja err_buy ist ein bolean speichert zwei Werte true oder false 0 oder 1
zuerst deklariere ich es, dann verwende ich es in der Schleife, um einen Kaufauftrag auszuführen, und dann prüfe ich, ob der Kauf ausgeführt wird oder nicht. Bitte sagen Sie mir, was das Problem ist, und mein Programm hat nur 8 Fehler, und ich sehe auf dieser Website, die Sie Jungs helfen viel, ich weiß, dass Sie es tun können.
Und was für ein Typ gibt OrderSend() zurück? ein bool? bitte lesen Sie die Dokumentation. ..
order send gibt die Ticketnummer der ausgeführten Bestellung zurück, z.B. 355487936, und so deklariere ich die Variable buy_ticket als intiger, die Zahlen speichert
order send gibt die Ticketnummer der ausgeführten Bestellung zurück, z.B. 355487936, und so deklariere ich die Variable buy_ticket als intiger, die Zahlen speichert
Entschuldigung . . mein Problem, ich habe Ihren Code falsch gelesen.
Ok mt Fehler ich einfügen Codes aus der Reihenfolge
hier füge ich noch einmal ein, damit es leicht zu verstehen ist
hier ist der Code, aus dem ich schnell K in einem intiger und D in einem anderen intiger extrahieren möchte.
und bitte beheben Sie die Fehler oder geben Sie mir einige Hinweise
und bitte beheben Sie die Fehler oder geben Sie mir einige Hinweise
Wenn du ihn im Meta-Editor kompilierst, zeigt er dir einige Fehler an.
Also beheben Sie sie ... warum erwarten Sie, dass jemand anderes es für Sie tut?
Haben Sie durch diesen Code lesen?
ja err_buy ist ein bolean speichert zwei Werte true oder false 0 oder 1
zuerst deklariere ich es, dann verwende ich es in der Schleife, um einen Kaufauftrag auszuführen, und dann prüfe ich, ob der Kauf ausgeführt wird oder nicht. Bitte sagen Sie mir, was das Problem ist, und mein Programm hat nur 8 Fehler, und ich sehe auf dieser Website, die Sie Jungs helfen viel, ich weiß, dass Sie es tun können.
ja err_buy ist ein bolean speichert zwei Werte true oder false 0 oder 1
zuerst deklariere ich es, dann verwende ich es in der Schleife, um einen Kaufauftrag auszuführen, und dann prüfe ich, ob der Kauf ausgeführt wird oder nicht. Bitte sagen Sie mir, was das Problem ist, und mein Programm hat nur 8 Fehler, und ich sehe auf dieser Website, die Sie Jungs helfen viel, ich weiß, dass Sie es tun können.
buy_ticket=OrderSend
order send gibt die Ticketnummer der ausgeführten Bestellung zurück, z.B. 355487936, und so deklariere ich die Variable buy_ticket als intiger, die Zahlen speichert
buy_ticket=OrderSend
order send gibt die Ticketnummer der ausgeführten Bestellung zurück, z.B. 355487936, und so deklariere ich die Variable buy_ticket als intiger, die Zahlen speichert
Bitte helfen Sie mir mit dem Code, wenn ich kompilieren es zeigt mir eoors
Debes poner for (int i = ArraySize(MyArray)-StochPeriod-1; i >= 0; i--)