Intraday current price
Author: dr_kin_cheung
Creation Date: 1/4/2011 11:17 AM
profile picture

dr_kin_cheung

#1
Hi all,

I am a newbie to write trading scripts. Please help.

This is for intraday with bar = minute.
I am trying to create an entry position with the condition that if the current price of a stock is greater than the intraday high then buy at the market within the same bar (not the next bar).

Here is the code:

if( Current.Price > HighestHighAsofBar[bar])
BuyAtMarket(bar);

I have seen many codes to buy at the market on the next bar (BuyAtMarket(bar+1)) but this is not exactly what I need.
Is there such thing as "Current.Price"?
I greatly appreciate your input!

Kin
profile picture

Eugene

#2
QUOTE:
Here is the code:

...and it badly peeks into the future, rendering it useless in real life. Nobody can buy at open (at market) of the current bar once its high has been determined (because it has already closed by then). Long story short, there is no such thing as "current price" but you probably can accomplish what you're after by issuing a stop or limit order.

Hope this link clarifies the process:

Is it necessary to have access to intra-bar tick data to daytrade with Wealth-Lab?
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).