Hello All,
Basically I want to leave all trades I have entered at same bar.
The timeframe I am using is daily, as you can see I have two limit orders and I want to close all my positions by the end of the day, I believe this is the proper code but heres the error I get.
This error doesnt happen when I try sending only one order.
CODE:
Please log in to see this code.
Size:
Color:
Hello,
The error message "Bar number must be X or greater" suggests in this context that you cannot sell a Position before creating it e.g. on bar #19 whereas it was established on bar #20.
Check out this example, it should work. Notice how the shortcut to
Position.AllPositions closes all positions at once (see QuickRef for more detail):
CODE:
Please log in to see this code.
Size:
Color:
Thanks for saying thank you.
Size:
Color: