Hi,
How can I buy and sell a stock with Open price at the beginning of the day and to Sell at the end of the day.
For example AAPL :
- start a day at 53.5 - I want to Buy
- end the same day at 54.0 - I want to Sell .
Thanks
-
The opinions expressed in these forums do not represent those of C2, and any discussion of profit/loss is not indicative of future performance or success. There is a substantial risk of loss in trading. You should therefore carefully consider whether such trading is suitable for you in light of your financial condition. You should read, understand, and consider the Risk Disclosure Statement that is provided by your broker before you consider trading. Most people who trade lose money.
Hi,
How can I buy and sell a stock with Open price at the beginning of the day and to Sell at the end of the day.
For example AAPL :
Thanks
-
Implemented.
There is an option “AllowSameBarExit” in Seetu now:
SetOption("AllowSameBarExit",FALSE);
or
SetOption("AllowSameBarExit",TRUE);
A default value (when this option is not used at all) is FALSE
Here is an example code:
SetOption("AllowSameBarExit",TRUE);
BuyPrice = Open; // Buy at Open prices
SellPrice = Close; // Sell at Close prices
Buy = Cross(CalcMACD(), CalcMACDSignal());
// Sell at the same bar
Sell = Buy;
Effects:
Happy trading!
Thanks Bob. It’s very helpful