Buy on certin dates, not on technical singal
Forums › ProRealTime English forum › ProOrder support › Buy on certin dates, not on technical singal
- This topic has 21 replies, 4 voices, and was last updated 9 months ago by Laliberte.
-
-
02/22/2024 at 3:15 PM #22857602/22/2024 at 9:53 PM #228601
Hi PeterST,
I’m struggling to get it working. Can you help me with the correct modification?This is the last test I did:
1234567891011121314151617181920212223242526272829303132// LONG open dates$myDateL[1] = 20230316$myDateL[2] = 20230328$myDateL[3] = 20230411$myDateL[4] = 20230424// LONG exit dates$myExitL[1] = 20230321$myExitL[2] = 20230403$myExitL[3] = 20230417$myExitL[4] = 20230428LastElementL = 4SLpercent = 2 //2% stop loss//IF Not OnMarket THENFOR i = 1 TO (LastElementL)//LONG tradesIF i <= LastElementL THENIF Date = $myDateL[i] THENBUY 1 CONTRACT AT MARKETSET STOP %LOSS SLpercentbreakENDIFENDIF// exit LONG tradesIF LongOnMarket THENFOR i = 1 TO LastElementLIF Date = $myExitL[i] THENSELL AT MARKETbreakENDIFNEXTENDIFThanks again for your input.
02/22/2024 at 9:55 PM #22860202/22/2024 at 10:24 PM #228603Hi,
Try this one…
Buy On Certain Dates1234567891011121314151617181920212223242526272829303132// LONG open dates$myDateL[1] = 20230316$myDateL[2] = 20230328$myDateL[3] = 20230411$myDateL[4] = 20230424// LONG exit dates$myExitL[1] = 20230321$myExitL[2] = 20230403$myExitL[3] = 20230417$myExitL[4] = 20230428LastElementL = 4SLpercent = 2 //2% stop loss//IF Not OnMarket ThenFOR i = 1 TO (LastElementL) // Enter LONG TradesIF Date = $myDateL[i] THENBuy 1 Contract at MarketSet STOP %LOSS SLpercentBreakEndIfNextEndIf// Exit LONG TradesIF LongOnMarket THENFOR i = 1 TO LastElementLIF Date = $myExitL[i] THENSELL AT MARKETBreakEndIfNextEndIf02/23/2024 at 1:13 PM #228641Hi PeterST,
I’m struggling to get it working. Can you help me with the correct modification?
This is the last test I did:Hello Fredrik,
Can you please tell once again what exactly is not working with “the last test you did” ?
Also, when you receive an error message, then it is good to know what the message is. 😉
Peter
02/23/2024 at 11:25 PM #22867202/23/2024 at 11:27 PM #228673 -
AuthorPosts
Find exclusive trading pro-tools on
Similar topics: