Need a small modification of my EA

MQL4 전문가 C++

작업 종료됨

실행 시간 1 분
고객의 피드백
Perfect thank you :)
피고용인의 피드백
Once again, another job with a great customer. Thank you so much

명시

Hello,
the problem is that my order is triggered too precisely.

Example
When I want an order to be triggered at 1.3542 and it is triggered exactly at 1.35420.
What I would like is that it is triggered between 1.35420 and 1.35429 that only the fourth
decimal place is taken into account.


Complete Code


//+------------------------------------------------------------------+
//|                                                       test35.mq4 |
//|                                                              xxx |
//|                                              http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "xxx"
#property link      "http://www.mql5.com"
#property version   "1.00"
#property strict
extern double lots=0.50;
extern int TakeProfit=50;
extern int StopLoss=3000;
extern int magic=123456;
extern double Level = 1.3542;


bool RunOnce=false;


int last_order_check = false;

datetime EaStartTime=TimeCurrent();
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
   RunOnce=false;
   MathSrand(GetTickCount());
   if(Digits==5 || Digits==3)
     {
      TakeProfit  *=10;
      StopLoss    *=10;
     }
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnTimer()
{
OnTick();        
}
void OnDeinit(const int reason)
  {
//---
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
{

  if(IsLastOrderCloseManual())
    {
    OnInit();
    Print("Ea Closed Manually ");
    EaStartTime=TimeCurrent();
    }

   int ticet;
   int t=MathRand();
  
   if(CountVsego()==0)
        {
      if(t>16384)
        {
         if(RunOnce || (Ask ==Level && Level !=0))
         {
            ticet=OrderSend(Symbol(),OP_BUY,lots,Ask,3,Bid-StopLoss*Point,Ask+TakeProfit*Point,"1",magic,0,clrGreen);
            if(ticet>0)
            {
               RunOnce=true;
            }
         }
        } 
     else if(t<16384)
        {
         if(RunOnce || (Bid ==Level && Level !=0))
         {
            ticet=OrderSend(Symbol(),OP_SELL,lots,Bid,3,Ask+StopLoss*Point,Bid-TakeProfit*Point,"1",magic,0,clrRed);
            if(ticet>0)
            {
               RunOnce=true;
            }
         }
        }
     }
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int CountSELL()
  {
   int count=0;
   int i;
   for(i=OrdersTotal()-1;i>=0;i--)
     {
      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
        {
         if(OrderSymbol()==Symbol() && OrderMagicNumber()==magic && OrderType()==OP_SELL)
            count++;
        }
     }
   return(count);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int CountBUY()
  {
   int count=0;
   int i;
   for(i=OrdersTotal()-1;i>=0;i--)
     {
      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
        {
         if(OrderSymbol()==Symbol() && OrderMagicNumber()==magic && OrderType()==OP_BUY)
            count++;
        }
     }
   return(count);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int CountVsego()
  {
   int Vsego;
   Vsego=CountBUY()+CountSELL();

   return(Vsego);
  }
//+------------------------------------------------------------------+
bool IsLastOrderCloseManual()
{
bool signal = false;
for(int i=OrdersHistoryTotal()-1;i>=0;i--)
  {
   bool select = OrderSelect(i,SELECT_BY_POS,MODE_HISTORY);
   if(select && OrderSymbol()==_Symbol && OrderMagicNumber()==magic)
     {
     if(OrderType()==OP_BUY && OrderCloseTime()>=EaStartTime)
       {
       if(OrderClosePrice()>OrderStopLoss() && OrderClosePrice()<OrderTakeProfit())
         {
         signal = true;
         
         }
         break;
       }
     else if(OrderType()==OP_SELL && OrderCloseTime()>=EaStartTime)
       {
       if(OrderClosePrice()<OrderStopLoss() && OrderClosePrice()>OrderTakeProfit())
         {
         signal = true;
         
         }
         break;
       }
       break;
     }
  }
return(signal);
}


응답함

1
개발자 1
등급
(590)
프로젝트
789
71%
중재
9
33% / 33%
기한 초과
22
3%
무료
2
개발자 2
등급
(879)
프로젝트
1393
67%
중재
117
32% / 42%
기한 초과
215
15%
작업중
3
개발자 3
등급
(236)
프로젝트
440
26%
중재
125
21% / 57%
기한 초과
96
22%
작업중
4
개발자 4
등급
(186)
프로젝트
261
69%
중재
12
33% / 67%
기한 초과
16
6%
무료
비슷한 주문
Hello there, I’m looking for a highly skilled programmer or engineer that can code an efficient and effective anti-decompilation mechanism for my MQL5 expert advisor, that ideally can obfuscate further my code. Also, I’m looking for an integrity check system, which based on the hash of the original code (hidden inside the code itself) checks whether the hash of the current code matches
Hi, I will use: 5 indicators to find main trend , 5indicators to find current trend, find pivot point, support/resistance, reversel candle then entry.......indicators are available on mt5. *Dashboard chart will show on the chart as all indicators result,,,,as MA,MACD, bullish or bearish ,,,,add all others features days of trading,,,,hrs,,,etc
I need to create an EA based on my own strategy that actually is a little bit different from most of the usual EA. This because it use an indicator but the power of the system is just because it can shows target price by designing trendline on the price chart in a unusual way. A friend of mine tried to create it on MT4 platform but, in the end, he realized that this platform has big limits when the program lines
This is a 2000 lines own-made breakout EA that I need to have cleanly converted from mql4 to mql5 for learning purposes The start() is about 400 lines long ; basic breakout with specific features , built for Index CFDs with 2 digits (typically DAX or SP500; TP SL... are expressed in actual Points) The Ontester() is about 400 lines (contains 58 different custom opimizations) The Deinit() is about 150 lines The
Hey there! I’m looking for a talented NinjaTrader programmer to partner with on some exciting projects. If you have a knack for NinjaScript and a passion for trading tech, let’s team up! What You Can Expect: A friendly collaboration on diverse projects Fair pay—50/50 split on all earnings An opportunity to dive deep into innovative trading strategies What I’m Hoping You Bring: Experience with NinjaTrader and
STRATEGY : Here’s a comprehensive specification document in English for developing your NinjaTrader bid/ask imbalance indicator: --- ### Bid/Ask Imbalance Indicator for NinjaTrader: Full Specifications #### **Objective**The goal is to develop a custom bid/ask imbalance indicator for NinjaTrader 8. The indicator will calculate and visualize bid/ask imbalances in real-time and on historical tick data using Tick Replay
Convert my tradingview pine script to mt4, Its a simple and straight code i need an expert programmer to convert my tradingview pine script to mt4, Thats All Thank you
Hello, i would like to have a fix on my plotted lines I use a liquidity strategy on the 1 hr time frame but the indicator that i am using for plotting the 1 hr lines is having a issue and printing the plot lines all over the place on the current 1 and 4 hr plot line as you can see in the screenshot this is very disturbing while i am trading can u fix that or just remove the current 1 hr plot line ?and or only show
hello there I need a copy trade for mt4 can ANYONE help me with and let discuss on how to go about it kindly send me message to signify and let discuss mind you i need this urgently let connect to discuss and conclude
I want to create a robot to open and close trades for me based on my moving averages cross overs . I normally trade on my phone so i would like to set it on my phone 1st

프로젝트 정보

예산
30+ USD
VAT (20%): 6 USD
총: 36 USD
개발자에게
27 USD
기한
 10 일