@sktsec Hello, is there a connection block? Open a position in the current price trend after taking profit. Open a position in the opposite direction with double the size after a stop loss.
Latest posts made by wen85685593
-
RE: How to trigger the take - profit and then continue to build positions in the original direction at the same speed. And how to build positions in the opposite direction and double the position when the stop - loss is triggered.posted in Questions & Answers
-
How to trigger the take - profit and then continue to build positions in the original direction at the same speed. And how to build positions in the opposite direction and double the position when the stop - loss is triggered.posted in Questions & Answers
How to trigger the take - profit and then continue to build positions in the original direction at the same speed. And how to build positions in the opposite direction and double the position when the stop - loss is triggered.
-
RE: How to open new order at the same price of the closed tradeposted in Questions & Answers
Is there a logic diagram? I don't understand
-
EA跑赢点差即可获利?posted in General Discussions
- 参数设置 plaintext 复制代码 # 初始建仓参数
InitialLotSize = 0.01 # 初始手数
OpenCondition = "收盘价 > 开盘价" # 开仓条件(只开一单)
止盈止损参数
TakeProfitPoints = 2 # 止盈点数
StopLossPoints = 2 # 止损点数防滑点参数
SlippageTolerance = 1 # 滑点容忍度(元)
亏损加仓参数
LotMultiplier = 2 # 加仓倍数
MaxLotSize = 50 # 最大手数
MaxLossCount = 3 # 连续亏损重置次数风控参数
MaxLossAmount = 1000 # 最大亏损金额
MaxLossPercentage = 30 # 最大亏损比例
DailyTradeLimit = 1000 # 每日交易限额其他参数
TradingHours = "全天" # 交易时间段
LogLevel = "基本信息" # 日志记录级别
2. 策略逻辑 2.1 初始建仓 条件: • 根据当前K线的开盘价和收盘价关系决定开仓方向。 • 收盘价 > 开盘价:买入(BUY)。 • 收盘价 < 开盘价:卖出(SELL)。 操作: • 开仓手数:InitialLotSize。 • 市价建仓,例如BUY 0.01手,成交价2880。 挂单逻辑: • 止盈挂单: • BUY STOP手数:InitialLotSize。 • 目标价格:建仓价 + TakeProfitPoints。 • 调整后价格:目标价格 + SlippageTolerance。 • 止损挂单: • SELL STOP手数:InitialLotSize * LotMultiplier。 • 目标价格:建仓价 - StopLossPoints。 • 调整后价格:目标价格 - SlippageTolerance。 挂单规则: • 主仓平仓后,自动删除另一未触发挂单,避免冲突。 2.2 防滑点机制 挂单价格调整: • 在挂单时,根据目标价格和滑点容忍度调整挂单价格。 • BUY STOP挂单:调整后价格 = 目标价格 + SlippageTolerance。 • SELL STOP挂单:调整后价格 = 目标价格 - SlippageTolerance。 滑点检测与处理: • 在订单成交时,检测实际成交价格与预期价格的偏差。 • 如果偏差 ≤ SlippageTolerance,正常执行订单。 • 如果偏差 > SlippageTolerance,取消订单并重新挂单。 2.3 情景1:触发止盈 操作流程: 1. 主仓BUY 0.01手触发止盈,盈利平仓。 2. 系统自动删除止损挂单SELL STOP 0.02手。 3. 执行止盈挂单BUY STOP 0.01手。 4. 新挂单设置: • 止盈挂单:BUY STOP 0.01手,调整后价格 = 目标价格 + SlippageTolerance。 • 止损挂单:SELL STOP 0.02手,调整后价格 = 目标价格 - SlippageTolerance。 2.4 情景2:触发止损 操作流程: 1. 主仓BUY 0.01手触发止损,亏损平仓。 2. 系统自动删除止盈挂单BUY STOP 0.01手。 3. 执行止损挂单SELL STOP 0.02手。 4. 新挂单设置: • 止盈挂单:SELL STOP 0.01手,调整后价格 = 目标价格 - SlippageTolerance。 • 止损挂单:BUY STOP 0.04手,调整后价格 = 目标价格 + SlippageTolerance。 2.5 连续亏损加仓逻辑 第二次止损(SELL 0.02手被触发止损): 1. 价格反弹至2880,触发止损挂单BUY STOP 0.04手。 2. 平仓SELL 0.02手,亏损4元。 3. 自动触发挂单建仓BUY 0.04手,建仓价2880。 4. 新挂单设置: • 止盈挂单:BUY STOP 0.01手,调整后价格 = 目标价格 + SlippageTolerance。 • 止损挂单:SELL STOP 0.08手,调整后价格 = 目标价格 - SlippageTolerance。 第三次止损(BUY 0.04手被触发止损): 1. 价格跌至2878,触发止损挂单SELL STOP 0.08手。 2. 平仓BUY 0.04手,亏损8元。 3. 自动触发挂单建仓SELL 0.08手,建仓价2878。 4. 建仓后触发止盈或止损,返回初始建仓逻辑。 连续3次亏损后重置: • 下次建仓恢复初始手数0.01手,挂单逻辑同步重置。 3. 关键规则总结 1. 挂单逻辑优化: • 主仓平仓后,立即删除另一未触发挂单,仅保留有效挂单。 • 止盈方向使用BUY STOP / SELL STOP(突破追单,防滑点)。 • 止损方向使用反向SELL STOP / BUY STOP(翻倍建仓)。 2. 手数与风控: • 亏损后手数翻倍(0.01 → 0.02 → 0.04 → ...),上限50手。 • 盈利或连续3次亏损后,手数重置为0.01手。 3. 止盈止损: • 所有订单止盈止损2元(可设置参数),不随亏损次数翻倍。 • 计算公式: • BUY订单:止损价 = 建仓价 - 2,止盈价 = 建仓价 + 2。 • SELL订单:止损价 = 建仓价 + 2,止盈价 = 建仓价 - 2。 4. 防滑点机制: • 挂单价格根据滑点容忍度调整。 • 滑点过大时取消订单并重新挂单。谁能帮我写一个简单的EA吗???
- 参数设置 plaintext 复制代码 # 初始建仓参数