Experts: LacusTstopandBE

 

LacusTstopandBE:

An assistant EA for manual trading. Sets Stop loss, Take profit, moves positions to breakeven and applies trailing.

Author: Vladimir Karputov

 
Can you please tell me if breakeven and trailing works in invisible mode? I'm trying it and it doesn't want to work. Stop loss and take profit works in invisible mode, but trailing doesn't want to. Thank you. I'm waiting for an answer.
 
Znatok2604:
Can you please tell me if breakeven and trailing works in invisible mode? I tried it and it does not want to work. Stop loss and take profit works in invisible mode, but trailing does not want to. Thank you. Waiting for an answer.

I don't know what input parameters you are using. Please save your parameters to a set file and attach it to your message.

Also pay attention to the parameter "Stealth mode for Stoploss and Takeprofit values".

 
Znatok2604:
Can you please tell me if breakeven and trailing works in invisible mode? I tried it and it does not want to work. Stop loss and take profit works in invisible mode, but trailing does not want to. Thank you. Waiting for an answer.

I understand your question. I answer: in invisible mode only closing Stop Loss and Take Profit, closing on profit or closing all functions work, and in normal mode all functions work.

//+------------------------------------------------------------------+
//| Expert tick function|
//+------------------------------------------------------------------+
void OnTick()
  {
//---
   if(STEALTH==false)
     {
      SetSLTP();         //function for setting SL and TP for orders
      Movebreakeven();   //moving to "InpBreakeven" pips after reaching "InpBreakevenGain" pips
      TrailingStop();    //trailing stop after reaching InpTrailingStart pips 
      CloseOnProfit();   //close order on actual pair if orderprofit reached x amount of acc currency
      CloseAll();  //close all opened orders/buy and sell/ if profit on account reached x percent of balance, or profit reached the x profit amount in acc currency, for example 12 euros.
     }
   else
     {
      CloseonStealthSLTP();
      CloseOnProfit();
      CloseAll();
     }
  }
 
Thanks for the answer, I understand. It's a pity that it doesn't work in invisible trailing mode, it would be great.
 
I open the Expert Advisor, it is added to the chart, but it only works for BUY, but not for Sell, why is that?
 
LuisClaros :
I open the Expert Advisor, it is added to the chart, but it only works for BUY, but not for Sell, why is that?

The advisor DOES NOT BUY! Description:

Example

We open Buy position without specifying Stop Loss and Take Profit. The EA sets the predefined values of Stop Loss and Take Profit.

Let's assume that the price moves in a favourable direction and makesBreakeven Gain after reaching x pips profit points . The EA sets the breakeven point toBreakeven x pips locked in profit points . The price moves up and our EA drags the StopLoss level following the price: eachTrailing Start after reaching x pips points drags the Stop Loss level toTrailing Stop distance from current price points .

 
This EA is great, however it appears it only sets the stop loss and take profits to BUY orders and not SELL orders. Can this be fixed?
 
mlewk1101 :
This EA is great, however it appears it only sets the stop loss and take profits to BUY orders and not SELL orders. Can this be fixed?

This is a technical forum. A correctly asked question on the technical forum includes: a description of the settings, a description of the symbol, a description of the timeframe, you must attach a log file.


Bottom line: the adviser works great.

Settings:


Result:


Log file:

        2020.01.29 00:00:00   CTrade::OrderSend: instant sell 0.01 EURUSD at 1.10220 [requote (1.10219/1.10225)]
        2020.01.29 00:00:01   instant sell 0.01 EURUSD at 1.10219 (1.10219 / 1.10225 / 1.10219)
        2020.01.29 00:00:01   deal #2 sell 0.01 EURUSD at 1.10219 done (based on order #2)
        2020.01.29 00:00:01   deal performed [#2 sell 0.01 EURUSD at 1.10219]
        2020.01.29 00:00:01   order performed sell 0.01 at 1.10219 [#2 sell 0.01 EURUSD at 1.10219]
        2020.01.29 00:00:01   CTrade::OrderSend: instant sell 0.01 EURUSD at 1.10219 [done at 1.10219]
        2020.01.29 09:17:41   position modified [#2 sell 0.01 EURUSD 1.10219 sl: 1.10119]
        2020.01.29 09:17:41   CTrade::OrderSend: modify position #2 EURUSD (sl: 1.10119, tp: 0.00000) [done]
 
hello Lacus, sorry for boring you, i just need to ask you if you can add the possibility to write a comment (just to identify each trades) and the possibility to add a magic number. Many thanks, ciao, have a nice day. Fabio
 
baccicin:
hello Lacus, sorry for boring you, i just need to ask you if you can add the possibility to write a comment (just to identify each trades) and the possibility to add a magic number. Many thanks, ciao, have a nice day. Fabio

No. Read the description: "The Expert Advisor is only designed for manual trading. The EA sets stop loss and take profit for positions and pending orders on the current symbol. It also has trailing stop and breakeven functions." That is why the EA uses Magic equal to '0' - since a position opened manually has Magic '0'.