设为首页 收藏本站 切换语言

哪位大大哥能帮小弟无币修改这款下单EA的小缺陷  

| 发表于 2021-9-11 22:17:22 | 显示全部楼层 |复制链接
最后由 Investwise 于 2021-9-13 10:43 编辑

这是一款免费无限制的简单下单EA,但就缺了更改EA左右上下位置的设定。
希望社区大大哥能好心帮小弟无币修改,好人一生平安。谢谢。


lots.JPG

lots 2.JPG


EA 源码:
//+------------------------------------------------------------------------------------------------------------------+
#property description                                                                                   "[FX-TRADE-g]"
#define Version                                                                                         "[FX-TRADE-g]"
//+------------------------------------------------------------------------------------------------------------------+
#property link        "https://forex-station.com/viewtopic.php?p=1294848283#p1294848283"
#property description "THIS IS A FREE INDICATOR"
#property description "                                                      "
#property description "Welcome to the World of Forex"
#property description "Let light shine out of darkness and illuminate your world"
#property description "and with this freedom leave behind your cave of denial"
//+------------------------------------------------------------------------------------------------------------------+
#include <stdlib.mqh>
#include <WinUser32.mqh>
         bool RiskMM=true; int slippage=5,ticket1; string display="",SymbolPair="";
       double MinLots=0.10,MaxLots=10000,LotsTraded=2000,stopsize1=0,profsize1=0,Lots,stop1,prof1;
extern double LOTSIZE=0.01; double PIPLOSS=0.;
          int Move_X = 0,Move_Y = 40;   int Corner = 1;
          int Button_Width = 100,Font_Size = 10,Font_Size2 = 71;
       string Font_Type = "Arial Bold";
       string Font_Type2= "Webdings";
        color Font_Color = White;
//+------------------------------------------------------------------------------------------------------------------+
         bool showINFOBOX                = false; const string ID="FX PANEL 2";
extern color clrPanel                   = C'91,103,112';//C'34,34,34';  
        color PanelBorderColor           = clrSnow,Boxbgd=C'30,40,50';
          int PanelBorderWidth           = 1,InfoBoxCorner=1,Window=0; int posLR=6,posUD=-120;
//+------------------------------------------------------------------------------------------------------------------+
   int OnInit(){ CreateButtons(); CleanUpIsle1();
   ToolTips_Text ("Lot_00000_btn");
   ToolTips_Text ("Buy_00000_btn");
   ToolTips_Text ("Sell_0000_btn");
   ToolTips_Text ("Close_All_btn");
   ToolTips_Text ("Panic_000_btn");
    ObjectCreate ("Lot_Edit", OBJ_EDIT, ChartWindowFind(), 0, 0);
       ObjectSet ("Lot_Edit", OBJPROP_CORNER, 1);
       ObjectSet ("Lot_Edit", OBJPROP_XSIZE, Button_Width - 040);
       ObjectSet ("Lot_Edit", OBJPROP_YSIZE, Font_Size*2.);
       ObjectSet ("Lot_Edit", OBJPROP_XDISTANCE, 085+Move_X);
       ObjectSet ("Lot_Edit", OBJPROP_YDISTANCE, 278+Move_Y);
   ObjectSetText ("Lot_Edit", LOTSIZE , 14, Font_Type, Font_Color);  return(INIT_SUCCEEDED);}
//+------------------------------------------------------------------------------------------------------------------+
   void OnDeinit(const int reason){DeleteButtons(); CleanUpIsle1(); ObjectDelete ("Lot_Edit");}
//+------------------------------------------------------------------------------------------------------------------+
   void OnChartEvent (const int id, const long &lparam, const double &dparam, const string &sparam){ResetLastError();
   if(id == CHARTEVENT_OBJECT_CLICK) {if (ObjectType (sparam) == OBJ_BUTTON) {ButtonPressed (0, sparam);}}}
//+------------------------------------------------------------------------------------------------------------------+
   void CreateButtons(){ int Button_Height = Font_Size*2.8;
   if(!ButtonCreate (0,"Lot_00000_btn",0,102,250,Button_Width-10,Button_Height,Corner,"LotSize",Font_Type,Font_Size+6,Font_Color,clrPanel,clrPanel)) return;
   if(!ButtonCreate (0,"Buy_00000_btn",0,099,305,Button_Width-60,Button_Height,Corner,"BUY",Font_Type,Font_Size+1,Snow,Green,Snow)) return;
   if(!ButtonCreate (0,"Sell_0000_btn",0,054,305,Button_Width-60,Button_Height,Corner,"SELL",Font_Type,Font_Size+1,Snow,Crimson,Snow)) return;
   if(!ButtonCreate (0,"Close_All_btn",0,096,340,Button_Width-21,Button_Height,Corner,"CLOSE",Font_Type,Font_Size+3,Font_Color,Blue,Snow)) return;
   if(!ButtonCreate (0,"Panic_000_btn",0,100,375,Button_Width-14,Button_Height,Corner,"CLOSEALL",Font_Type,Font_Size+1,Font_Color,Crimson,Snow)) return;
   ChartRedraw();}
//+------------------------------------------------------------------------------------------------------------------+
   void DeleteButtons(){
     ButtonDelete (0, "Buy_00000_btn");
     ButtonDelete (0, "Sell_0000_btn");
     ButtonDelete (0, "Close_All_btn");
     ButtonDelete (0, "Lot_00000_btn");
     ButtonDelete (0, "Panic_000_btn");}
//+------------------------------------------------------------------------------------------------------------------+
   void ButtonPressed (const long chartID, const string sparam){
     if (sparam == "Buy_00000_btn") Buy_00000_Button (sparam);
     if (sparam == "Sell_0000_btn") Sell_0000_Button (sparam);
     if (sparam == "Close_All_btn") Close_All_Button (sparam);
     if (sparam == "Panic_000_btn") Panic_000_Button (sparam);
     if (sparam == "Lot_00000_btn") Lot_00000_Button (sparam);  Sleep (10);}
//+------------------------------------------------------------------------------------------------------------------+
   void ToolTips_Text(const string sparam){
   if (sparam == "Lot_00000_btn") {ObjectSetString (0, sparam, OBJPROP_TOOLTIP, "Lot To Be Used");}
   if (sparam == "Buy_00000_btn") {ObjectSetString (0, sparam, OBJPROP_TOOLTIP, "Open BUY Order");}
   if (sparam == "Sell_0000_btn") {ObjectSetString (0, sparam, OBJPROP_TOOLTIP, "Open SELL Order");}
   if (sparam == "Panic_000_btn") {ObjectSetString (0, sparam, OBJPROP_TOOLTIP, "For When The SHTF");}
   if (sparam == "Close_All_btn") {ObjectSetString (0, sparam, OBJPROP_TOOLTIP, "Close All Open Orders on Chart");}}
//+------------------------------------------------------------------------------------------------------------------+
   int Lot_00000_Button (const string sparam){return(0);}
//+------------------------------------------------------------------------------------------------------------------+
   int Close_All_Button (const string sparam){int ticket;
   if (OrdersTotal() == 0) return(0);
   for (int i = OrdersTotal() - 1; i >= 0; i--){
   if (OrderSelect (i, SELECT_BY_POS, MODE_TRADES) == true){
   if (OrderType() == 0 && OrderSymbol() == Symbol()){
       ticket = OrderClose (OrderTicket(), OrderLots(), Bid, 3, CLR_NONE);
   if (ticket == -1) Print ("Error: ", GetLastError());
   if (ticket >   0) Print ("Position ", OrderTicket() ," closed");}
   if (OrderType() == 1 && OrderSymbol() == Symbol()){
       ticket = OrderClose (OrderTicket(), OrderLots(), Ask, 3, CLR_NONE);
   if (ticket == -1) Print ("Error: ",  GetLastError());
   if (ticket >   0) Print ("Position ", OrderTicket() ," closed");}}}  return(0);}
//+------------------------------------------------------------------------------------------------------------------+
   int Panic_000_Button (const string sparam){
   if (OrdersTotal() == 0) return(0);
   for (int i=OrdersTotal()-1; i>=0; i--){
   if (OrderSelect (i, SELECT_BY_POS, MODE_TRADES) == true){
   if(OrderType()==OP_BUY ) OrderClose(OrderTicket(),OrderLots(),Bid,5,Violet);
   if(OrderType()==OP_SELL) OrderClose(OrderTicket(),OrderLots(),Ask,5,Violet);
   if(OrderType()> OP_SELL) OrderDelete(OrderTicket()); }} return(0);}
