【Hedging对冲EA】反向对冲的锁仓功能会在总体止盈后仍然开单进行锁仓
<div class="ce-block ce-block--focused" data-id="3Z8Xk9PnQM" ><div class="ce-block__content">
<div class="ce-paragraph cdx-block ce-paragraph--left">遇到问题:当总体止盈--净值增加全平触发全平以后,反向对冲里面的锁仓功能在全平以后还会延续平仓前的判断继续锁仓,也就是说全平掉所有订单以后会滞后补一单锁仓的订单,由于之前可能会有大量双向订单不断对冲,最后补的锁仓单很可能手数会偏大。</div>
</div>
</div><div class="ce-block ce-block--focused" data-id="Lkh41fxsK8" >
<div class="ce-block__content">
<div class="ce-paragraph cdx-block ce-paragraph--left">希望结果:总体止盈触发以后能中断这个锁仓的判断。</div>
</div>
</div><div class="ce-block ce-block--focused" data-id="JQeIGOcmty" >
<div class="ce-block__content">
<div class="ce-paragraph cdx-block ce-paragraph--left">在想法解决这个问题时,尝试用强平最后一单这个功能,但显然这个补的锁仓单并不被认定为最后一单,所以强平不了。没截图,问题描述应该还是比较清晰的。回测和实盘都碰到过。辛苦老师看看有没有办法处理这个问题🙏</div>
</div>
</div><style type="text/css">
.ce-block {
margin-bottom: 20px;
}
.ce-block__content,.ce-toolbar__content {
/* max-width:calc(100% - 50px) */
margin-left: auto;
margin-right: auto;
}
.ce-paragraph {
line-height: 1.6em;
outline: none;
text-indent: 2em;
font-size: 16px;
}
.ce-paragraph--right {
text-align: right;
}
.ce-paragraph--center {
text-align: center;
}
.ce-paragraph--left {
text-align: left;
}
.ce-paragraph--justify {
text-align: justify;
}
.ce-paragraph-text-indent {
text-align: justify;
}
.ce-paragraph:empty::before{
content: attr(data-placeholder);
color: #707684;
font-weight: normal;
opacity: 0;
}
/** Show placeholder at the first paragraph if Editor is empty */
.codex-editor--empty .ce-block:first-child .ce-paragraph:empty::before {
opacity: 1;
}
.codex-editor--toolbox-opened .ce-block:first-child .ce-paragraph:empty::before,
.codex-editor--empty .ce-block:first-child .ce-paragraph:empty:focus::before {
opacity: 0;
}
.ce-paragraph p:first-of-type{
margin-top: 0;
}
.ce-paragraph p:last-of-type{
margin-bottom: 0;
}
.svg-icon {
width: 1em;
height: 1em;
}
.svg-icon path,
.svg-icon polygon,
.svg-icon rect {
fill: #4691f6;
}
.svg-icon circle {
stroke: #4691f6;
stroke-width: 1;
}
</style><style type="text/css">
.inline-code {
background: rgba(250, 239, 240, 0.78);
color: #b44437;
padding: 3px 4px;
border-radius: 5px;
margin: 0 1px;
font-family: inherit;
font-size: 0.86em;
font-weight: 500;
letter-spacing: 0.3px;
}
</style> 好的,会检查的。 这个问题确实也碰到过,等待老师的解决办法 <div class="ce-block ce-block--focused" data-id="i-yU4AIZZd" >
<div class="ce-block__content">
<div class="ce-paragraph cdx-block ce-paragraph--left">那个强平最后一单,是指的如果对冲平仓这个动作之后,如果只剩下一单,才会强平这一单。你这个是净值增加全平的,就触发不到这个强平最后一单。</div>
</div>
</div><div class="ce-block ce-block--focused" data-id="1gt2lLy1OW" >
<div class="ce-block__content">
<div class="ce-paragraph cdx-block ce-paragraph--left">我用回测试了,反向对冲的锁仓开关打开之后,是一直有锁仓的,根本就触发不到净值增加全平啊。</div>
</div>
</div><div class="ce-block ce-block--focused" data-id="AytdrfYOEq" >
<div class="ce-block__content">
<div class="cdx-block image-tool image-tool--filled ">
<div class="image-tool__image">
<div class="image-tool__image-preloader" style=""></div>
<img id="aimg_AytdrfYOEq" class="image-tool__image-picture _zoom" src="https://www.eabang.com/bbs/data/attachment/forum/202607/28/190721heez4sprjp2jr4xx.png" title="" alt="" data-aid="8342"/>
</div>
<div class="cdx-input image-tool__caption" data-placeholder=""></div>
</div>
</div>
</div><div class="ce-block ce-block--focused" data-id="ZtG4RW76ty" >
<div class="ce-block__content">
<div class="ce-paragraph cdx-block ce-paragraph--left">如果设置成“锁仓仓位按净仓位”能触发全平,全平后也没有再锁仓。</div>
</div>
</div><style type="text/css">
.ce-block {
margin-bottom: 20px;
}
.ce-block__content,.ce-toolbar__content {
/* max-width:calc(100% - 50px) */
margin-left: auto;
margin-right: auto;
}
.ce-paragraph {
line-height: 1.6em;
outline: none;
text-indent: 2em;
font-size: 16px;
}
.ce-paragraph--right {
text-align: right;
}
.ce-paragraph--center {
text-align: center;
}
.ce-paragraph--left {
text-align: left;
}
.ce-paragraph--justify {
text-align: justify;
}
.ce-paragraph-text-indent {
text-align: justify;
}
.ce-paragraph:empty::before{
content: attr(data-placeholder);
color: #707684;
font-weight: normal;
opacity: 0;
}
/** Show placeholder at the first paragraph if Editor is empty */
.codex-editor--empty .ce-block:first-child .ce-paragraph:empty::before {
opacity: 1;
}
.codex-editor--toolbox-opened .ce-block:first-child .ce-paragraph:empty::before,
.codex-editor--empty .ce-block:first-child .ce-paragraph:empty:focus::before {
opacity: 0;
}
.ce-paragraph p:first-of-type{
margin-top: 0;
}
.ce-paragraph p:last-of-type{
margin-bottom: 0;
}
.svg-icon {
width: 1em;
height: 1em;
}
.svg-icon path,
.svg-icon polygon,
.svg-icon rect {
fill: #4691f6;
}
.svg-icon circle {
stroke: #4691f6;
stroke-width: 1;
}
</style><style type="text/css">
.ce-block {
margin-bottom: 20px;
}
.ce-block__content,.ce-toolbar__content {
/* max-width:calc(100% - 50px) */
margin-left: auto;
margin-right: auto;
}
.image-tool {
--bg-color: #cdd1e0;
--front-color: #388ae5;
--border-color: #e8e8eb;
}
.image-tool__image {
border-radius: 3px;
overflow: hidden;
margin-bottom: 10px;
}
.image-tool__image-picture {
max-width: 100%;
vertical-align: bottom;
display: block;
margin-left: auto;
margin-right: auto;
}
.image-tool__image-preloader {
width: 50px;
height: 50px;
border-radius: 50%;
background-size: cover;
margin: auto;
position: relative;
background-color: #cdd1e0;
background-position: center center;
}
.image-tool__image-preloader::after {
content: "";
position: absolute;
z-index: 3;
width: 60px;
height: 60px;
border-radius: 50%;
border: 2px solid #cdd1e0;
border-top-color: #388ae5;
left: 50%;
top: 50%;
margin-top: -30px;
margin-left: -30px;
animation: image-preloader-spin 2s infinite linear;
box-sizing: border-box;
}
.image-tool__caption::before {
position: absolute !important;
content: attr(data-placeholder);
color: #707684;
font-weight: normal;
display: none;
}
.image-tool__caption:empty::before {
display: block;
}
.image-tool__caption:empty:focus::before {
display: none;
}
.image-tool--empty .image-tool__image {
display: none;
}
.image-tool--empty .image-tool__caption, .image-tool--loading .image-tool__caption {
display: none;
}
.image-tool .cdx-button {
display: flex;
align-items: center;
justify-content: center;
}
.image-tool .cdx-button svg {
height: auto;
margin: 0 6px 0 0;
}
.image-tool--filled .cdx-button {
display: none;
}
.image-tool--filled .image-tool__image-preloader {
display: none;
}
.image-tool--loading .image-tool__image {
min-height: 200px;
display: flex;
border: 1px solid #e8e8eb;
background-color: #fff;
}
.image-tool--loading .image-tool__image-picture {
display: none;
}
.image-tool--loading .cdx-button {
display: none;
}
/**
* Tunes
* ----------------
*/
.image-tool--withBorder .image-tool__image {
border: 1px solid #e8e8eb;
}
.image-tool--withBackground .image-tool__image {
padding: 15px;
background: #cdd1e0;
}
.image-tool--withBackground .image-tool__image-picture {
max-width: 60%;
margin: 0 auto;
}
.image-tool--stretched .image-tool__image-picture {
width: 100%;
}
.image-tool__caption {
text-align: center;
font-size: 14px;
color: #a3a3a3;
}
@keyframes image-preloader-spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
</style><style type="text/css">
.inline-code {
background: rgba(250, 239, 240, 0.78);
color: #b44437;
padding: 3px 4px;
border-radius: 5px;
margin: 0 1px;
font-family: inherit;
font-size: 0.86em;
font-weight: 500;
letter-spacing: 0.3px;
}
</style> <div class="quote"><blockquote><font size="2"><a href="https://www.eabang.com/bbs/forum.php?mod=redirect&goto=findpost&pid=77611&ptid=8382" target="_blank"><font color="#999999">saila888 发表于 2026-6-24 20:34</font></a></font><br />
这个问题确实也碰到过,等待老师的解决办法</blockquote></div><div class="ce-block ce-block--focused" data-id="f0s6GuWRNR" >
<div class="ce-block__content">
<div class="ce-paragraph cdx-block ce-paragraph--left">用6.7版本试试。</div>
</div>
</div><div class="ce-block ce-block--focused" data-id="e-qcajSqjf" >
<div class="ce-block__content">
<div class="ce-paragraph cdx-block ce-paragraph--left"><a href="https://www.eabang.com/bbs/thread-8459-1-1.html" target="_blank" rel="nofollow">https://www.eabang.com/bbs/thread-8459-1-1.html</a></div>
</div>
</div><style type="text/css">
.ce-block {
margin-bottom: 20px;
}
.ce-block__content,.ce-toolbar__content {
/* max-width:calc(100% - 50px) */
margin-left: auto;
margin-right: auto;
}
.ce-paragraph {
line-height: 1.6em;
outline: none;
text-indent: 2em;
font-size: 16px;
}
.ce-paragraph--right {
text-align: right;
}
.ce-paragraph--center {
text-align: center;
}
.ce-paragraph--left {
text-align: left;
}
.ce-paragraph--justify {
text-align: justify;
}
.ce-paragraph-text-indent {
text-align: justify;
}
.ce-paragraph:empty::before{
content: attr(data-placeholder);
color: #707684;
font-weight: normal;
opacity: 0;
}
/** Show placeholder at the first paragraph if Editor is empty */
.codex-editor--empty .ce-block:first-child .ce-paragraph:empty::before {
opacity: 1;
}
.codex-editor--toolbox-opened .ce-block:first-child .ce-paragraph:empty::before,
.codex-editor--empty .ce-block:first-child .ce-paragraph:empty:focus::before {
opacity: 0;
}
.ce-paragraph p:first-of-type{
margin-top: 0;
}
.ce-paragraph p:last-of-type{
margin-bottom: 0;
}
.svg-icon {
width: 1em;
height: 1em;
}
.svg-icon path,
.svg-icon polygon,
.svg-icon rect {
fill: #4691f6;
}
.svg-icon circle {
stroke: #4691f6;
stroke-width: 1;
}
</style><style type="text/css">
.inline-code {
background: rgba(250, 239, 240, 0.78);
color: #b44437;
padding: 3px 4px;
border-radius: 5px;
margin: 0 1px;
font-family: inherit;
font-size: 0.86em;
font-weight: 500;
letter-spacing: 0.3px;
}
</style> 我锁仓仓位用的是百分比70,因为还开了末单对冲,所以跑起来是一个动态减少逆势单,同时顺势单在加仓的一个情况,特别是单边时;净值增加全平是为了尽快脱离对冲风控这个过程,所以基本上会很快触发净值增加全平的。那么锁仓有时就会在全平完以后,自动补上一单(并不是每次都出现的)。猜测可能是锁仓按照成本线进行判断,比如当价格在多方向的成本线下方,并且空方向单数少于多方向就会按百分比锁单,补充部分空单,可是由于此前不断对冲,净值会不断增加因此,同时出现即触发了锁仓,又触发了平仓。 <div class="quote"><blockquote><font size="2"><a href="https://www.eabang.com/bbs/forum.php?mod=redirect&goto=findpost&pid=78038&ptid=8382" target="_blank"><font color="#999999">sample100 发表于 2026-7-31 21:18</font></a></font><br />
我锁仓仓位用的是百分比70,因为还开了末单对冲,所以跑起来是一个动态减少逆势单,同时顺势单在加仓的一个 ...</blockquote></div><div class="ce-block ce-block--focused" data-id="hR2Eq7iaGO" >
<div class="ce-block__content">
<div class="ce-paragraph cdx-block ce-paragraph--left">新版本加了这两个。</div>
</div>
</div><div class="ce-block ce-block--focused" data-id="s6zWfgpSz8" >
<div class="ce-block__content">
<div class="ce-paragraph cdx-block ce-paragraph--left">你可以试试吧。</div>
</div>
</div><div class="ce-block ce-block--focused" data-id="nBpCQ2ickW" >
<div class="ce-block__content">
<div class="cdx-block image-tool image-tool--filled ">
<div class="image-tool__image">
<div class="image-tool__image-preloader" style=""></div>
<img id="aimg_nBpCQ2ickW" class="image-tool__image-picture _zoom" src="https://www.eabang.com/bbs/data/attachment/forum/202608/01/083707obz3muudg5u3cg7u.png" title="" alt="" data-aid="8352"/>
</div>
<div class="cdx-input image-tool__caption" data-placeholder=""></div>
</div>
</div>
</div><div class="ce-block ce-block--focused" data-id="6-nhY3oINh" >
<div class="ce-block__content">
<div class="ce-paragraph cdx-block ce-paragraph--left">空仓时打开,锁仓后关闭。</div>
</div>
</div><style type="text/css">
.ce-block {
margin-bottom: 20px;
}
.ce-block__content,.ce-toolbar__content {
/* max-width:calc(100% - 50px) */
margin-left: auto;
margin-right: auto;
}
.ce-paragraph {
line-height: 1.6em;
outline: none;
text-indent: 2em;
font-size: 16px;
}
.ce-paragraph--right {
text-align: right;
}
.ce-paragraph--center {
text-align: center;
}
.ce-paragraph--left {
text-align: left;
}
.ce-paragraph--justify {
text-align: justify;
}
.ce-paragraph-text-indent {
text-align: justify;
}
.ce-paragraph:empty::before{
content: attr(data-placeholder);
color: #707684;
font-weight: normal;
opacity: 0;
}
/** Show placeholder at the first paragraph if Editor is empty */
.codex-editor--empty .ce-block:first-child .ce-paragraph:empty::before {
opacity: 1;
}
.codex-editor--toolbox-opened .ce-block:first-child .ce-paragraph:empty::before,
.codex-editor--empty .ce-block:first-child .ce-paragraph:empty:focus::before {
opacity: 0;
}
.ce-paragraph p:first-of-type{
margin-top: 0;
}
.ce-paragraph p:last-of-type{
margin-bottom: 0;
}
.svg-icon {
width: 1em;
height: 1em;
}
.svg-icon path,
.svg-icon polygon,
.svg-icon rect {
fill: #4691f6;
}
.svg-icon circle {
stroke: #4691f6;
stroke-width: 1;
}
</style><style type="text/css">
.ce-block {
margin-bottom: 20px;
}
.ce-block__content,.ce-toolbar__content {
/* max-width:calc(100% - 50px) */
margin-left: auto;
margin-right: auto;
}
.image-tool {
--bg-color: #cdd1e0;
--front-color: #388ae5;
--border-color: #e8e8eb;
}
.image-tool__image {
border-radius: 3px;
overflow: hidden;
margin-bottom: 10px;
}
.image-tool__image-picture {
max-width: 100%;
vertical-align: bottom;
display: block;
margin-left: auto;
margin-right: auto;
}
.image-tool__image-preloader {
width: 50px;
height: 50px;
border-radius: 50%;
background-size: cover;
margin: auto;
position: relative;
background-color: #cdd1e0;
background-position: center center;
}
.image-tool__image-preloader::after {
content: "";
position: absolute;
z-index: 3;
width: 60px;
height: 60px;
border-radius: 50%;
border: 2px solid #cdd1e0;
border-top-color: #388ae5;
left: 50%;
top: 50%;
margin-top: -30px;
margin-left: -30px;
animation: image-preloader-spin 2s infinite linear;
box-sizing: border-box;
}
.image-tool__caption::before {
position: absolute !important;
content: attr(data-placeholder);
color: #707684;
font-weight: normal;
display: none;
}
.image-tool__caption:empty::before {
display: block;
}
.image-tool__caption:empty:focus::before {
display: none;
}
.image-tool--empty .image-tool__image {
display: none;
}
.image-tool--empty .image-tool__caption, .image-tool--loading .image-tool__caption {
display: none;
}
.image-tool .cdx-button {
display: flex;
align-items: center;
justify-content: center;
}
.image-tool .cdx-button svg {
height: auto;
margin: 0 6px 0 0;
}
.image-tool--filled .cdx-button {
display: none;
}
.image-tool--filled .image-tool__image-preloader {
display: none;
}
.image-tool--loading .image-tool__image {
min-height: 200px;
display: flex;
border: 1px solid #e8e8eb;
background-color: #fff;
}
.image-tool--loading .image-tool__image-picture {
display: none;
}
.image-tool--loading .cdx-button {
display: none;
}
/**
* Tunes
* ----------------
*/
.image-tool--withBorder .image-tool__image {
border: 1px solid #e8e8eb;
}
.image-tool--withBackground .image-tool__image {
padding: 15px;
background: #cdd1e0;
}
.image-tool--withBackground .image-tool__image-picture {
max-width: 60%;
margin: 0 auto;
}
.image-tool--stretched .image-tool__image-picture {
width: 100%;
}
.image-tool__caption {
text-align: center;
font-size: 14px;
color: #a3a3a3;
}
@keyframes image-preloader-spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
</style><style type="text/css">
.inline-code {
background: rgba(250, 239, 240, 0.78);
color: #b44437;
padding: 3px 4px;
border-radius: 5px;
margin: 0 1px;
font-family: inherit;
font-size: 0.86em;
font-weight: 500;
letter-spacing: 0.3px;
}
</style>
页:
[1]