简体   繁体   中英

PineScript - Miltiple Entry/Exit arguments

I want to create multiple strategy.entry and exit arguments. But when I run the script, the other arguments will not activate because the previous line of entry argument is still in the trade and hasn't closed/exited yet. Do I have to define the total position size and specify it for each argument? if yes, can you explain it?

Thanks

If you want to have multiple entry/exits in the same direction, it is called pyramiding . By default it is set to zero. You need to either do it programmatically or manually change it.

pyramiding (const int) The maximum number of entries allowed in the same direction. If the value is 0, only one entry order in the same direction can be opened, and additional entry orders are rejected. The default value is 0.

strategy(title="MyStrategy", shorttitle="MS", pyramiding = 10)

Here is an old (v2) but good source on this matter.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM