Good morning, I am grateful to this community for the wealth of ideas it provides. As a token of my gratitude, I am posting my first humble contribution: a strategy based simply on the ADX indicator and applied to the 30-minute Nasdaq index (but it can be adapted to other indices by optimising k, u, stop loss and gain). It only operates in the first part of the week and closes on Thursday. Comments and advice are welcome. Thank you.
Here is the code:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
//nasdaq 30 minuti DEFPARAM CumulateOrders = False // Posizioni cumulate disattivate // Condizioni per entrare su posizioni long K=16 u=26 n=1 s=7 indicator1 = DIplus[s] (CLOSE) indicator2 = DIminus[s](close) c3 = (ADX[s]>K) c5 = INDICATOR1 crosses over u c2= indicator1>u c6= adx[s] crosses over k finestra= (dayofweek=1 or dayofweek=2 or dayofweek=3) IF ((c3 and c5) or( c6 and c2)) and finestra THEN BUY n CONTRACT AT MARKET ENDIF if currentdayofweek=4 and time >= 175000 THEN Sell n contract at market Endif // Stop e target SET STOP pLOSS 600 SET TARGET pPROFIT 200 |
Share this
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.
ProRealTime ITF files and other attachments :PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
