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
Size:
Color:
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?
Size:
Color: