仕事が完了した
実行時間1 日
依頼者からのフィードバック
very good and fast
開発者からのフィードバック
Thank you very much, super customer!
指定
Hello,
i have 1 issue with my stop loss, when the order is passed, there is 1 case where the stop loss does not activate.
The case is :
For short position :
- when the order is passed and the entry is below the close of the bar, the stop loss is not activated
For long position :
- when the order is passed and the entry is above the close of the bar, the stop loss is not activated
here the exit code :
input int InpNormalizeDouble = 4; input int atrlength = 48; double vAtr; vAtr = iATR(NULL,0,atrlength,0); input double factorSL = 1.00; //--- it is important to enter the market correctly, but it is more important to exit it correctly... for(cnt=0;cnt<total;cnt++) { if(!OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES)) continue; if(OrderType()<=OP_SELL && // check for opened position OrderSymbol()==Symbol())// && // check for symbol { //--- long position is opened if(OrderType()==OP_BUY) { //Print(""+OrderMagicNumber()); switch(OrderMagicNumber()) { case 1: //int mtime = iBarShift(_Symbol, 0, OrderOpenTime()); //iClose(_Symbol,0,0) //iTime(_Symbol,0,0) //if((bRegHigh1 < High[0] && xbars1L < xNumberbars) || bRegHigh1 == 0) //{ // bRegHigh1 = High[0]; // xbars1L++; //} bRegHigh1 = HHsinceEntry(OrderOpenTime()); //exitpriceL1 = NormalizeDouble(bRegHigh1 - (bRegHigh1 *(vAtr / OrderOpenPrice())*1.55),InpNormalizeDouble); exitpriceL1 = bRegHigh1 - (bRegHigh1 *(vAtr / OrderOpenPrice())*factorSL); //Print("bRegHigh1: "+bRegHigh1); //Print("exitpriceL1: "+exitpriceL1); //Print("vAtr: "+vAtr); //Print("OrderOpenPrice(): "+OrderOpenPrice()); //Print("==============================================="); if(MathAbs(Close[0]-OrderOpenPrice())>MathAbs(exitpriceL1-OrderOpenPrice())) { if(OrderStopLoss()<exitpriceL1 || OrderStopLoss()==0) { //pips = profit / PipValuePerLot; //NormalizeDouble(pips,1) //--- modify order and exit //Print("OrderModifyL: "+exitpriceL1); //if(!OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TrailingStop,OrderTakeProfit(),0,Green)) if(!OrderModify(OrderTicket(),OrderOpenPrice(),exitpriceL1,OrderTakeProfit(),0,Green)) Print("OrderModify error",GetLastError()); return; } } break; } } else // go to short position { switch(OrderMagicNumber()) { case 1: //if((sRegLow1 > Low[0] && xbars1S < xNumberbars) || sRegLow1 == 0) //{ // sRegLow1 = Low[0]; // xbars1S++; //} //Print("sRegLow1: "+sRegLow1); //exitpriceS1 = NormalizeDouble(sRegLow1 + (sRegLow1 *(vAtr / OrderOpenPrice())*1.55),InpNormalizeDouble); sRegLow1 = LLsinceEntry(OrderOpenTime()); exitpriceS1 = sRegLow1 + (sRegLow1 *(vAtr / OrderOpenPrice())*factorSL); Print("sRegLow1: "+sRegLow1); Print("exitpriceS1: "+exitpriceS1); Print("vAtr: "+vAtr); Print("OrderOpenPrice(): "+OrderOpenPrice()); Print("==============================================="); if(MathAbs(OrderOpenPrice()-Close[0])>MathAbs(OrderOpenPrice()-exitpriceS1)) { if(OrderStopLoss()>exitpriceS1 || OrderStopLoss()==0) { //Print("OrderModifyS: "+exitpriceS1); //Print("OrderOpenPrice()-Close[0]: "+(OrderOpenPrice()-Close[0])); //Print("OrderOpenPrice()-exitpriceS1: "+(OrderOpenPrice()-exitpriceS1)); //--- modify order and exit //if(!OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*TrailingStop,OrderTakeProfit(),0,Red)) if(!OrderModify(OrderTicket(),OrderOpenPrice(),exitpriceS1,OrderTakeProfit(),0,Red)) Print("OrderModify error",GetLastError()); return; } } break; } } } else { bRegHigh1 = 0; sRegLow1 = 0; } } } } //+------------------------------------------------------------------+
and below the variable to know bRegHigh1 and sRegLow1 :
double HHsinceEntry(datetime) { //datetime OOT = OrderOpenTime(); // Assumes OrderSelect() done already int iOOT = iBarShift(Symbol(),Period(),OrderOpenTime(), false); // Bar of the open. #define iBarBuy 0 // Include current bar. int nSince = iOOT + 1; // No. bars since open. int iHi = iHighest(Symbol(),Period(), MODE_HIGH, nSince, iBarBuy); double HH = iHigh(Symbol(), Period(), iHi); // Highest high.iHi give the number of the bar with highest price.High[] return price high of the bar return HH; } double LLsinceEntry(datetime) { //datetime OOT = OrderOpenTime(); // Assumes OrderSelect() done already int iOOT = iBarShift(Symbol(),Period(),OrderOpenTime(), false); // Bar of the open. #define iBarSell 0 // Include current bar. int nSince = iOOT + 1; // No. bars since open. int iLi = iLowest(Symbol(),Period(), MODE_LOW, nSince, iBarSell); double LL = iLow(Symbol(), Period(), iLi); // Lowest low. return LL; }
i attach a screenshot for the short position

Price is nego in case
tom
応答済み
1
評価
プロジェクト
1065
50%
仲裁
39
28%
/
41%
期限切れ
49
5%
暇
パブリッシュした人: 1 article, 8 codes
2
評価
プロジェクト
212
58%
仲裁
9
11%
/
89%
期限切れ
8
4%
暇
3
評価
プロジェクト
285
41%
仲裁
15
13%
/
47%
期限切れ
67
24%
暇
4
評価
プロジェクト
945
47%
仲裁
309
58%
/
27%
期限切れ
125
13%
暇
類似した注文
Max amount grid
30+ USD
max amount grid step for magic number do keep deleting .only when it is in negative floating .but when it is profit allow to go over the max and replays to grid step
Apply with a screen of your work . Symbol Specific Logic . Live Chart Optimization Check the Core logic . [back tests as well] Change points to pips . Create buffer for the zone
Buying profitable EA(Budget up to $ 3000 USD)
300 - 3000 USD
I will pay 3000+ USD (negotiable) for an EA for existing MT5 that generates a minimum of 15-20% or higher a month consistently (provide source code after final deal) Looking for a highly profitable EA Please send demo version directly subject (Buying profitable EA Budget up to $ 3000 USD), past results and optimal settings so I can test, if it performs in a strategy tester i will also need option to forward test it
EA fx
30+ USD
Hello, I need an already developed EA similar to the one trading XAUUSD, with consistent entries and good risk management. Before we proceed, I would like to verify its performance. Please provide a live or demo account login along with the investor (read-only) password so I can monitor the trading results. I am looking for stable performance, controlled drawdown, and consistent profit on gold (XAUUSD). Once I
The strategy records the highest and lowest prices within a specified duration (default 15 minutes) after the New York market opens, forming the opening range. Post-Formation Breakout: When the price breaks above or below the opening range after its formation, it may indicate the direction of the day’s price movement. Trend Confirmation: The strategy uses two EMAs (default 20-period and 50-period) as trend filters to
Tengo una estrategia basada en divergencia para el oro sobre todo en tf m1 Basado en divergencia con stoch .. confirmando la entrada con ciertos parameteos de entrada Es mejor conversarlo para dar mejor los detalles Cuando entrar, porque o todas las divergencias se debe tomar para entrar en compras o ventas He adjuntado un ejemplo La confrmacion más exacta es el cruce de esos parámetros de stoch edebajo de level de
2STEP MA WITH SUPERTREND
40+ USD
BUY ALERT 1. Supertrend turns Bullish 2. On this candle , or during the last time Supertrend was Bearish, price was < or = MA1 3. On this candle , or during the last time Supertrend was Bearish , BBStops is Bearish 4. STEP MA1 and STEP MA 2 are both Bullish SELL ALERT 1. Supertrend turns Bearish 2. On this candle , or during the last time Supertrend was Bullish, price was
Rsi divergence
30+ USD
You need to create an EA that executes buy and sell based on the signals of an rsi divergence indicator in trading view. The indicator is not in MT5 and must be added separately. pine script availabel
KHALIFAH DARK VENUS
30+ USD
I WANT A TRADING ROBOT WITH GOLD STRATEGY THAT COULD TAKE ME TO 1MILLION$ TODAY,PLEASE KINDLY GENERATE THE BOT, DEBUGG COMPILE AND THEN GIVE ME WHEN EVER YOU ARE READY, ILL BE WAITING THANK YOU
プロジェクト情報
予算
30 - 200 USD
締め切り
最高 10 日