Breakeven stoploss

İş Gereklilikleri

Hello


The code below is for moving stop loss to breakeven after price has moved a certain amount of pips past OrderOpenPrice.

i.e Sell trade - move stop to 4 pips below breakeven when price has moved 7pips + 4pips below breakeven.


My trade entry is set to open of a candle but due to slippage OrderOpenPrice is not always at candle open. I need the code below altered to include slippage or to move stoploss at candle open not OrderOpenPrice



void TrailingStopBE(int type, double profit, double add) //set Stop Loss to open price if in profit

  {
   int total = OrdersTotal();
   profit = NormalizeDouble(profit, Digits());
   for(int i = total-1; i >= 0; i--)
  rderOpenPrice() + add, 0);   {
      while(IsTradeContextBusy()) Sleep(100);
      if(!OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) continue;
      if(OrderMagicNumber() != MagicNumber || OrderSymbol() != Symbol() || OrderType() != type) continue;
      RefreshRates();
      if((type == OP_BUY && Bid >  OrderOpenPrice() + profit && (NormalizeDouble(OrderStopLoss(), Digits()) <= 0 || OrderOpenPrice() > OrderStopLoss()))
      || (type == OP_SELL && Ask < OrderOpenPrice() - profit && (NormalizeDouble(OrderStopLoss(), Digits()) <= 0 || OrderOpenPrice() < OrderStopLoss())))
         myOrderModify(OrderTicket(),O

     }


TrailingStopBE(OP_BUY, 90 * myPoint, 0 + 40 * myPoint); //Trailing Stop = go break even + fixed value

   TrailingStopBE(OP_SELL, 90 * myPoint, 0 - 40 * myPoint); //Trailing Stop = go break even - fixed value

Yanıtlandı

1
Geliştirici 1
Derecelendirme
(63)
Projeler
68
25%
Arabuluculuk
12
42% / 42%
Süresi dolmuş
4
6%
Serbest
2
Geliştirici 2
Derecelendirme
(21)
Projeler
23
0%
Arabuluculuk
6
17% / 83%
Süresi dolmuş
2
9%
Serbest
3
Geliştirici 3
Derecelendirme
(879)
Projeler
1392
67%
Arabuluculuk
117
32% / 42%
Süresi dolmuş
215
15%
Serbest
4
Geliştirici 4
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
5
Geliştirici 5
Derecelendirme
(1)
Projeler
2
0%
Arabuluculuk
3
0% / 100%
Süresi dolmuş
0
Serbest
6
Geliştirici 6
Derecelendirme
(303)
Projeler
384
20%
Arabuluculuk
43
60% / 23%
Süresi dolmuş
45
12%
Meşgul
7
Geliştirici 7
Derecelendirme
(169)
Projeler
204
30%
Arabuluculuk
25
40% / 44%
Süresi dolmuş
12
6%
Serbest
8
Geliştirici 8
Derecelendirme
(596)
Projeler
928
46%
Arabuluculuk
31
39% / 29%
Süresi dolmuş
93
10%
Serbest
9
Geliştirici 9
Derecelendirme
(23)
Projeler
23
57%
Arabuluculuk
2
50% / 0%
Süresi dolmuş
0
Serbest
10
Geliştirici 10
Derecelendirme
(37)
Projeler
37
24%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
11
Geliştirici 11
Derecelendirme
(126)
Projeler
151
48%
Arabuluculuk
6
83% / 17%
Süresi dolmuş
2
1%
Serbest
12
Geliştirici 12
Derecelendirme
(15)
Projeler
17
6%
Arabuluculuk
1
0% / 100%
Süresi dolmuş
1
6%
Serbest
13
Geliştirici 13
Derecelendirme
(196)
Projeler
318
35%
Arabuluculuk
64
13% / 56%
Süresi dolmuş
82
26%
Serbest
14
Geliştirici 14
Derecelendirme
(34)
Projeler
60
23%
Arabuluculuk
11
73% / 9%
Süresi dolmuş
3
5%
Serbest
15
Geliştirici 15
Derecelendirme
(3)
Projeler
4
0%
Arabuluculuk
1
100% / 0%
Süresi dolmuş
0
Serbest
16
Geliştirici 16
Derecelendirme
(42)
Projeler
49
47%
Arabuluculuk
1
100% / 0%
Süresi dolmuş
1
2%
Serbest
Benzer siparişler
Life Creator 40 - 1000 USD
the topic of this robot is ,,life creator'' becouse when you have no idea what to do, this robot can help you and teach you how you can do it. The robot gonna creat you your own tactics which can help you in future. When you gonna see that it's really work you start to be happy and you gonna want to have more of this
I need ea that based on point and finger chart formula point and finger chart does not follow time frame only price based and point and finger chart has same functions as given below source > HL/close box size assignment method > traditional reversal > 1 or given as request box size > 0.00 lot size > 0.00 trailing stop in box > one box behind or as given must not follow time only price based X
I need the following modules as per this sample indicator, then integrated with RSD Candles. look into the sample input settings, ................................................. ......................................................................................................... .......................................................................................................... ................previous
You need to be able to convert the IBS Indicator which is written like this in ProRealCode: r = max(range,0.0001) ibs = (close-low)/r Also, you need to be able to convert the Momentum indicator written like this in ProRealCode: https://www.prorealcode.com/documentation/momentum/ Return value of the Momentum technical indicator of the Nth bar : (close – close of the N-th last bar). 1 Momentum [ N ] Calculation: It is
Hft live account 30 - 200 USD
i need a high frequency trading (hft) expert advisor, that can be used to trade on demo and live accounts icmarket and 8cap. The EA has to be highly profitable, giving daily profit. If a test version is available, please send, to foster a faster transaction. like the ones that pass prop firm and demo but adjustment where it work on live with low latency
Hello [Programmer's Name], I hope this message finds you well. I am seeking your expertise to develop a forex Expert Advisor (EA) capable of identifying trading opportunities based on crossover signals from the following indicators: - MACD - RSI (including Connor RSI) - Stochastic RSI - Stochastic - Moving Averages (MA) with periods: 5, 10, 20, 50, 100, and 200 Key requirements for the EA include: - Integration of
Hello, i need a robot for gold trading being able to determine a trend or instant changes on a micro scale so its just going to scalp very fast but, for example lets say we have an equity of 500 bucks it needs to take profit at 5 and open a new position and just continiue going like that all day, but i also want it to determine buying opportunities based off of a very wide range of candlestick data of gold the day
CPI ROBOKING 30+ USD
*Strategy: CPI-Based Trading* *Instruments:* XAUUSD (Gold), UsTech100 (Nasdaq 100), USDJPY *CPI Release:* 1. *Higher-than-expected CPI:* - XAUUSD: SELL (Gold prices may drop due to potential rate hike) - UsTech100: SELL (Tech stocks may drop due to potential rate hike) - USDJPY: BUY (USD may strengthen due to potential rate hike) 2. *Meets or lower-than-expected CPI:* - XAUUSD: BUY (Gold prices may rise due
Hello, I have an EA already created and what I require is a modification to the code so that when a backtest is executed, it generates a CSV file with custom data that I want to extract to perform an analysis of the backtest operations
Create mt4 ea 50+ USD
To convert the provided MT4 indicator script into an Expert Advisor (EA) and implement prompt functionality for user input, we need to modify the code to handle external parameters and provide a user-friendly interface. Below is the EA code that incorporates prompts for user inputs

Proje bilgisi

Bütçe
30+ USD
KDV (23%): 6.9 USD
Toplam: 36.9 USD
Geliştirici için
27 USD