NexusFi: Find Your Edge


Home Menu

 





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


Discussion in EasyLanguage Programming

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




 
Search this Thread

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

  #1 (permalink)
Dvdkite
Trieste Italy
 
Posts: 162 since Feb 2018
Thanks Given: 131
Thanks Received: 25

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 NexusFi?
Are there any eval firms that allow you to sink to your …
Traders Hideout
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
NexusFi Journal Challenge - April 2024
Feedback and Announcements
Deepmoney LLM
Elite Quantitative GenAI/LLM
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
61 thanks
Funded Trader platforms
38 thanks
NexusFi site changelog and issues/problem reporting
27 thanks
GFIs1 1 DAX trade per day journal
19 thanks
The Program
18 thanks
  #2 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,431 since Apr 2013
Thanks Given: 481
Thanks Received: 1,623

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
Thanked by:
  #3 (permalink)
Dvdkite
Trieste Italy
 
Posts: 162 since Feb 2018
Thanks Given: 131
Thanks Received: 25



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
  #4 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,431 since Apr 2013
Thanks Given: 481
Thanks Received: 1,623

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
Thanked by:
  #5 (permalink)
Dvdkite
Trieste Italy
 
Posts: 162 since Feb 2018
Thanks Given: 131
Thanks Received: 25


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




Last Updated on September 10, 2021


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts