I have a modified example code below for multicharts which works fine for me but is a probelm for the exchanges which i need to resolve. When market is open and my conidion is met then it will get me into a position and at the same time put a stoploss and targetprofit. Once the market closes my setstoploss and setprofittarget keep firing to the exchange and gets rejected over and over (500 times or more) until the market reopens and then it will put my stoploss and targetprofit which is correct and fine by me. However the exchanges dont like me to keep sending in the setstoploss and target profit orders over and over since its getting rejected during the market close time. How would i adjust the code so it wont do that but it will do it once the market is open so my intial position isnt exposed?
if marketposition = 0 and h>h then
buy 1 contracts next bar at h stop;
if marketposition = 0 and l<l then
sellshort 1 contracts next bar at l stop;
Go to QuoteManager and make sure you have the correct session defined for the instrument, and it will not do that.
Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.
Need help? 1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first. 2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses. 3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make. 4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance. 5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers. 6) Help using the forum? Watch this video to learn general tips on using the site.
If you want to support our community, become an Elite Member.