Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
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 for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I thought they would get re-set as the trades went on. They are calculated constantly. But I inserted code to have them all reset after the Limit Order is placed to make the Entry. The problem with this is if the order is not filled, then everything is reset without getting into the position:
If MarketPosition<>1 and BuySig=1 then begin If Condition1=True then Buy next bar at LongEntry{InsideAsk} Limit; BuySig=0; SSSig=0; Min=9999; Max=0; LongEntry=0; end; If MarketPosition<>-1 and SSSig=-1 then begin If Condition1=True then SellShort next bar at SSEntry{InsideBid} Limit; SSSig=0; BuySig=0; Min=9999; Max=0; SSEntry=9999; end;
This then gives results of:
ES (.25 Range Bars): + 39,645 Net on 320 R.T.'s; 85.0% Success Ratio; -1158 Longest Losing Streak.
CL (.02 Range Bars): + 181,390 Net on 4722 R.T.'s; 55.9% S.R.; -2039 L.L.S.
CL (40-sec. Bars): + 296,907 Net on 3036 R.T.'s; 80.3% S.R.; -611 L.L.S.
CL (12-Tick Bars): + 31,086 Net on 3298 R.T.'s; 41.2% S.R.; -4048 L.L.S.
There were fewer Signals, and some results improved, some got worse. I don't know yet whether to keep this change in. So far it's in.
Quoting
... 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?
For Actual Live Trading, yes I do use Rithmic. But for this backtesting, I'm using OpenECry's data. It allowed me to go back in time whereas Rithmic didn't.
And no, I don't consider you a 'smartass'. I think we all want this code to work properly and you have been very helpful. I appreciate that and all the help from the rest of you guys. Thanks again.
Can you help answer these questions from other members on NexusFi?
... 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:
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[1] then // 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);
Stupid me. I respond to the posts sequentially. If I would have read a little further down, I could have used your code to reset those variables. I'll do this change next!
I changed the variable resetting code as per Jura. The results barely changed:
ES (.25 Range Bars): + 39,819 Net on 320 R.T.'s; 85.3% Success Ratio; -1158 Longest Losing Streak.
CL (.02 Range Bars): + 181,383 Net on 4724 R.T.'s; 55.9% S.R.; -2039 L.L.S.
CL (40-sec. Bars): + 296,907 Net on 3036 R.T.'s; 80.3% S.R.; -611 L.L.S.
CL (12-Tick Bars): + 31,086 Net on 3298 R.T.'s; 41.2% S.R.; -4048 L.L.S.
I've been watching ES trade all morning. It's way less volatile than CL, with around 10 times as much volume.
I see REPEATEDLY missed signals, by as much as 3 minutes to 14 minutes! And then MultiCharts will finally insert those signals onto the chart roughly about where they were supposed to be -- 3 to 14 minutes earlier than the time that MC finally realized that these signals should have been given.
Why is that? And how can anything be traded Automatically with a time lag like that ???
I was using Open E Cry for my data feed. The data on the charts 'kept up' fine. I had the DOM from Rithmic's data feed also showing, and things were agreeing.
I'd like to see a video of your problems in action.
You can download CamStudio for free, and record a video in SWF format that captures the bug and then upload it as an attachment to the forum. If it is a large file, you may need to zip it first before uploading. It is a straightforward program to use.
And then MultiCharts will finally insert those signals onto the chart roughly about where they were supposed to be -- 3 to 14 minutes earlier than the time that MC finally realized that these signals should have been given.
Bob:
Are you saying the MC chart is keeping current with your feeds but it "back-inserts" signals while running?
Also - What version of MC are you running?
In trying to overcome this 'lag time' thing, I have been experimenting with different ways to get signals to be timely. One of them is to tell the program to Buy if the Current Inside Bid of Data2 is greater than the last Close of Data2. If so, then it's supposed to Buy off of Data1. But it doesn't work. I'll put that fragment of code below and if anyone can figure out how to get this to be recognized and actually work, I'd sure appreciate it. Thanks.
If Time {of data2}=CurrentTime and InsideBid of data2>C[1] of data2 then Buy next bar at Market;
The 'InsideBid' and 'InsideAsk' terms only work on the CURRENT Bids and Asks. So that is why I have 'CurrentTime' in there. But as I watch the live proceedings, the statement is just completely ignored. No Buys or Shorts ever occur off of it.
Mike, I'll send you my code and YOU do it. I'm fed up.
Sorry, I don't have time for such a thing - I was just trying to help you, and the video showing what your describing would be beneficial to understanding the problem.