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.


This message cannot be deleted. It is the first message of the thread.
Administrators or moderators may choose to delete the entire thread


 
Bekaert

Regular
2525
Posts: 52

Joined: 2/1/2008
Location: Oostkamp, Belgium, Europe

User Profile
 
Subject : MarketScan-OT-OP-RT_Traderscript
Posted : 10/11/2013 5:08 AM
Post #22336

Recently i took a subscription to Marketscans. It ables my to scan the whole market instead of just 500 shares (the limit of your RT profile)
The goal is to do create a realtime customscanlist in "Marketscans" which provides you candidates for your strategies in OT
So you can create in "MarketScans" some good customscans and syncronize that list ( every x-minutes ) with the focus list in your OT RT profile
Although the available indicators and math functions are limited, it is a quick tool to scan the market in realtime, you can't use OL indicators, OT plugin indicators or IIF functions ( for this last one there is a workaround)

A problem that i encountered was that i was used to use the "EOD_Trader" script in OmniPilot for my RT_profile. It ables me to trade on the signal-bar instead of the following bar ( which the RT_Trader script does) and it ables me to run my strategies every x minutes instead of 3 times/intrerval
So i tried to find a solutiion for both problems, because MarketScans" in conjunction with OT-OP work only with the "RT_Trader script", (i refuses to pass your orders to your broker with the eod_trader script) we had to adapt something to that script.
Barry gave me a modified "common.txt" omnipilot-script which will execute you order at the signal bar (in attachement) , it will not wait until the next bar to execute your order.

Problem 2 was that RT_Trader script only runs your strategies 3 times per interval or doesn't calculate your strategies at all for symbols that have no new candle or where last trade time is still on "0:00:00"
When using marketscans and OT RT is noticed some discrepanties between last trade time and volume, especially with low volume stocks, so i absolutely wanted to refresh and calculate all of my symbols for all my Strategies.

So i modified the "UserInterface.txt" script (at line 356)
I added a sub-routine to run my strategies every x minutes or seconds instead of 3 times /interval
In my case i use 10min intraday data and i wanted to run my strategies every minute from minut 6 till 10 ( so the last 4 minutes of each candle)

So i added a line in the "OnMarketOpen" sub-routine => OmniPilot.OnEvery(0, 1, 0, AddressOf CalcWithInterval)
and i created a new sub-routine called "CalcWithInterval()"

Private Sub CalcWithInterval()

Dim xMinutes As Integer
Dim xVar1 As Integer

xMinutes = Format(Now,"mm")
xVar1 = ((xMinutes/10) - (Int(xMinutes/10)))*10

If xVar1 >= 6 Then
ToDoList.Analyze()
End If
End Sub

If you use 15-min data, the routine can easily be adapted => xVar1 = ((xMinutes/15) - (Int(xMinutes/15)))*15



Hopes that this can inspire some users of OT-OP

Best Regards
Marc

[Edited by Bekaert on 10/11/2013 5:13 AM]

Attached file : Common.txt (46KB - 569 downloads)
Attached file : OP-UserInterface.png (37KB - 813 downloads)

Deleting message 22336 : MarketScan-OT-OP-RT_Traderscript


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