I'm going to ask the gods about my doubts about future functions!

Author: bitandrew, Created: 2017-03-06 12:43:31, Updated:

When writing a strategy, you will encounter this situation, where the current price breaks through a certain average line value, such as the 20-day average line, and you buy because in the current bar, this average line value is constantly changing. So I'm comparing the current price to this moving average, not counting the future value? If I compare with the previous bar's value, it will lead to a higher entry cost when the market rises rapidly and breaks the equation, which is very confusing, I don't know how you guys handle this, thank you!


More

bitandrewThank you, I'll try!

bitandrewThank you, I'll try!

edwardgywThe current bar is only calculated after the current bar has run out, so I suggest you use the value of the second diagonal as a standard, and buy it if the current price breaks this value.

ZeroBotVS has no future functions, all market data has no future functions and is simulated in real time.