Signal doesn't respect the time conditions to enter a trade - futures io
futures io



Signal doesn't respect the time conditions to enter a trade


Discussion in EasyLanguage Programming

Updated
    1. trending_up 493 views
    2. thumb_up 2 thanks given
    3. group 2 followers
    1. forum 4 posts
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • 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 and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

Signal doesn't respect the time conditions to enter a trade

(login for full post details)
  #1 (permalink)
Dvdkite
Trieste Italy
 
 
Posts: 162 since Feb 2018
Thanks: 131 given, 22 received

Hello Everyone,

I have a system that I actually use since months in real automated trading but very rarely it enter a trade before the time indicated in the time conditions.
My strategy works over a 3 minutes charts and is must enter a trade ONLY between 9:03 and 11:00 of the morning.
So basically I've done a simple code like this :

 
Code
//Time frame of the day where entries are allowed
isTheRightTime = ( time >= Time_MorningStart_at and time <= Time_MorningStop_at) or ( time >= Time_AfternoonStart_at and time <= Time_AfternoonStop_at);
I'm using Time_MorningStart_at = 903 and Time_MorningStop_at = 1100.

My trading system has to start checking bars from 9:00 and the early trade possible is exactly at the close of the first 3 minutes candle after the opening european bell that is at 9:00 gmt. As i said I need that the first candle is closed so I set the Time_MorningStart_at = 903.

Ok so doing that 99% of times work correctly but I have experienced some STOPLOSS due some early enters made between the 9:00 and 9:03... this mean that the system checked the 3 minutes bar between the 8:57 and 9:00 and then found the conditions to enter a trade, so at the opening of the following bar ( 9:00 - 9:03) it entered the trade ( WRONGLY BECAUSE it has only to start trading AFTER the first 3 minute bar starting from 9:00 indeed it should only allow trading some milliseconds after 9:03).

So How can I solve this? If you think that It would be enough to set the start at 9:06 that's not working and it miss a LOT of trades).

Any help is appreciated.
Thanks

David

Reply With Quote

Can you help answer these questions
from other members on futures io?
Bookmap replay files
Platforms and Indicators
Can anyone help convert this pine script to EasyLanguage?
EasyLanguage Programming
Server Sepcs
TradeStation
Looking for combined bar type (UniRenko with HeikinAshi) NT8
NinjaTrader
Order cumulation
TradeStation
 
 
(login for full post details)
  #2 (permalink)
 ABCTG   is a Vendor
 
 
Posts: 2,291 since Apr 2013
Thanks: 419 given, 1,525 received

Dvdkite,

from your description it sounds like you are working with 3 minute bars. A bar spanning from 9:00 to 9:03 will have the ending timestamp of 9:03 in Multicharts.
Having said that your condition would be true at every code calculation for this bar since Multicharts only uses the ending timestamp of the bar.

Regards,

ABCTG



Dvdkite View Post
Hello Everyone,

I have a system that I actually use since months in real automated trading but very rarely it enter a trade before the time indicated in the time conditions.
My strategy works over a 3 minutes charts and is must enter a trade ONLY between 9:03 and 11:00 of the morning.
So basically I've done a simple code like this :

 
Code
//Time frame of the day where entries are allowed
isTheRightTime = ( time >= Time_MorningStart_at and time <= Time_MorningStop_at) or ( time >= Time_AfternoonStart_at and time <= Time_AfternoonStop_at);
I'm using Time_MorningStart_at = 903 and Time_MorningStop_at = 1100.

My trading system has to start checking bars from 9:00 and the early trade possible is exactly at the close of the first 3 minutes candle after the opening european bell that is at 9:00 gmt. As i said I need that the first candle is closed so I set the Time_MorningStart_at = 903.

