Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Hello, I am quite new to easy language, recently I wrote to exercise myself, this Signal in Multicharts to enter a trade at given day of week in a given hour in the inputs for the SP future 30 minutes chart, and exit the trade at another day of week and hour.
Basically it never enter the trade on Monday, I also tryed to optimize for MyBeginningDay and it never feels like it is Monday = 1...Same thing with the hour it randomly take a different hour to exit the trade on the same day most of the time.
I have quite an headache understating what can be the problem for this simple and stupid code.
I am also sure I setup properly symbol session time in quote manager, using exchange session time zone. And I also removed holidays.
-Are the bars provided by IQfeed not properly set? or is it because I am doing something wrong with the code or datafeed?
-Is there some difference between datafeed exchange time, local time and bars time?
-Any suggestions to improve the code and make it work as intended?
Can you help answer these questions from other members on NexusFi?
I tried it, and got plenty of Monday entries (I added one print statement so you can see):
buy on Monday 1200106.00
buy on Monday 1200113.00
buy on Monday 1200120.00
buy on Monday 1200127.00
buy on Monday 1200203.00
buy on Monday 1200210.00
buy on Monday 1200217.00
buy on Monday 1200224.00
buy on Monday 1200302.00
buy on Monday 1200309.00
buy on Monday 1200316.00
buy on Monday 1200323.00
buy on Monday 1200330.00
buy on Monday 1200406.00
buy on Monday 1200413.00
buy on Monday 1200420.00
buy on Monday 1200427.00
buy on Monday 1200504.00
buy on Monday 1200511.00
buy on Monday 1200518.00
buy on Monday 1200525.00
buy on Monday 1200601.00
buy on Monday 1200608.00
buy on Monday 1200615.00
buy on Monday 1200622.00
buy on Monday 1200629.00
buy on Monday 1200706.00
buy on Monday 1200713.00
buy on Monday 1200720.00
buy on Monday 1200727.00
buy on Monday 1200803.00
buy on Monday 1200810.00
buy on Monday 1200817.00
buy on Monday 1200824.00
buy on Monday 1200831.00
buy on Monday 1200907.00
buy on Monday 1200914.00
buy on Monday 1200921.00
buy on Monday 1200928.00
buy on Monday 1201005.00
buy on Monday 1201012.00
buy on Monday 1201019.00
buy on Monday 1201026.00
buy on Monday 1201102.00
buy on Monday 1201109.00
buy on Monday 1201116.00
buy on Monday 1201123.00
buy on Monday 1201130.00
buy on Monday 1201207.00
buy on Monday 1201214.00
buy on Monday 1201221.00
buy on Monday 1201228.00
I also optimized for Entry hour, and got plenty of entries every hour...
Thank you Kevinkdog and SMCJB, but I guess something is wrong with multicharts, once I have tradestation I will also test this in that platform perhaps it is just a problem of multicharts and iqfeed bar data. Did not know about the difference between sellshort and sell, thank you this was helpful.
Thank you Kevinkdog and SMCJB, but I guess something is wrong with multicharts, once I have tradestation I will also test this in that platform perhaps it is just a problem of multicharts and iqfeed bar data. Did not know about the difference between sellshort and sell, thank you this was helpful.
I get the same results in MultiCharts - I cannot duplicate the issues you mentioned.
Trading: Primarily Energy but also a little Equities, Fixed Income, Metals, U308 and Crypto.
Frequency: Many times daily
Duration: Never
Posts: 5,085 since Dec 2013
Thanks Given: 4,434
Thanks Received: 10,274
M4STR0
Did not know about the difference between sellshort and sell, thank you this was helpful.
Buy and Sellshort enter new positions. If you currently have a position in the opposite direction it will both close it and enter the new position (ie reverse the position).
Buytocover and Sell will only close positions.
input: NContracts(1);
input: MyTimeEntry(2200), MyTimeExit(2200);
input: MyBeginningDay(1), MyEndingDay(3);
input: Mystop(0), Myprofit(0), MyBreakeven(0);
print(datetimetostring(datetime), " ", "dayofweek(d):", dayofweek(d)," ", "Time:", Time," ", "dayofweek(date):", dayofweek(date));
if Time = MyTimeEntry and dayofweek(d) = MyBeginningDay then buy ("Bias_Long") NContracts contracts next bar market;
if Time = MyTimeExit and dayofweek(d) = MyEndingDay then sell ("Bias_Short") NContracts contracts next bar at market;
setstopcontract;
if MyStop > 0 then setstoploss(Mystop);
if MyBreakeven > 0 then setbreakeven(MyBreakeven);
if MyProfit > 0 then setprofittarget(MyProfit);
for starters the data I got ends the 21/12/2020 and looks like the day 1.00 of the week never gets to hour 22000...
Perhaps for Monday I have to use day 0 instead of 1
I am using this session time settings now, before I saw I did a mistake between the days
Open Time Close Time Session End
Sunday 17:00 Monday 16:00 X
Monday 17:00 Tuesday 16:00 X
Tuesday 17:00 Wednesday 16:00 X
Wedsnesday 17:00 Thurdsday 16:00 x
Thurdsday 17:00 Friday 16:00 x
and Exchange time in the instrument chart settings for the SP future
Anyway, now that I fixed the session time settings I see it still does not start most of the time in monday, this is really weird.
Something is goofy here, because if you are using 30 minute bars, you should have a print statement printing out every 30 minutes. You don't have any print statements at 630, 730 etc, and you are missing a lot of bars at 00 times.