Buy Signal
Author: aphelps7
Creation Date: 10/1/2008 7:17 PM
profile picture

aphelps7

#1
In my strategy I use the following buy signal:

BuyAtLimit(bar , Close[bar], "BuySignal");

This always buys on the next days bar at the open price. Is there a way to get this to buy at the closing price of the current day?

profile picture

Eugene

#2
To buy at the closing price, you could simply use BuyAtClose.
QUOTE:
This always buys on the next days bar at the open price.

Can you post an example?
profile picture

Cone

#3
Of course it will buy at the open if Close > Open, but it's not doing it on the next bar; you're doing it on this bar.

BuyAtLimit(bar , Close[bar], "BuySignal"); is a mistake.
You must code it as BuyAtLimit(bar + 1, Close[bar], "BuySignal"); otherwise it's peeking.