Ok so doing that 99% of times work correctly but I have experienced some STOPLOSS due some early enters made between the 9:00 and 9:03... this mean that the system checked the 3 minutes bar between the 8:57 and 9:00 and then found the conditions to enter a trade, so at the opening of the following bar ( 9:00 - 9:03) it entered the trade ( WRONGLY BECAUSE it has only to start trading AFTER the first 3 minute bar starting from 9:00 indeed it should only allow trading some milliseconds after 9:03).

So How can I solve this? If you think that It would be enough to set the start at 9:06 that's not working and it miss a LOT of trades).

Any help is appreciated.
Thanks

David


Follow me on Twitter Reply With Quote
The following user says Thank You to ABCTG for this post:
 
(login for full post details)
  #3 (permalink)
Dvdkite
Trieste Italy
 
 
Posts: 162 since Feb 2018
Thanks: 131 given, 22 received



ABCTG View Post
Dvdkite,

from your description it sounds like you are working with 3 minute bars. A bar spanning from 9:00 to 9:03 will have the ending timestamp of 9:03 in Multicharts.
Having said that your condition would be true at every code calculation for this bar since Multicharts only uses the ending timestamp of the bar.

Regards,

ABCTG

Hello ABCTG,

Yes as I said it is working on a 3 minutes bar and I know that MC consider 9:03 the endtime of the 900/903 bar. Base on this assumption I should have solved the problem by simply setting the START time of my signal at 9:06. Doing that it should start taking entries since 9:03... but it simply doen't work.
So there must be something I'm missing...

I really don't want that the system enter the market in the first bar 9:00 - 9:03 because it has to react to the first bar range after the opening bell that is 900. I'm using this system over the Mini DAX futures.

Don't you have any idea for a workaround? It is possible to add a conditions based on just the clock used by multicharts ( and not from the barchart )?

Thanks

David

Reply With Quote
 
(login for full post details)
  #4 (permalink)
 ABCTG   is a Vendor
 
 
Posts: 2,291 since Apr 2013
Thanks: 419 given, 1,525 received

David,

with the information I have I could only speculate and would have to analyze the situation to track down what exactly is going on to suggest a workaround.

Regards,

ABCTG


Dvdkite View Post
Hello ABCTG,

Yes as I said it is working on a 3 minutes bar and I know that MC consider 9:03 the endtime of the 900/903 bar. Base on this assumption I should have solved the problem by simply setting the START time of my signal at 9:06. Doing that it should start taking entries since 9:03... but it simply doen't work.
So there must be something I'm missing...

I really don't want that the system enter the market in the first bar 9:00 - 9:03 because it has to react to the first bar range after the opening bell that is 900. I'm using this system over the Mini DAX futures.

Don't you have any idea for a workaround? It is possible to add a conditions based on just the clock used by multicharts ( and not from the barchart )?

Thanks

David


Follow me on Twitter Reply With Quote
The following user says Thank You to ABCTG for this post:
 
(login for full post details)
  #5 (permalink)
Dvdkite
Trieste Italy
 
 
Posts: 162 since Feb 2018
Thanks: 131 given, 22 received


ABCTG View Post
David,

with the information I have I could only speculate and would have to analyze the situation to track down what exactly is going on to suggest a workaround.

Regards,

ABCTG

Thanks again. There are really not many more things to say. The code above is used to calculate the boolean " is right Time " and it is a condition to enter the trade.
Then there's a condition that ANALIZE the PREVIUS bar size and if it reach a parameter then it enter immediately the market in the following bar using this code:

 
Code
buy("LO 1A") size contract next bar at Open limit;
I receive a suggestion at the MC official forum to use CURRENTTIME instead of TIME. I wasn't able to see any result in a backtest but today I saw the correct entry this morning on the chart.
So do you think that CURRENTTIME could be the FINAL solution to enter exacly when the clock time is >= 9:03??
It seems to be correct but a confirmation from an expert like you would be awesome.

Thanks Again

David

Reply With Quote


futures io Trading Community Platforms and Indicators EasyLanguage Programming > Signal doesn't respect the time conditions to enter a trade


Last Updated on September 10, 2021


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada), info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts