Plot Value "Data Window" / Programatic discrepancy - MultiCharts | futures io social day trading
futures io futures trading


Plot Value "Data Window" / Programatic discrepancy
Updated: Views / Replies:2,153 / 6
Created: by WolfieWolf Attachments:0

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
 
Thread Tools Search this Thread
 

Plot Value "Data Window" / Programatic discrepancy

  #1 (permalink)
Elite Member
Charlottetown, Prince Edward Island
 
Futures Experience: Advanced
Platform: Ninja
Broker/Data: Optimus - Rithmic
Favorite Futures: GC
 
WolfieWolf's Avatar
 
Posts: 232 since Jul 2010
Thanks: 100 given, 273 received

Plot Value "Data Window" / Programatic discrepancy

Hello Everyone,

I'm hoping someone can answer this for me. I'm programming a very simple indicator. It plots two simple moving averages over price. When I hover my mouse over the bar where the moving averages cross I can see the values in the Data Window and / or the "hint" window. I want to write some code to take action when some conditions are met using the values of the two moving average plots. The issue is that the value of the plots is not _always_ the same programatically as it is on the screen. For examle if I print (plot1); and compare the values will match for a series of bars but occasionally they are different by a tick one way or ther other.... For my strategy a tick actually makes a difference and I want to know why there is a discrepancy. A values a value and I know which value I want. I've tried using the bar status to get the value on the first tick but that doesn't seem to work on historical data (and I want to backtest). I also tried using the last tick, but thats not the value I want either. I'm using MC 7 beta 4 ( which rocks by the way)... Any ideas? I would really appreciate any advice.

Thanks

Wolfie (the werewolf) Wolf

Reply With Quote
 
  #2 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 46,240 since Jun 2009
Thanks: 29,353 given, 83,234 received


WolfieWolf View Post
Hello Everyone,

I'm hoping someone can answer this for me. I'm programming a very simple indicator. It plots two simple moving averages over price. When I hover my mouse over the bar where the moving averages cross I can see the values in the Data Window and / or the "hint" window. I want to write some code to take action when some conditions are met using the values of the two moving average plots. The issue is that the value of the plots is not _always_ the same programatically as it is on the screen. For examle if I print (plot1); and compare the values will match for a series of bars but occasionally they are different by a tick one way or ther other.... For my strategy a tick actually makes a difference and I want to know why there is a discrepancy. A values a value and I know which value I want. I've tried using the bar status to get the value on the first tick but that doesn't seem to work on historical data (and I want to backtest). I also tried using the last tick, but thats not the value I want either. I'm using MC 7 beta 4 ( which rocks by the way)... Any ideas? I would really appreciate any advice.

Thanks

Wolfie (the werewolf) Wolf

Very interesting, can you post a minimal amount of code to duplicate this behavior? I'd like to check it out.

Mike

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
6)
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote
 
  #3 (permalink)
Elite Member
Charlottetown, Prince Edward Island
 
Futures Experience: Advanced
Platform: Ninja
Broker/Data: Optimus - Rithmic
Favorite Futures: GC
 
WolfieWolf's Avatar
 
Posts: 232 since Jul 2010
Thanks: 100 given, 273 received


Hi Big Mike,

It's a pleasure to finally meet you; I've been lurking. Hopefully I can start contributing now. After I posted, and you responded, I spent a considerable amount of time on this on Sunday. (I know, I know, get a like Wolfie Wolf).

Without getting into too many specifics of my code, which I'm not comfortable posting in it's entirety, here is a high level explanation of the issue and the resolution. Interestingly, "resolution" is an important factor here because the problem is a rounding issue which only appears when the resolution is set to a specific time frame and the moving averages are set to specific values. (I've changed the values in the sample below). I tried to reproduce this using alternate settings, so I could provide a detailed example, but I wasn't successful in the time I had. I don't have time to hammer on this right now. If you're really keen Mike I could PM you on this. It's important to note that this issue appeared while evaluating my code against CL N1, which is what I thought you would find most interesting.

I found one comment in the following thread that tweaked me to the idea that the number of decimal places and therefore rounding of values stored in variables may be different from the values being plotted n the chart and displayed in the data window. Better documentation for MC would be beneficial, most of what I have been learning from is Tradestation related.

MCFX Power Language(Easy Language) Coding Issue - Traders Laboratory Forums

"take values and string them and then print them because of the 2 dec place limit for float in the output bar
just a print tip since your coding problem was solved".

Inputs:
Value((High+Low)/2),

Var:
Float MyBlue (0),
BlueString(" "),
Float MyRoundedBlue(0);

value1=Average(value,16)[2];

plot1(value1,"MyBlue");

If you:
print ("MyBlue ", plot1);

you get a two decimal output which may or may not be the same as what's in the output window. If you do as the poster above suggested:

BlueString = NumToStr(Plot1,4);

and then:
print ("BlueString ", BlueString);

you get a 4 decimal value that, when rounded, will match the value in the output window _every_ time. So I did the following:

MyBLue=StrToNum(BlueString);

MyRoundedBlue=round(MyBlue,2);

then when you print or compare the MyRoundedBlue the value matches the output window. I coded this right in your forum editor so I hope I didn't mess anything up.

At first I thought my "offset" of the average was creating the issue but that wasn't the case at all. I hope this helps someone.

All the best

Wolfie (the werewolf) Wolf


Last edited by WolfieWolf; June 6th, 2011 at 08:28 AM.
Reply With Quote
 
  #4 (permalink)
Elite Member
GER
 
Futures Experience: Advanced
Platform: MC
Favorite Futures: ES
 
Posts: 144 since May 2011
Thanks: 11 given, 211 received

You can use print ("MyBlue ", plot1:7:X) and replace X with the decimalplaces you want to print/the data window shows.

Reply With Quote
 
  #5 (permalink)
Elite Member
Charlottetown, Prince Edward Island
 
Futures Experience: Advanced
Platform: Ninja
Broker/Data: Optimus - Rithmic
Favorite Futures: GC
 
WolfieWolf's Avatar
 
Posts: 232 since Jul 2010
Thanks: 100 given, 273 received

SPMC, you rock! I had no idea. What is the source of your information?

Reply With Quote
 
  #6 (permalink)
Elite Member
Charlottetown, Prince Edward Island
 
Futures Experience: Advanced
Platform: Ninja
Broker/Data: Optimus - Rithmic
Favorite Futures: GC
 
WolfieWolf's Avatar
 
Posts: 232 since Jul 2010
Thanks: 100 given, 273 received

Hi SPMC,

I've had a chance to play around with your suggestion. Your tip works great for formatting the output to the output bar, thanks. It doesn't, however, do anything for the values in the variables. When I compare value1 and value2 with a logical expression like "if value1 = value2" it compares just the first two decimals, not all 4. How can I let MC know when I call a variable that contains 4 decimal places that I want to use all 4 decimal places without first converting it to a string and then converting it back as I demonstrated above? I don't actually want to use all 4 decimals but I do want to round the second decimal using the third decimal place.

Thanks

Wolfie (the werewolf) Wolf

Reply With Quote
 
  #7 (permalink)
Elite Member
GER
 
Futures Experience: Advanced
Platform: MC
Favorite Futures: ES
 
Posts: 144 since May 2011
Thanks: 11 given, 211 received

Wolf,

at the moment i dont really know exactly what you want to do. The inline codes always compares all available decimalplaces of the variables, that means if
value1=Average(value,16)[2]; is i.e. 1.4735665688 the code uses all 10 decimalplaces, regardless what the plot or print statement says, even if the plot says
1.4736.

If you want to use less decimalplaces you need to round the variable and not the print ot plot statement with value1 = round (Average(value,16)[2] , X ); with X as your
decimals.


Last edited by SPMC; June 6th, 2011 at 06:48 PM.
Reply With Quote

Reply



futures io > > > > Plot Value "Data Window" / Programatic discrepancy

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
dealing with GetCurrentBidVolume and GetCurrentAskVolume , "long" casting into "int" jmejedi NinjaTrader Programming 4 May 23rd, 2011 10:33 AM
jtRangeMakrker7 - Printing in "Output" window on NT7....4 Affliction NinjaTrader 5 April 29th, 2011 10:22 AM
RJay's "Trader Volume" and "Trader Tick" Indicator Suites RJay The Elite Circle 20 December 20th, 2010 06:01 PM
Is it possible to get "historical" Time and Sales data? adaseb Reviews of Brokers and Data Feeds 2 September 8th, 2010 12:18 PM
"time"stop" codes for MC ptcm EasyLanguage Programming 1 September 2nd, 2010 01:57 AM


All times are GMT -4. The time now is 06:40 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-15 in 0.11 seconds with 19 queries on phoenix via your IP 107.20.115.174