The pine code problem

Author: Beans 888, Created: 2023-03-14 00:21:53, Updated:

Problems with execution Opening and closing price execution, mobile stop-loss needs to be executed in real time, currently found that both cannot be done at the same time, or that my code or setting has a problem


More

The Good PlaceI've had the same problem before, and I'm still trying to get the webhook signal to fmz, but the slider has a big impact.

The grassThe two should not exist at the same time

The grassDepending on the setup of the strategy, the execution of the strategy model is also different, divided into a closing price model and a real-time price model. The concept of closing price model, real-time price model, we have also briefly introduced before. The closing model When the strategy code is executed, the cycle of the current K-line Bar is fully executed, and the K-line cycle is over when the K-line closes. At this time, the Pine strategy logic is executed again, and the triggered trading signal is executed at the beginning of the next K-line Bar. Real-time pricing model When the strategy code is executed, the current K-line Bar is executed repeatedly on each change in the market, whether it is closed or not, and the triggered trading signal is executed immediately. This is a list of all the different ways Fmz.com is credited in the database.

Beans 888It is true that FMZ's current closing time is separated from real time, which is unfriendly to stop-motion tracking, and on TV it is also more ribbed, if you do not do well, it is redrawn, the slider is mainly an error in the signal processing time, which is inevitable, it can never be specified with a second cycle.

Beans 888Can you give me an example?

The grassAsked if the strategy is set to a closing price model, the stop loss is also executed at the closing price. A shorter cycle can be set for a stop loss.

Beans 888Thank you, I'll wait for your reply.

The grassToday I asked about this mechanism.

Beans 888Stop the profit. This is a list of all the different ways Tpl is credited in the database. If you have a problem with the last_open_longCondition, you can use the following command:

The grassWhen you use strategy.exit, does the trail_price stop, isn't this real time?

Beans 888It's possible to do it on TV, if our FMZ operating environment doesn't support it.

Beans 888That's the question I'm going to ask, the current strategy is to close the price to execute the entry, the fact is that the price moves the stop, and if you close the price to execute the stop, you lose a lot of profit or even loss.