OmniTrader Professional Forum OmniTrader Professional Forum
forums calendars search
today this week
 
register logon control panel Forum Rules
You are currently browsing as a guest.
You should logon to access more features
A Self-Moderated Community - ALL MEMBERS, PLEASE READ!
Vote for Members who contribute the most to your trading, and help us moderate content within the Forums.


  Current location        Thread information  
OmniTrader Professional Forum
Trade Plans In Strategies
How to Enter Automatically At (Say) 0950
Last Activity 1/17/2022 3:59 AM
19 replies, 15212 viewings

Jump to page : 1
Now viewing page 1 [25 messages per page]
 
back reply
Printer friendly version

^ Top
John W

Regular
252525
Posts: 96

Joined: 6/18/2011
Location: Sydney, NSW, Australia

User Profile
 
Subject : How to Enter Automatically At (Say) 0950
Posted : 3/26/2014 4:00 PM
Post #22793

I've been using a RT profile plus OmniPilot.
OP starts at 0915, trading commences at 0930 and ceases at 1600.
The Trade Plan then fires orders at 0930.
However, I don't want to enter at 0930, instead I prefer to delay until (say) 0950.
I tried adding an Omniscript to the Trade Plan entry:
AfterSessionOpen(0,20) - OT draws a nice dotted line on the chart, ready set, nothing happens at 0950.
I then added a filter in the strategy using the same Omniscript and tried others such as BarMinute() >= 50. Nothing happens.
I then wrote an Entry Day System and added it as a confirm block. The system tried all manner of BarHour, AfterSessionopen,AfterTime with Signal=LongSignal. For instance:
"If BarMonth() = 3 and BarDayOfMonth()=26 and BarHour()=09 and BarMinute()>=50 Then Signal = LongSignal"

The final piece of info is in the last few minutes before market close I was fiddling with an Omniscript filter and found that BarHour() = 9 coincided with 1545, which seems strange to me. The computer is dedicated to OT and runs exclusively in US Eastern time.
All suggestions welcome....

^ Top
Jim Dean

Sage
2000100010010010010025
Posts: 3433

Joined: 3/13/2006
Location: L'ville, GA

User Profile
 
Subject : RE: How to Enter Automatically At (Say) 0950
Posted : 3/26/2014 4:16 PM
Post #22794 - In reply to #22793

1. What order type are you using? If MOO change to Mkt.

2. I've repeatedly told Nirvana (with plenty of documentation) about the serious problems in trying to get Entry conditions (Oscript or OLang) to work properly and consistently. Bottom line until they fix it: test test test and if it doesn't work, move on to something else.

3. No clue re your 9 = 545 thing ... normally, the time that shows on the screen, in the databox, is the time that OT uses for everything related to that bar.

4. I suggest you test using an active strat with whatever TP you are trying, direct from OT without using OP ... taking OP out of the loop helps narrow the problem down.

This is all guesswork ... I hope something helps.
^ Top
John W

Regular
252525
Posts: 96

Joined: 6/18/2011
Location: Sydney, NSW, Australia

User Profile
 
Subject : RE: How to Enter Automatically At (Say) 0950
Posted : 3/26/2014 4:23 PM
Post #22795 - In reply to #22794

1. Order type is Market
2. I'm working on it, trying lots of alternatives.
3. Then this looks to be the underlying problem, if the time stamp is wrong then whatever I code will be wrong. I'll play with this aspect some more.
4. OK.
THANK YOU Jim, its appreciated!
^ Top
John W

Regular
252525
Posts: 96

Joined: 6/18/2011
Location: Sydney, NSW, Australia

User Profile
 
Subject : RE: How to Enter Automatically At (Say) 0950
Posted : 3/26/2014 4:31 PM
Post #22796 - In reply to #22795

3. This is the problem.

Its now 1730 Eastern yet OT thinks that barhour() is still = to 9!
Is there anything in OT that needs to be reset or files deleted to get the time functions to work correctly?

^ Top
John W

Regular
252525
Posts: 96

Joined: 6/18/2011
Location: Sydney, NSW, Australia

User Profile
 
Subject : RE: How to Enter Automatically At (Say) 0950
Posted : 3/26/2014 4:50 PM
Post #22798 - In reply to #22796

I just tried another PC running Australian time. It's currently 0850 but OT2014 thinks its BarHour()=1.

I'm going to try OT2012 and OT2013 first and see what BarHour() they think it is, before I try re-installing the .otd
^ Top
John W

Regular
252525
Posts: 96

Joined: 6/18/2011
Location: Sydney, NSW, Australia

User Profile
 
Subject : RE: How to Enter Automatically At (Say) 0950
Posted : 3/26/2014 5:04 PM
Post #22799 - In reply to #22798

OT2012 and OT2013 think the barhour() is 9 during the 5pm Eastern bar and now in the 6pm Eastern bar.

Seems like a bigger issue, all recent versions of OT (on my US time zone PC) think the bar hour is 9 all the time.
^ Top
John W

