Hi there,
I have a question that could be very easy to answer for who is better than me starting code. How can I say Buy long only when daily candle crosses zero line from red to green and viceversa? except for the exact moment it forms for the first time, that should be early in the morning. thank’s in advance
Alessio
I want to help but don’t understand exactly what do you want to do, buy when DayClose > DayOpen ?
TimeFrame(Daily)
IF Close > Open Then
Buy 1 shares at market
ELSIF Close < Open Then
SellShort 1 shares at market
ENDIF
JSParticipant
Senior
Hi,
If I understand correctly, you must use a smaller time frame than the daily time frame, for example 5 minutes or 1 hour…
Your starting point is the daily open and then you check whether the Close crosses over or below the daily open…
DefParam CumulateOrders=False
TimeFrame(1 hour)
DailyOpen = DOpen(0)
If Close crosses over DailyOpen then
Buy 1 contract at Market
ElsIf Close crosses under DailyOpen then
SellShort 1 contract at Market
EndIf
Yes, thank’s, that’ the idea. I’ll test it soon.