Restricting intraday trades to 1 trade/stock
Author: dankimel
Creation Date: 9/22/2009 7:20 PM
profile picture

dankimel

#1
How can I restrict my intraday trading script to eliminate multiple trades of a single stock in my Data Series?
profile picture

Eugene

#2
That's how I would go about it:

1. Create and initialize a boolean variable (e.g. (bool restrictTrading = false) = still can trade) or a counter (1,2... trade(s) in a symbol i.e. integer variable)
2. Before entering, check that variable (e.g. if it's false, still can enter trades)
3. When a Position is created ( e.g. if( BuyAt... != null ), set it to true.
4. When the Position is exited, or some other condition, reset the variable back to false.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).