华兰先生 发表于 7 天前

桂烨发布的高级交易面板EA,添加保本、追踪功能

本帖最后由 张玲 于 2025-4-21 08:55 编辑

感谢桂烨发布的Ea面板,但总感觉少了些什么,很喜欢这种简单风格的面板,为此添加了保本损和追踪止损的功能。

盈利当超过默认500点设50点的保本损

桂烨发的原贴:https://www.eazhijia.com/thread-1120285-1-1.html


华兰先生 发表于 6 天前

再添加平多单和平空单功能

华兰先生 发表于 6 天前

默认当浮亏百分之二十会触发清仓功能,可以在属性里设置成30,10,根据自己的需要设置。

山沟里的葫芦娃 发表于 6 天前

能不能把面板改小一点啊!笔记本窗口缩小了,的话,就看不到行情了

saisai213 发表于 6 天前

感谢分享

华兰先生 发表于 6 天前

本帖最后由 华兰先生 于 2025-4-21 11:24 编辑

山沟里的葫芦娃 发表于 2025-4-21 02:04
能不能把面板改小一点啊!笔记本窗口缩小了,的话,就看不到行情了
BASE_X, BASE_Y+15这是坐标位置。下面部分代码已经调整过了。



// 账户信息
    CreateLabel("BalanceLabel", "余额:$"+DoubleToString(AccountBalance(),2), BASE_X, BASE_Y+15, clrWhite);
    CreateLabel("EquityLabel", "净值:$"+DoubleToString(AccountEquity(),2), BASE_X+120, BASE_Y+15, clrDodgerBlue);
    CreateLabel("FloatPNL", "浮盈:$0.00", BASE_X+260, BASE_Y+15, clrLime);

    // 手数调节区
    CreateLabel("Normal Lots", "手数:", BASE_X, BASE_Y+55, clrLime);
    CreateEdit("LotsEdit", DoubleToString(DefaultLots,2), BASE_X+50, BASE_Y+55, 60, 30, clrBlack);
    CreateButton("LotsInc01", "+0.01", BASE_X+120, BASE_Y+55, 60, 30, clrGreen);
    CreateButton("LotsInc05", "+0.05", BASE_X+190, BASE_Y+55, 60, 30, clrGreen);
    CreateButton("LotsDec01", "-0.01", BASE_X+260, BASE_Y+55, 60, 30, clrRed);

    // 止损点数设置
    CreateLabel("SLPointsLabel", "止损:", BASE_X, BASE_Y+95, clrWhite);
    CreateEdit("SLPoints", IntegerToString(DefaultSLPoints), BASE_X+50, BASE_Y+95, 60, 30, clrBlack);
    CreateButton("SLInc100", "+100", BASE_X+120, BASE_Y+95, 60, 30, clrGray);
    CreateButton("SLInc200", "+200", BASE_X+190, BASE_Y+95, 60, 30, clrGray);
    CreateButton("SLDec100", "-100", BASE_X+260, BASE_Y+95, 60, 30, clrGray);

    // 止盈点数设置
    CreateLabel("TPPointsLabel", "止盈:", BASE_X, BASE_Y+135, clrWhite);
    CreateEdit("TPPoints", IntegerToString(DefaultTPPoints), BASE_X+50, BASE_Y+135, 60, 30, clrBlack);
    CreateButton("TPInc100", "+100", BASE_X+120, BASE_Y+135, 60, 30, clrGray);
    CreateButton("TPInc200", "+200", BASE_X+190, BASE_Y+135, 60, 30, clrGray);
    CreateButton("TPDec100", "-100", BASE_X+260, BASE_Y+135, 60, 30, clrGray);

    // 盈利目标设置
    CreateLabel("ProfitTargetLabel", "盈利:", BASE_X, BASE_Y+175, clrWhite);
    CreateEdit("ProfitTarget", IntegerToString(ProfitTarget), BASE_X+50, BASE_Y+175, 60, 30, clrBlack);
    CreateButton("PTInc100", "+100", BASE_X+120, BASE_Y+175, 60, 30, clrGray);
    CreateButton("PTInc200", "+200", BASE_X+190, BASE_Y+175, 60, 30, clrGray);
    CreateButton("PTDec100", "-100", BASE_X+260, BASE_Y+175, 60, 30, clrGray);

    // 锁定止损设置
    CreateLabel("LockSLPointsLabel", "锁定:", BASE_X, BASE_Y+215, clrWhite);
    CreateEdit("LockSLPoints", IntegerToString(LockSLPoints), BASE_X+50, BASE_Y+215, 60, 30, clrBlack);
    CreateButton("LockSLInc10", "+10", BASE_X+120, BASE_Y+215, 60, 30, clrGray);
    CreateButton("LockSLInc20", "+20", BASE_X+190, BASE_Y+215, 60, 30, clrGray);
    CreateButton("LockSLDec10", "-10", BASE_X+260, BASE_Y+215, 60, 30, clrGray);
   
    // 追踪止损设置
    CreateLabel("TrailingStopLabel", "追踪:", BASE_X, BASE_Y+255, clrWhite);
    CreateEdit("TrailingStop", IntegerToString(TrailingStopPoints), BASE_X+50, BASE_Y+255, 60, 30, clrBlack);
    CreateButton("TSInc250", "+250", BASE_X+120, BASE_Y+255, 60, 30, clrGray);
    CreateButton("TSInc500", "+500", BASE_X+190, BASE_Y+255, 60, 30, clrGray);
    CreateButton("TSDec250", "-250", BASE_X+260, BASE_Y+255, 60, 30, clrGray);
   
    // 市价交易按钮
    CreateButton("MarketBuy", "市价做多", BASE_X+50, BASE_Y+295, 100, 45, clrGreen);
    CreateButton("MarketSell", "市价做空", BASE_X+190, BASE_Y+295, 100, 45, clrRed);
      
    // 平仓按钮区
    CreateButton("CloseBuys", "平多单", BASE_X+50, BASE_Y+350, 100, 45, clrGreen);
    CreateButton("CloseSells", "平空单", BASE_X+190, BASE_Y+350, 100, 45, clrRed);
    CreateButton("CloseAll", "全部平仓", BASE_X+70, BASE_Y+405, 200, 45, clrDarkViolet);

jaryk 发表于 6 天前

感谢楼主分享!!!!

山沟里的葫芦娃 发表于 5 天前

华兰先生 发表于 2025-4-21 10:44
山沟里的葫芦娃 发表于 2025-4-21 02:04
能不能把面板改小一点啊!笔记本窗口缩小了,的话,就看不到行情 ...

非常感谢老铁,太有爱心了!好人一生平安,发财多多赚美刀
页: [1]
查看完整版本: 桂烨发布的高级交易面板EA,添加保本、追踪功能