Regular
252525
Posts: 96

Joined: 6/18/2011
Location: Sydney, NSW, Australia

User Profile
 
Subject : RE: How to Enter Automatically At (Say) 0950
Posted : 3/26/2014 5:29 PM
Post #22800 - In reply to #22799

Barry do you have any suggestions?
^ Top
Jim Dean

Sage
2000100010010010010025
Posts: 3433

Joined: 3/13/2006
Location: L'ville, GA

User Profile
 
Subject : RE: How to Enter Automatically At (Say) 0950
Posted : 3/26/2014 7:27 PM
Post #22801 - In reply to #22800

I think Barry is on vacation till next week
^ Top
John W

Regular
252525
Posts: 96

Joined: 6/18/2011
Location: Sydney, NSW, Australia

User Profile
 
Subject : RE: How to Enter Automatically At (Say) 0950
Posted : 3/26/2014 8:40 PM
Post #22802 - In reply to #22801

Thanks Jim, I'll send this link to Thad, he is often able to help me.
^ Top
John W

Regular
252525
Posts: 96

Joined: 6/18/2011
Location: Sydney, NSW, Australia

User Profile
 
Subject : RE: How to Enter Automatically At (Say) 0950
Posted : 3/26/2014 11:30 PM
Post #22804 - In reply to #22802

Hmmm... In looking at this further I find that time stamps work correctly on both daily and 15 minute charts.

The function barhour() works fine on the 15 minute chart but not on the daily chart.
I am trading a daily timeframe for entry and exit signals (including virtual exits) so it kinda makes sense that barhour() on a daily chart is a nonsense.

BUT then going back to the original issue there is still the question of how to delay the entry until (say) 950am.
I have already found that adding an Omniscript condition "AfterSessionOpen (0,20)" or "AfterTime(9,50)" to the Trade Plan initial order doesn't work.

I have also tried starting Omnipilot at 945am for order placement at 950 am but of course OT then changes the signal triangle with a circle to a filled in triangle and therefore OP/OT won't enter the trade.

I'm further along but still don't know how to have the trade plan manage in a daily timeframe yet enter at a defined time after market open?
^ Top
Jim Dean

Sage
2000100010010010010025
Posts: 3433

Joined: 3/13/2006
Location: L'ville, GA

User Profile
 
Subject : RE: How to Enter Automatically At (Say) 0950
Posted : 3/27/2014 6:31 AM
Post #22807 - In reply to #22804

Aha!
I had assumed that you were working with intraday charts, not daily. That explains a lot.

For daily bars, BarHour and BarMinute always will say the same thing - the opening time of the daily bar. That's how they are designed to work. Every day will be the same.

That also clarifies the nature of your other concerns. If you are using daily bars, and you want to delay your entry to some point after the daily bar begins (on the exchange), then you need to "fake out" OT somehow.

I've not tried either of these suggestions but they might work. I'm not an OPilot specialist so I won't attempt a suggestion in that realm.

