0

Im building a strategy on pinescript that entries in every single candle in the minute timeframe, and of course exit before the close, and the entry should happen after a short delay after the open of the candle has formed, anyone has any idea how to do this? pls help cause I cant find how anywhere on the internet, I really need a solution

D YAY
  • 19
  • 5

1 Answers1

0

You cannot do that in a strategy.

It is also not so easy with an indicator.

You should use timenow built-in variable and get the current time in UNIX format which will be in milliseconds. Then find the difference between open time and current time in milliseconds and convert it to seconds.

You should also be using a varip variable to see if 6 seconds has elapsed and if you entered a position. You need a varip because you want this variable(s) to keep their value(s) between the updates of a real-time bar.

vitruvius
  • 15,740
  • 3
  • 16
  • 26
  • Ty man, I'll try working on that, if I can't I'll switch to another coding language XDDD – D YAY Dec 04 '22 at 02:57