@Tomasz@fxshrat
I have gone through many many posts but still could not figure out a solution, so finally I have decided to seek help.
I want to send an automated order based on:
If (lastvalue(Buy)) { send order....}
I tried to explore and find out why orders are not triggered. I saw that although the BUY array is 1 at places, lastvalue (Buy) never turns 1. I even tried if ( LastValue( Ref(Buy,-1) ) cause one of the users said that Lastvalue is a forward looking function.
No, it depends on how it is used. It may be and may not be forward looking if using LastValue() function.
If you get LastValue(Buy) being zero then there simply is no TRUE signal on last bar. It just returns the state being there. It does not invent new states. Besides your buy rule is unknown and your picture of sample result list is not telling much.