I think the answer can only be found in mathematics or in real trading experience. I think it is too bad that I have none of them. Thanks for the link.
If you don't know anything about maths but you cannot trade, you need to learn and you will eventually succeed!
I advise to start manual trading with CCI(55) and MA(55) at M5 GBPJPY with Fibonacci number and within that number find your period (today mine is 67), good luck!
Yes, I almost forgot, trading time is also very important, namely the opening of the trading session of the region whose currency is major (and america...).
Can anyone check if everything is correct in this module:
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++// MOVE SL TO BEif( Mode_Close_Part_Set_BE_1==true&&OrdersTotal()>0){for(int cnt_BE=0; cnt_BE<OrdersTotal(); cnt_BE++){OrderSelect( cnt_BE, SELECT_BY_POS);// the next line will check for ONLY market trades, not entry orders
Ticket =OrderTicket();// BUY -----------------------------------------------------------------------------------------if(OrderType()==OP_BUY&&OrderSymbol()==Symbol()&&OrderStopLoss()<OrderOpenPrice()&&Ask>=(OrderOpenPrice()+MathAbs(OrderOpenPrice()-OrderStopLoss()))){double SL_Original_Buy =OrderStopLoss();bool AnsHalfModifySL_Buy =OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice(),OrderTakeProfit(),0,Green);Sleep( Slippage*3000);if( AnsHalfModifySL_Buy==true){
BreakEvenStatus_Buy =true;Alert("SL Buy which was ", SL_Original_Buy," set to BreakEven at ",OrderStopLoss()," for ",Symbol());}if( Fun_Error(GetLastError())==1){// Обработка ошибокcontinue;// Повторная попытка}return;// Выход из start()}// if(OrderType() == OP_BUY && OrderSymbol()==Symbol() )// EO BUY -----------------------------------------------------------------------------------------// SELL -----------------------------------------------------------------------------------------if(OrderType()==OP_SELL&&OrderSymbol()==Symbol()&&OrderStopLoss()>OrderOpenPrice()&&Bid<=(OrderOpenPrice()-MathAbs(OrderStopLoss()-OrderOpenPrice()))){double SL_Original_Sell =OrderStopLoss();bool AnsHalfModifySL_Sell =OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice(),OrderTakeProfit(),0,Blue);Sleep( Slippage*3000);if( AnsHalfModifySL_Sell==true){
BreakEvenStatus_Sell =true;Alert("SL Sell which was ", SL_Original_Sell," set to BreakEven at ",OrderStopLoss()," for ",Symbol());}if( Fun_Error(GetLastError())==1){// Обработка ошибокcontinue;// Повторная попытка}return;// Выход из start()}// if(OrderType() == OP_SELL && OrderSymbol()==Symbol() )// EO SELL -----------------------------------------------------------------------------------------}// for(cnt_BE=0; cnt_BE<OrdersTotal(); cnt_BE++)}// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
I'm asking because after each call the message "Error 0 has occurred" appears, although everything seems to be working correctly (going to break-even).
Can anyone check if everything is correct in this module:
I'm asking because after each call the following message appears: "Error 0 has occurred", although everything seems to be working correctly (going to breakeven).
Most likely an attempt to modify an order at old prices. We should compare the new and old order parameters. And it should be modified only if necessary.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
If you mean locking, you don't understand ---- I don't insist on it, I don't know how to use it.
Close a part of unprofitable positions? ------ I think so, but I have not tried it yet.
I do not know how to use it myself.
https://www.mql5.com/ru/code/9185
Manually tester the answer can only be found there (or in the demo) here is the link to the simulator
https://www.mql5.com/ru/code/9185
I think the answer can only be found in mathematics or real trading experience. It's too bad that I have neither. Thanks for the link.
I think the answer can only be found in mathematics or in real trading experience. I think it is too bad that I have none of them. Thanks for the link.
If you don't know anything about maths but you cannot trade, you need to learn and you will eventually succeed!
I advise to start manual trading with CCI(55) and MA(55) at M5 GBPJPY with Fibonacci number and within that number find your period (today mine is 67), good luck!
Yes, I almost forgot, trading time is also very important, namely the opening of the trading session of the region whose currency is major (and america...).
I'm asking because after each call the message "Error 0 has occurred" appears, although everything seems to be working correctly (going to break-even).
I'm asking because after each call the following message appears: "Error 0 has occurred", although everything seems to be working correctly (going to breakeven).
Most likely an attempt to modify an order at old prices. We should compare the new and old order parameters. And it should be modified only if necessary.
Error 0 occurs when OrderModify does not actually modify anything - it changes the price to the old one.
Here is an Example:
An order was opened with SL=1.1596. Then the SL changed to 1.1570, and finally this error.
It cannot go the second round because there is a condition:
- What could it be?
Here is an Example:
An order was opened with SL=1.1596. Then the SL changed to 1.1570, and finally this error.
It cannot go the second round because there is a condition:
- What could it be?
It could. Check the logical conditions again, but only in the morning.
What's in the logic is what allows it to do.
Maybe. Check the logical conditions again, but only in the morning.
What's built into the logic allows you to do that.
I'll check. >> thank you!
Help
Note: in testing, the last known server time is simulated.
But in indicator, when testing, last known server time is not simulated. should it be?