MultiCharts lag time? - MultiCharts | futures io social day trading
futures io futures trading


MultiCharts lag time?
Updated: Views / Replies:29,984 / 171
Created: by bobbakerr Attachments:2

Welcome to futures io.

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

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors – all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you don’t need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

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

Reply
 2  
 
Thread Tools Search this Thread
 

MultiCharts lag time?

  #81 (permalink)
Elite Member
Riverdale, Idaho, USA
 
Futures Experience: Intermediate
Platform: Optimus Futures + MultiCharts + TradeStation
Broker/Data: Optimus Futures, Rithmic Data, TradeStation
Favorite Futures: CL, ES
 
bobbakerr's Avatar
 
Posts: 106 since Aug 2010
Thanks: 211 given, 39 received


MultiCharts View Post
I'll try to analyze this topic over the weekend and respond appropriately. Things have been very busy around here.

Thank you MUCH! MultiCharts has a brilliant platform and I want to keep using it if I can get it to work properly for the code I've written. I believe there is much promise here, both with MC and with my program. But so far ...

Reply With Quote
 
  #82 (permalink)
Elite Member
Washington, DC
 
Futures Experience: Intermediate
Platform: Multicharts
Broker/Data: InteractiveBrokers/IB
Favorite Futures: CL\EUR
 
Posts: 15 since Jan 2011
Thanks: 10 given, 8 received


bobbakerr View Post
I guess I'm having a difficult time making myself clear on this. I can't seem to put it in a more understandable way (yet). Maybe tomorrow I'll be able to. I'm off to bed.

Bob:
OK. I now understand your frustration. Perhaps once MC gets 7.0 released they will have more time to devote to your problem.

Jack

Reply With Quote
 
  #83 (permalink)
Elite Member
London
 
Futures Experience: Beginner
Platform: MultiCharts
 
Posts: 230 since Nov 2010
Thanks: 10 given, 20 received


Folks my 2 cents, in weeken I have more time to respond to your enquery.
I compare multicharts to major proprietary backtesting software on wich we made consultant.

The main lack before i write on data1=bid , data2=ask, to split the code etccc.... is that

FIrst
The database how to collect tick data multicharts in inappropriate, because
database doen't have tick id sequence of bid , ask trade.
Now, first of all reade all these 3 posts
IQFeed and MultiCharts Cumulative Delta Update MultiCharts Blog
MultiCharts Project Management - Issue MC-156 - Ticks Sequencing ID
MultiCharts: Trading Software for Automated Trading and Backtesting • View topic - Cumulative Delta & Volume Delta

When in mc there will be the id tick capability we are at a good step to have a more realistick backtesting results.

Second point all data in the database chould be upload, in this case i see that only iqfeed is right for this purpose, the proble in that only 180 tick day are avaible, so we need to ask at iqfeed to give us more historical tickdata. These will be difficxult now but that will be normal in the next years have 10 years of historical data collected by id protocol.

Third point
Change the way how built strategy in your code the easiest point
buy at close of data2
sell shor at close of data1
so in backtest propriety chise data1 ask, data2=bid.
using stp and limit order to have less slippage or book pressure.

It's a really good idea to built a database from iqfeed or other feed like zenfire where collect data and start to share.
People that check the quality of data. Remember that at institutional trading form any engeneer all day works on myswl or sql database to check the integrity of data. Good data it's really important if you don't want have surprise from backtesting to real.

My best

Reply With Quote
The following 3 users say Thank You to bomberone1 for this post:
 
  #84 (permalink)
Elite Member
Washington, DC
 
Futures Experience: Intermediate
Platform: Multicharts
Broker/Data: InteractiveBrokers/IB
Favorite Futures: CL\EUR
 
Posts: 15 since Jan 2011
Thanks: 10 given, 8 received


bomberone1 View Post
...When in MC there will be the id tick capability we are at a good step to have a more realistick backtesting results....

It appears that TickID will be added to MC 7. They say "TickID – events (ticks) are processed by MultiCharts upon their arrival are now sequence-stamped with a unique number, which allows MultiCharts to track ticks in the exact order they arrived."
See here for details: MULTICHARTS 7 BETA 1 RELEASE MultiCharts Blog

But it only works for real-time data, not back-fill data. See above link. However, it may be a step towards solving Bob's problem.

Jack

Reply With Quote
The following user says Thank You to JackR for this post:
 
  #85 (permalink)
Elite Member
London
 
Futures Experience: Beginner
Platform: MultiCharts
 
Posts: 230 since Nov 2010
Thanks: 10 given, 20 received


JackR View Post
See here for details: MULTICHARTS 7 BETA 1 RELEASE MultiCharts Blog
But it only works for real-time data, not back-fill data. See above link. However, it may be a step towards solving Bob's problem.
Jack

Reag again my post please, without back-fill or database costruction, no way to have realistick backtesting.

Another point to implement is the order generating.....it's really slow...
http://www.youtube.com/watch?v=cH5ri_finsk&feature=related.
The point is that the engine order generating accumulate too many orders.
It's seems FIFO type mode for execution, but I don't know. In this it's easy built a long queue of order...

My Best


Last edited by bomberone1; July 9th, 2011 at 07:33 AM.
Reply With Quote
 
  #86 (permalink)
 Vendor: tradingcode.net 
The Netherlands
 
Futures Experience: None
Platform: MultiCharts, TradingView
Favorite Futures: ...
 
Jura's Avatar
 
Posts: 774 since Apr 2010
Thanks: 2,347 given, 661 received


bobbakerr View Post
OK, Jura. Your post convinced me to post the basics of my code. I'll change a few things, but keep the logic the same. It's really very simple. It has 2 data series (and 2 graphs). Both graphs use 2-cent range bars. (It also works well with 40-second bars and 12-Tick bars [for CL here] The upper graph is the current month contract of CL or ES. The lower graph is a contract that is farther out. The signals are derived from the lower graph and all trading is done off of the upper graph, where the Bid/Ask spread is minimal.

I've gone through 2 expiration dates with this program. I change the contracts a set number of days before the actual expiration day. MultiCharts is also set for Bar Magnifier On with 1 Tick as the minimum move. IntraBar Order Generation is also set to On.

Here's an example of the code:

Thanks a lot Bob, this is very informative. Currently I'm testing your example code, and came across some things where I don't have a good grip on what you're trying to do.

 
Code
                            
If MarketPosition 1 then LongEntry=0BuySig=0Max=0;
If 
MarketPosition=-1 then SSEntry=9999SSSig=0Min=9999

EasyLanguage manual
EasyLanguage uses the semicolon ( ; ) to mark the end of each statement.

So, if I understand that correctly, in effect this part of the code get read by EasyLanguage as follows:
 
Code
                            
If MarketPosition 1 then begin
                  LongEntry
=0;
  
end;
   
  
BuySig=0
  
Max=0;
   
  If 
MarketPosition=-1 then begin
                  SSEntry
=9999;
  
end;
   
  
SSSig=0
  
Min=9999
Is that also what you mean with that code?

In the code there’s also:
 
Code
                            
 {The Following is a 'Safeguard' for if not Bot or SS due to 2 bars in SAME TIME:} 

I don’t understand what you mean with ‘in same time’, since I don’t see any time related code below that statement. Perhaps I’m focusing too much on the ‘time’ word in your comment, but I can’t see how that comment relates to the code below it.

Edit: Perhaps I've missed it in this thread, but is this a 24 hours, 5 days, strategy? The way I read the strategy (and I'm no expert, so don't take it for granted ) is the following:

 
Code
                            
// Resetting variables every tick between from 15:12 til 15:59
If Time 1511 and Time 1600 then begin
  BuySig 
0
  
SSSig 0
  
Min 9999
  
Max 0;
end;

Condition1 Time 1500;  // Mountain Time        (GMT - 6; UTC - 7)
// Long and short orders need this condition to be true when entering a trade

// Time exit after 15:10
If MarketPosition >= and Time 1510 then 
    Sell next bar at market

Enter trades before 15:00;
Exit open positions after 15:10;
Reset variables between 15:12 and 15:59.

Shouldn't these variables be reset after a trade is closed, so the following trade can use the right values?


Btw, I'm not criticizing you (or you're strategy) Bob, nor do I want to sound as an 'smartass' (if that's the right English word for it).




bomberone1 View Post
Reag again my post please, without back-fill or database costruction, no way to have realistick backtesting.

Correct me if I'm wrong , but isn't this something that the data provider needs to do? For example, if the data provider only provides seconds time stamps, I assume that MultiCharts can't achieve higher precision and that MC has to assume that the data downloaded from the data feed is already in the correct order? Off course, if the data feed provides milliseconds time stamping (which MultiCharts simulates with TickID), then MC also needs to apply TickID to the downloaded data from the data feed. What's your opinion about this Bomberone1? (I'd also love to hear MultiCharts take on this, after they've released their RC off course ).

Anyway, before going further off topic, what kind of data do you use Bob, Rithmic right? I guess you've also backtested on that data?

Regards,


Last edited by Jura; July 9th, 2011 at 09:31 AM.
Reply With Quote
The following user says Thank You to Jura for this post:
 
  #87 (permalink)
Elite Member
Riverdale, Idaho, USA
 
Futures Experience: Intermediate
Platform: Optimus Futures + MultiCharts + TradeStation
Broker/Data: Optimus Futures, Rithmic Data, TradeStation
Favorite Futures: CL, ES
 
bobbakerr's Avatar
 
Posts: 106 since Aug 2010
Thanks: 211 given, 39 received

Jura, you've asked a lot of good questions. And one especially might have pointed out a flaw in my code. But I don't have the time right now to respond. I hope to get back to this sometime tonight.

Reply With Quote
The following user says Thank You to bobbakerr for this post:
 
  #88 (permalink)
 Vendor: tradingcode.net 
The Netherlands
 
Futures Experience: None
Platform: MultiCharts, TradingView
Favorite Futures: ...
 
Jura's Avatar
 
Posts: 774 since Apr 2010
Thanks: 2,347 given, 661 received


bobbakerr View Post
Jura, you've asked a lot of good questions. And one especially might have pointed out a flaw in my code. But I don't have the time right now to respond. I hope to get back to this sometime tonight.

No problem, don't feel pressured to respond immediately. I hope I said something useful.


Jura View Post
[..]
Shouldn't these variables be reset after a trade is closed, so the following trade can use the right values?
[..]

Btw, if you want to reset the variables after exiting a position, it might be worth trying to save the MarketPosition into a variable, so you can reference the MarketPosition value from previous bars (I don't know if you want to do that). Something like this perhaps:

 
Code
                            
Variables:
    
MP(0),                    // Saves the Market Position so it's possible to access previous values
    
barsInPosition(0)     // Example variable which we want to reset
    
;
    
if 
currentbar 1 then cleardebug;    
    
MP MarketPosition;            // Save the MarketPosition in the current value of 'MP'

if MP MP[1then            // If the MarketPosition on this bar is the same as the previous bar, we add one to the counter.
    
barsInPosition barsInPosition 1
else                                // If the MarketPosition on this bar is different than the previous one, reset the counter to 1.
    
barsInPosition 1;

// Print output
Print(Date:6:0"_"time_s:6:0" MarketPosition: "MP" MarketPosition Previous bar: "MP[1],
    
" Bars in Position: "barsInPosition:0:0);

// Default strategy logic below; not relevant for the example
varsquickMA(0), slowMA(0);

quickMA AverageFC(Close10);
slowMA  AverageFC(Close40);

if 
quickMA crosses above slowMA then begin
    Buy next bar at market
;
end;
    
if 
quickMA crosses below slowMA then begin
    SellShort next bar at market
;
end
Which gives the following output:
 
Code
.....
1110516_155557 MarketPosition:    1.00 MarketPosition Previous bar:    1.00 Bars in Position: 10
1110516_155609 MarketPosition:    1.00 MarketPosition Previous bar:    1.00 Bars in Position: 11
1110516_155631 MarketPosition:    1.00 MarketPosition Previous bar:    1.00 Bars in Position: 12
1110516_155648 MarketPosition:    1.00 MarketPosition Previous bar:    1.00 Bars in Position: 13
1110516_155658 MarketPosition:    1.00 MarketPosition Previous bar:    1.00 Bars in Position: 14
1110516_155715 MarketPosition:    1.00 MarketPosition Previous bar:    1.00 Bars in Position: 15
1110516_155737 MarketPosition:    1.00 MarketPosition Previous bar:    1.00 Bars in Position: 16
1110516_155740 MarketPosition:    1.00 MarketPosition Previous bar:    1.00 Bars in Position: 17
1110516_155801 MarketPosition:    1.00 MarketPosition Previous bar:    1.00 Bars in Position: 18
1110516_155851 MarketPosition:   -1.00 MarketPosition Previous bar:    1.00 Bars in Position: 1
1110516_155929 MarketPosition:   -1.00 MarketPosition Previous bar:   -1.00 Bars in Position: 2
1110516_155954 MarketPosition:   -1.00 MarketPosition Previous bar:   -1.00 Bars in Position: 3
1110516_160009 MarketPosition:   -1.00 MarketPosition Previous bar:   -1.00 Bars in Position: 4
1110516_160026 MarketPosition:   -1.00 MarketPosition Previous bar:   -1.00 Bars in Position: 5
...
Just a thought.

Regards,

---------------
Edit: I was trying to simply your 'Safeguard' code piece, and I've noticed something off.

This is your 'Safeguard' code piece from the example strategy:

 
Code
{The Following is a 'Safeguard' for if not Bot or SS due to 2 bars in SAME TIME:}
If MarketPosition=-1 and C of data2<Min then begin
   Min=C of data2; Max=0;
end;
If MarketPosition=1 and C of data2>Max then begin
   Max=C of data2; Min=9999;
end;
If MarketPosition=-1 and C of data2>=Min+.08 then begin
   Buy next bar at LongEntry{InsideAsk} Limit;
end;
If MarketPosition=1 and C of data2<=Max-.08 then begin 
   SellShort next bar at SSEntry{InsideBid} Limit;
end;

If MarketPosition=1 then LongEntry=0; BuySig=0; Max=0;
If MarketPosition=-1 then SSEntry=9999; SSSig=0; Min=9999;


If MarketPosition>=1 and Time>1510 then Sell next bar at market;
If MarketPosition<=-1 and Time>1510 then BuyToCover next bar at market;
Al these MarketPosition > ... statements can be nested with the other if statements, for example:

 
Code
If MarketPosition=-1 and C of data2>=Min+.08 then begin
   Buy next bar at LongEntry{InsideAsk} Limit;
end;
.....
If MarketPosition<=-1 and Time>1510 then BuyToCover next bar at market;
..can be rewritten as:
 
Code
if MarketPosition = -1 then begin

    if Close of Data2 > Min + 0.08 then
        Buy next bar at LongEntry{InsideAsk} Limit;
        
    if Time > 1510 then
        BuyToCover next bar at market;

end;
If you do that for the whole 'Safeguard' code section, you get the following result:

 
Code
                            
// Manage long orders
if MarketPosition 1 then begin

    
// Set 'Max' to 'Close of Data2' if 'Close of Data2' is higher then 'Max'
    // Note: as long as there is a long position, this is always true (see note2 below)
    
if Close of Data2 Max then begin
        Max 
Close of Data2;
        
Min 9999;
    
end;

    
// Flip position from Long to Short if Close is below Max - 0.08
    
if Close of Data2 <= Max 0.08 then 
        SellShort next bar at SSEntry 
{InsideBidLimit;        
        
// Note1: If the Close of Data2 drops below Max - 0.08, is the limit order of 'SSEntry' still achievable,
        //     Or would the current price be to far away to get filled at the 'SSEntry' limit price?

    
LongEntry 0
    
BuySig 0
    
Max 0;                // Note2: this resets 'Max' to 0 *every* time there's a long position

    // Time exit
    
if Time 1510 then
        Sell next bar at market
;
end;

// Manage short orders
if MarketPosition = -1 then begin

    
if Close of Data2 Min then begin
        Min 
Close of Data2;
        
Max 0;        
    
end;

    if 
Close of Data2 >= Min 0.08 then
       Buy next bar at LongEntry
{InsideAskLimit;

    
SSEntry 9999
    
SSSig 0
    
Min 9999;

    if 
Time 1510 then
        BuyToCover next bar at market
;
end
See the comments in the example above - there is one error in there, and one potential error (in my opinion), both for the long and for the short position (though I haven't highlighted it for the short code).

Note: rewritten with the assumption that with ...
 
Code
If MarketPosition=-1 then SSEntry=9999; SSSig=0; Min=9999;
you mean..
 
Code
If MarketPosition=-1 then begin
SSEntry=9999; 
SSSig=0; 
Min=9999;
end;
Otherwise these 4 variables:
 
Code
SSSig = 0; 
Min = 9999;
BuySig = 0; 
Max = 0;
Need to be added at the very end of the rewritten code example, since they "fall" outside of MarketPosition = 1 and MarketPosition = -1 and get triggered everytime (regardless of the MarketPosition value). But in that case, they still would trigger the highlighted condition above in which the Close of Data2 would be greater than 'Max'. At least, that's how I understand it.


I hope this example is somewhat helpful in showing what your code (in my opinion!) does.

Regards,


Last edited by Jura; July 9th, 2011 at 01:34 PM.
Reply With Quote
The following user says Thank You to Jura for this post:
 
  #89 (permalink)
Elite Member
Riverdale, Idaho, USA
 
Futures Experience: Intermediate
Platform: Optimus Futures + MultiCharts + TradeStation
Broker/Data: Optimus Futures, Rithmic Data, TradeStation
Favorite Futures: CL, ES
 
bobbakerr's Avatar
 
Posts: 106 since Aug 2010
Thanks: 211 given, 39 received

I'm finally back. Yes, Jura, you did find a mistake and it was the one I thought you had found.

My intent was to have the following (wrong) code:
 
Code
                            
If MarketPosition 1 then LongEntry=0BuySig=0Max=0;
If 
MarketPosition=-1 then SSEntry=9999SSSig=0Min=9999
Actually be:
 
Code
                            
If MarketPosition=1 then begin
   LongEntry
=0BuySig=0Max=0;
end;
If 
MarketPosition=-1 then begin
   SSEntry
=9999SSSig=0Min=9999;
end
Changing that, the results for the last 20 to 22 trading days are as follows:
Before the Change:
ES (.25 Range Bars): + 40,064 Net on 324 R.T.'s; 86.1% Success Ratio; -1158 Longest Losing Streak.
CL (.02 Range Bars): + 174,817 Net on 4491 R.T.'s; 55.8% S.R.; -1920 L.L.S.
CL (40-sec. Bars): + 253,007 Net on 3025 R.T.'s; 73.1% S.R.; -4510 L.L.S.
CL (12-Tick Bars): + 31,068 Net on 3312 R.T.'s; 41.3% S.R.; -4048 L.L.S.
Keeping the mistake in, but Re-Loading MultiCharts:
ES (.25 Range Bars): + 42,058 Net on 317 R.T.'s; 86.1% Success Ratio; -1158 Longest Losing Streak.
CL (.02 Range Bars): + 181,391 Net on 4722 R.T.'s; 55.9% S.R.; -2039 L.L.S.
CL (40-sec. Bars): + 296,901 Net on 3036 R.T.'s; 80.3% S.R.; -610 L.L.S.
CL (12-Tick Bars): + 31,703 Net on 3243 R.T.'s; 41.3% S.R.; -4078 L.L.S.
Fixing the Code:
ES (.25 Range Bars): + 41,469 Net on 351 R.T.'s; 81.5% Success Ratio; -1486 Longest Losing Streak.
CL (.02 Range Bars): + 195,792 Net on 5398 R.T.'s; 55.6% S.R.; -2059 L.L.S.
CL (40-sec. Bars): + 296,853 Net on 3038 R.T.'s; 80.3% S.R.; -611 L.L.S.
CL (12-Tick Bars): + 30,876 Net on 3298 R.T.'s; 41.1% S.R.; -3798 L.L.S.

So, the repair of that error did change the results of the 4 test cases slightly.

** However, that 'Safeguard' section should not even be in the code (You also implied that). Why would it be needed if all the above rules are obeyed? And also, I should have said "If a bar has NO VOLUME", instead of 'If 2 bars have the SAME TIME'. The No Volume thing occurs frequently in Range Bars. **



Quoting 
Edit: Perhaps I've missed it in this thread, but is this a 24 hours, 5 days, strategy? ...

No. It is supposed to begin at Midnight (Mountain time) and end at the next bar > 1410 (Mountain time). That way I'm only daytrading and can take advantage of far cheaper Margin.


I've only commented on a couple of the points you bring up. But it's late now for me and I'm going to bed. I'll answer the rest of your Q's hopefully tomorow.

Thanks for your help.

Reply With Quote
The following user says Thank You to bobbakerr for this post:
 
  #90 (permalink)
Elite Member
London
 
Futures Experience: Beginner
Platform: MultiCharts
 
Posts: 230 since Nov 2010
Thanks: 10 given, 20 received


I think that we could creat a specific post to this strategy where upgrade the version and share the code.
I am looking to understand the concept of trading and after I write my opinion.
My best.

Reply With Quote
The following user says Thank You to bomberone1 for this post:

Reply



futures io > > > > MultiCharts lag time?

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
John Ehlers Zero Lag ebtrader ThinkOrSwim Programming 4 December 15th, 2017 10:55 PM
how the macd zero lag indicator works DarrenH NinjaTrader 6 September 13th, 2013 04:31 PM
Queue a backtest in multicharts same symbol on multiple time frames? crbucks MultiCharts 4 June 23rd, 2011 11:33 AM
MBTrading Data Error-Lag Sad Planet Reviews of Brokers and Data Feeds 3 May 5th, 2011 06:05 AM
MACD_Zero Lag Indicator Explanation GilR NinjaTrader 4 February 25th, 2011 07:36 AM


All times are GMT -4. The time now is 09:09 AM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, 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
Page generated 2017-12-18 in 0.18 seconds with 20 queries on phoenix via your IP 107.20.115.174