Making Trades at Close
Author: pestocat2
Creation Date: 6/25/2018 10:33 PM
profile picture

pestocat2

#1
It seems that the Buys and Sells are made at the opening price. Is there a way to use the Close price. I've searched WLP and Forum and can't find anything about setting time-of-day for Buys and Sells.
profile picture

superticker

#2
Well, if you're doing Market orders, then of course you're going to get the opening price because all the orders execute when the market opens. There are BuyAtClose and SellAtClose orders as you probably read about in the WL Programming Guide under Programming Trading Strategies.

In production code, "when" you buy (AtOpen or AtClose) isn't the main concern. Rather, it all about price. So you're typically buying and selling using Limit and Stop orders, or both (i.e. a "bracketed" order). I use very few AtMarket (buying at open) orders. And I've never used an AtClose order (although I thought about it).

I typically issue all my SellAtStop and SellAtLimit orders before the market opens so they're automatically triggered some time during the day at the right price. My Buy orders are done manually off the Quotes window Alerts during the first 15 minutes after the market opens. I like to manually inspect the Chart and fundamentals before each Buy. All my Buys are done with Stop orders (Yes, I'm a buy-high trader.), so the Quotes window alerts when each high Stop price is met.

If you're a buy-low trader (most people are), then Alerting on a Limit price may make more sense because you're waiting for a bottom (low) price.
profile picture

pestocat2

#3
My goal is just to get the Close price for reporting in a back test. It would seem that the Close price may have more meaning as it uses all things that moved the markets for that day. In practice, I use limit orders during the day and watch my key indicators near the Close to make any changes either a new Buy or Sell to get out.
Gary

profile picture

Eugene

#4
In this case you can use BuyAtClose[bar].
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).