1. You can simply delay the time that OT activates in the morning. There is a schedule function in the menus (can't remember where right now - using iPhone) that auto starts OT for you each new day. Maybe (?) that can be used to delay OPilot's start … if N is unable to help you with the OPilot script.

2. You might consider "surgery" on the Exchange settings table itself - change the start time from 9:30est to a later time. I'm guessing that OPilot keys off of that table like an alarm clock.

On a side note …
I'm sorry about the guesswork. It certainly should be possible, I would think (argh guessing again!) for an OPilot script to precisely control this. But since N has no "programmer" staff assigned for OPilot support, you're probably on your own there. I have hoped, some day, to have time to dig in to OPilot - but have not had time - and various things happening with OVest make me think that after a few more months, I won't need to (fingers crossed) … or, that it will be much simpler and/or better supported by N staff. We'll see.
^ Top
Jim Dean

Sage
2000100010010010010025
Posts: 3433

Joined: 3/13/2006
Location: L'ville, GA

User Profile
 
Subject : RE: How to Enter Automatically At (Say) 0950
Posted : 3/27/2014 6:40 AM
Post #22808 - In reply to #22807

Further to that -

OT uses bars as its time clock, re all the time functions like AfterSessionOpen and BarHour, etc. That is, the time-granularity of your active bars dictates how precisely you can control OT actions. Since you were using daily bars, the granularity was one full day and the controls you attempted were "noise" within that day.

This applies across the board for all OT functions and I suspect also for OPilot.
^ Top
John W

Regular
252525
Posts: 96

Joined: 6/18/2011
Location: Sydney, NSW, Australia

User Profile
 
Subject : RE: How to Enter Automatically At (Say) 0950
Posted : 3/27/2014 7:19 AM
Post #22809 - In reply to #22808

Thank you Jim for all your good advice. It really is appreciated!

After all the input and my own learnings so far my plan today is to trade without using OP.

I'm just going to try an Omniscript condition for the initial market order "AfterSessionOpen(0,20)", pull the chevron before market open and see what happens!
^ Top
Jim Dean

Sage
2000100010010010010025
Posts: 3433

Joined: 3/13/2006
Location: L'ville, GA

User Profile
 
Subject : RE: How to Enter Automatically At (Say) 0950
Posted : 3/27/2014 8:52 AM
Post #22811 - In reply to #22809

Good luck with that. If you are using daily bars then it probably won't work.

There is something that you can try. You can write an OScript condition in your trade plan that checks the SYTEM clock, not OT's bar-based clock. But be advised ... this goes outside normal OT syntax, AND deals with OScript conditions for Entry, both of which may be problematic. Worth trying though.

Try this syntax in the OScript field:
now.hour = 10 and now.minute >= 30

... or fill in whatever values you wish

This may or may not work ... it depends on how fast "prints" are coming in for the symbol that you are using. OT will only check the TP conditions when a new print hits ... so if you're trading a very ILliquid stock, you might enter late or not at all, depending on the formula you use.

FYI ... NOT ALL dotNET time functions work in OLang/Script ... there is a huge list and lots of rules. Click here for a discussion with more information about that.

^ Top
John W

Regular
252525
Posts: 96

Joined: 6/18/2011
Location: Sydney, NSW, Australia

User Profile
 
Subject : RE: How to Enter Automatically At (Say) 0950
Posted : 3/27/2014 10:49 AM
Post #22812 - In reply to #22811

Jim,

Right on both counts!

"AfterSessionOpen(0,20)" did nothing. But now.hour and now. minute worked like a charm.

WELL DONE AND THANK YOU!

John
^ Top
John W

Regular
252525
Posts: 96

Joined: 6/18/2011
Location: Sydney, NSW, Australia

User Profile
 
Subject : RE: How to Enter Automatically At (Say) 0950
Posted : 3/27/2014 12:08 PM
Post #22814 - In reply to #22812

RT DAILY PROFILE:
Now method works
After Session does not work.

EOD DAILY PROFILE:
Now method works
After Session does not to work


^ Top
Jim Dean

Sage
2000100010010010010025
Posts: 3433

Joined: 3/13/2006
Location: L'ville, GA

User Profile
 
Subject : RE: How to Enter Automatically At (Say) 0950
Posted : 3/27/2014 12:31 PM
Post #22815 - In reply to #22814

Thanks. Good news. I was not fully confident about EOD working, since there is no stream of "prints" coming in. That's a nice surprise.

[Edited by Jim Dean on 3/27/2014 12:40 PM]

^ Top
Steve Johnson

 
Subject : RE: How to Enter Automatically At (Say) 0950
Posted : 11/16/2015 11:31 AM
Post #24788 - In reply to #22793

I was researching this topic and tried the now.(month,day,hour,minute) technique in both OScript and as an OL stop. I tested as both a buy stop on the front end and sell stop. For EOD, both work, but only if Run Analysis or a data update is requested. Note that the data update does not trigger a time stop is there is no actual data update (e.g. data was updated Friday after market and a time stop is set for Monday - which happens to be a holiday - will not trigger because there is no new data).

My initial interest was to have a time stop to close a position prior to an earnings date. Essentially this is a time based conditional order. This works fine for EOD if you want to close with a MOO order, but if you want to close at say 2:30 pm central, another analysis needs to be run. Putting OT in Auto mode with a run time of 14:30 is an option, but only addresses one specific time daily.

Anyone know if an SDK solution could expose and use a time event? I'm guessing OP could be used to repeatedly run analysis throughout the day, but I have not explored that. Any suggestions appreciated.
^ Top
Jim Dean

Sage
2000100010010010010025
Posts: 3433

Joined: 3/13/2006
Location: L'ville, GA

User Profile
 
Subject : RE: How to Enter Automatically At (Say) 0950
Posted : 11/16/2015 11:38 AM
Post #24789 - In reply to #24788

Realtime daily bars offer an obvious solution. Not that expensive either, with OData.

You can set the standard EOD bars to auto refresh 3x/day, as I recall, but I'm not at PC to tell you how.

Besides the now.xxx, you can use native OLang bardayofmonth() etc, or the after-open or before-close functions.
^ Top
Steve Johnson

 
Subject : RE: How to Enter Automatically At (Say) 0950
Posted : 11/16/2015 12:06 PM
Post #24790 - In reply to #22793

I've looked for that auto-refresh option and do not see it anywhere. Also, sorry I am not logged in to this forum. System kicked me out and now doesn't like my password. Trying to reset it.

Steve Johnson.
Jump to page : 1
Now viewing page 1 [25 messages per page]
back reply

Legend    Action      Notification  
Administrator
Forum Moderator
Registered User
Unregistered User
E-Mail this thread to a friend
Toggle e-mail notification


Nirvana Systems
For any problems or issues please contact our Webmaster at webmaster@nirvsys.com.