//+------------------------------------------------------------------------------------------------------------------+
   int Buy_00000_Button (const string sparam){
   double Lot_Extract = StrToDouble (ObjectGetString (0, "Lot_Edit", OBJPROP_TEXT, 0));
   OrderSend(Symbol(),OP_BUY,Lot_Extract,Ask,slippage,0,0, "BUY", 12345601, 0, CLR_NONE);  return(0);}
//+------------------------------------------------------------------------------------------------------------------+
   int Sell_0000_Button (const string sparam){
   double Lot_Extract = StrToDouble (ObjectGetString (0, "Lot_Edit", OBJPROP_TEXT, 0));
   OrderSend (Symbol(),OP_SELL,Lot_Extract,Bid,slippage,0,0, "SELL", 12345602, 0, CLR_NONE);  return(0);}
//+------------------------------------------------------------------------------------------------------------------+
   bool ButtonCreate (const string chart_ID="FX PANEL 2", const string name="Button", const int sub_window=0, const int x=0, const int y=0, const int width=500,
                      const int height=18, int corner=1, const string text="Button", const string font="Arial Bold",
                      const int font_size=10, const color clr=clrBlack, const color back_clr=C'170,170,170', const color border_clr=clrNONE,
                      const bool state=false, const bool back=false, const bool selection=false, const bool hidden=true, const long z_order=0){
   ResetLastError();
   if (!ObjectCreate (chart_ID,name, OBJ_BUTTON, 0, 0, 0)){
      Print (__FUNCTION__, ": failed to create the button! Error code = ", GetLastError());  return(false);}
   ObjectSetInteger (chart_ID, name, OBJPROP_XDISTANCE, x);
   ObjectSetInteger (chart_ID, name, OBJPROP_YDISTANCE, y+40);
   ObjectSetInteger (chart_ID, name, OBJPROP_XSIZE, width);
   ObjectSetInteger (chart_ID, name, OBJPROP_YSIZE, height);
   ObjectSetInteger (chart_ID, name, OBJPROP_CORNER, corner);
   ObjectSetInteger (chart_ID, name, OBJPROP_FONTSIZE, font_size);
   ObjectSetInteger (chart_ID, name, OBJPROP_COLOR, clr);
   ObjectSetInteger (chart_ID, name, OBJPROP_BGCOLOR, back_clr);
   ObjectSetInteger (chart_ID, name, OBJPROP_BORDER_COLOR, border_clr);
   ObjectSetInteger (chart_ID, name, OBJPROP_BACK, back);
   ObjectSetInteger (chart_ID, name, OBJPROP_STATE, state);
   ObjectSetInteger (chart_ID, name, OBJPROP_SELECTABLE, selection);
   ObjectSetInteger (chart_ID, name, OBJPROP_SELECTED, selection);
   ObjectSetInteger (chart_ID, name, OBJPROP_HIDDEN, hidden);
   ObjectSetInteger (chart_ID, name, OBJPROP_ZORDER,z_order);
   ObjectSetString  (chart_ID, name, OBJPROP_TEXT, text);
   ObjectSetString  (chart_ID, name, OBJPROP_FONT, font);
   return(true);}
//+------------------------------------------------------------------------------------------------------------------+
   bool ButtonDelete (const long chart_ID=0, const string name="Button"){ ResetLastError();
   if (!ObjectDelete (chart_ID,name)){
      Print (__FUNCTION__, ": Failed to delete the button! Error code = ", GetLastError());  return(false);}
   return(true);}
//+----Clean Chart Function------------------------------------------------------------------------------------------+
   void CleanUpIsle1(){string name; for(int s=ObjectsTotal()-1; s>=0; s--){name=ObjectName(s);
   if(StringSubstr(name,0,StringLen(ID))==ID) {ObjectDelete(name);}}}
//+------------------------------------------------------------------------------------------------------------------+
   double CalculateMM(){MinLots=MarketInfo(Symbol(),MODE_MINLOT); MaxLots=MarketInfo(Symbol(),MODE_MAXLOT);
   Lots=AccountBalance()/LotsTraded; Lots=MathMin(MaxLots,MathMax(MinLots,Lots));
   if(MinLots<0.1)Lots=NormalizeDouble(Lots,3); else {if(MinLots<1)Lots=NormalizeDouble(Lots,1);
   else Lots=NormalizeDouble(Lots,0);} if(Lots<MinLots)Lots=MinLots; if(Lots>MaxLots)Lots=MaxLots;  return(0);}
//+----END OF FILE---------------------------------------------------------------------------------------------------+

FX-TRADE-g.mq4

22.47 KB, 下载次数: 3, 下载积分: 活跃度 -5  [下载]

评分
  • 1
  • 2
  • 3
  • 4
  • 5
平均分:NAN    参与人数:0    我的评分:未评 下载时遇到问题?
举报

评论 使用道具

精彩评论23

chenyu
DD
| 发表于 2021-9-11 22:54:45 | 显示全部楼层
谢谢分享
举报

点赞 评论 使用道具

彩虹桥
DDD
| 发表于 2021-9-11 23:39:38 | 显示全部楼层
支持一下
举报

点赞 评论 使用道具

985086809
DD
| 发表于 2021-9-12 11:45:10 | 显示全部楼层
还要活跃度
举报

点赞 评论 使用道具

twb818
C
| 发表于 2021-9-12 12:10:59 | 显示全部楼层
感谢分享
举报

点赞 评论 使用道具

latage
未及格
| 发表于 2021-9-12 20:18:58 | 显示全部楼层
不会改
举报

点赞 评论 使用道具

古希腊恶人
D
| 发表于 2021-9-12 21:03:06 | 显示全部楼层
关注一下
举报

点赞 评论 使用道具

hyw751125
D
| 发表于 2021-9-12 22:43:39 | 显示全部楼层
路过赚积分
举报

点赞 评论 使用道具

johnsun888
C
| 发表于 2021-9-12 22:58:49 | 显示全部楼层
我活跃度不够,下载不了,把源码贴出来,帮你免费改。
举报

点赞 评论 使用道具

xyz0217
D
| 发表于 2021-9-13 00:19:58 | 显示全部楼层
XARD777 趋势交易系统 - 九月更新版 里面有这个小下单面板,设置里直接可以改位置
举报

点赞 评论 使用道具

xyz0217
D
| 发表于 2021-9-13 00:26:53 | 显示全部楼层
原作者已经完善了这个EA
举报

点赞 评论 使用道具

zw123456
未及格
| 发表于 2021-9-13 01:24:37 | 显示全部楼层
感謝分享資訊
举报

点赞 评论 使用道具

gjhgjh
未及格
| 发表于 2021-9-13 08:30:40 | 显示全部楼层
感谢分享
举报

点赞 评论 使用道具

Investwise
D
 楼主 | 发表于 2021-9-13 10:50:43 | 显示全部楼层
johnsun888 发表于 2021-9-12 22:58
我活跃度不够,下载不了,把源码贴出来,帮你免费改。

源码贴出来了。谢谢。
举报

点赞 评论 使用道具

Investwise
D
 楼主 | 发表于 2021-9-13 10:56:52 | 显示全部楼层
''XARD777 趋势交易系统 - 九月更新版 里面有这个小下单面板,设置里直接可以改位置''
但是我看到的两款下单EA都是不能设置更改位置。
lots 1.JPG
lots 2.JPG
举报

点赞 评论 使用道具

johnsun888
C
| 发表于 2021-9-13 17:53:53 | 显示全部楼层
Corner改位 0,1, 2,3 就可以了。
C.png

FX-TRADE.mq4

11.38 KB, 下载次数: 0, 下载积分: 活跃度 -5 售价: 2 H币  [记录]  [购买]

EA

评分
  • 1
  • 2
  • 3
  • 4
  • 5
平均分:NAN    参与人数:0    我的评分:未评 下载时遇到问题?
举报

点赞 评论 使用道具

tianping
DDD
| 发表于 2021-10-27 20:56:06 | 显示全部楼层
谢谢分享
举报

点赞 评论 使用道具

daerwushen
DD
| 发表于 2021-10-27 22:17:17 | 显示全部楼层
感謝分享
举报

点赞 评论 使用道具

ycdf895621
D
| 发表于 2022-1-9 11:11:03 | 显示全部楼层
看看,学习一下,
举报

点赞 评论 使用道具

遇见
DD
| 发表于 2022-1-9 11:15:44 | 显示全部楼层
感谢分享
举报

点赞 评论 使用道具

12下一页
发新帖
EA交易
您需要登录后才可以评论 登录 | 立即注册

简体中文
繁體中文
English(英语)
日本語(日语)
Deutsch(德语)
Русский язык(俄语)
بالعربية(阿拉伯语)
Türkçe(土耳其语)
Português(葡萄牙语)
ภาษาไทย(泰国语)
한어(朝鲜语/韩语)
Français(法语)