Can someone please help code a basic end of day stock trading strategy? Buy next day if the price reaches => today’s high. I will need to work on an exit strategy.
This is my code that does work properly :
If not longonmarket and high >= DHigh(1) then
buy at market
ENDIF
Thanks very much!
Welcome to the forums.
I have moved your post as it was in the wrong forum. You posted in the ProBuilder forum which is for indicator questions/topics. I have moved it to the ProOrder section which is for strategy questions/topics. Please try to post in the correct forum with future topics to maximize your chance of finding a solution and to prevent any confusion..
Also please use the ‘Insert PRT Code’ button when posting code as it makes it easier for others to read. I have tidied up your post. 🙂
How about …
//Your Entry
If not longonmarket and high >= DHigh(1) then
buy at market
ENDIF
//Exit for you to Consider a value for x?
If Longonmarket and close < Average(x) Then
Sell at Market
Endif
Thanks, GraHal for moving this post. Can you or someone please correct my code? It does not enter and exit based on my strategy. It is an EOD strategy.
Buy next day if the price reaches => today’s high. Sell (if in the market) if the price drops to previous days low. Thanks very much!
If not longonmarket and high >= DHigh(1) then
buy at market
ENDIF
If longonmarket and low <= DLow(1) then
Sell at market
ENDIF
If not longonmarket then
buy 1 contract at DHigh stop
SellPrice = DLow
ENDIF
Sell at SellPrice stop
This places pending orders on the market. Use on daily chart.