Does MRO function automatically cut off bars? - TradeStation | futures io social day trading
futures io futures trading


Does MRO function automatically cut off bars?
Updated: Views / Replies:121 / 4
Created: by minoschan Attachments:1

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 100,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
 

Does MRO function automatically cut off bars?

  #1 (permalink)
Shenzhen China
 
 
Posts: 3 since Aug 2019
Thanks: 1 given, 0 received

Does MRO function automatically cut off bars?

Hey guys, I'm a newbie here, and please forgive me if I'm asking a silly question. And yes I live in China, I'll try my best to describe my problem in Chinglish.

I tried to set up an indicator like errr...price diversion. My code is like this:

Variables:
double DIFF(0), double DEA(0), double MyMACD(0),MACD_GCross(False),
MACD_DCross(False), int BarsUp(0);

DIFF = XAverage(Close, 12) - XAverage(Close, 26);
DEA = XAverage(DIFF, 9);
MyMACD = 20*(DIFF-DEA); //It was multiplied by 20 for convenience only, actually it should be 2hi
Plot1(DIFF, "DIFF", White);
Plot2(DEA, "DEA", Yellow);
Plot3(MyMACD, !("MyMACD")); //Displayed in histogram
if MyMACD > 0 then
SetPlotColor(3, Red)
else if MyMACD < 0 then
SetPlotColor(3, Cyan);

MACD_GCross = DIFF cross over DEA;
MACD_DCross = DIFF cross under DEA;
BarsUp = MRO(MACD_GCross, 200, 1) + 1; //Calculating the bars since the last time DIFF crossed over DEA, in a 200- bar length

...


So here's the problem. It was verified all OK. But when I add it to my bars chart, the first 200 verticle lines plotted(i.e. MyMACD Variable) was automatically removed from the chart. If I remove the "BarsUp = MRO(MACD_GCross, 200, 1) + 1;" sentence, it was plotted right. Anyone have any idea what's wrong with my code? What should I do if I wanna keep all the lines without removing the MRO function, which I think is a very handy function for newbies like me. I Any help is appreciated.

Best Regards

Attached Thumbnails
Does MRO function automatically cut off bars?-wx20190830-194407-2x.png  
Reply With Quote
 
  #2 (permalink)
 Vendor: www.abctradinggroup.com 
Hamburg Germany
 
Trading Experience: Advanced
Platform: Multicharts, Tradestation
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 2,084 since Apr 2013
Thanks: 375 given, 1,338 received

minoschan,

this is likely caused by the maximum number of bars that Tradestation requires for a study.
You can read more about it here:
Maximum Number of Bars Study Will Reference Setting

Regards,

ABCTG

Follow me on Twitter Visit my Facebook Reply With Quote
 
  #3 (permalink)
Shenzhen China
 
 
Posts: 3 since Aug 2019
Thanks: 1 given, 0 received


Thanks for the quick tip, ABCTG. I was googling how to use the Maxbarback and will try to figure it out by myself.
I'd like to bring forward one more question without adding a new thread. On many occasions, when I try to plot some lines for my variables, TS won't allow me to plot from the first bar(i.e. the first in history of a stock). I tried these code:
"Value1=10.01;
Plot1(Value1, "Value1")
;
And it plotted the value from the SECOND bar, which should be BarNumber 1 I suppose.
I tried "Value 1 = Close;", it also began from the second bar(BarNumber 1). So what's the usual way to reference the REAL first bar, and plot the Values exactly from the beginning?
P.S. Certain functions like MACD also IGNORED the first Bar. The first Bar arguably has no 'previous EMA value', but the code actually presumes the second Bar Price to be the 'previous value' for the third Bar. It used the same method, like many other platforms, except it just IGNORED the first Bar.

Reply With Quote
 
  #4 (permalink)
 Vendor: www.abctradinggroup.com 
Hamburg Germany
 
Trading Experience: Advanced
Platform: Multicharts, Tradestation
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 2,084 since Apr 2013
Thanks: 375 given, 1,338 received

minoschan,

I am not sure you can get around this platform behavior. If starting at the very first bar of a session is important you could load one additional session and start your code logic on the first bar of the second session.

Regards,

ABCTG



minoschan View Post
Thanks for the quick tip, ABCTG. I was googling how to use the Maxbarback and will try to figure it out by myself.
I'd like to bring forward one more question without adding a new thread. On many occasions, when I try to plot some lines for my variables, TS won't allow me to plot from the first bar(i.e. the first in history of a stock). I tried these code:
"Value1=10.01;
Plot1(Value1, "Value1")
;
And it plotted the value from the SECOND bar, which should be BarNumber 1 I suppose.
I tried "Value 1 = Close;", it also began from the second bar(BarNumber 1). So what's the usual way to reference the REAL first bar, and plot the Values exactly from the beginning?
P.S. Certain functions like MACD also IGNORED the first Bar. The first Bar arguably has no 'previous EMA value', but the code actually presumes the second Bar Price to be the 'previous value' for the third Bar. It used the same method, like many other platforms, except it just IGNORED the first Bar.


Follow me on Twitter Visit my Facebook Reply With Quote
The following user says Thank You to ABCTG for this post:
 
  #5 (permalink)
Shenzhen China
 
 
Posts: 3 since Aug 2019
Thanks: 1 given, 0 received

Tried to modify the XAverage function. And it works better now. Thought of a way to work around the manner of TS, which means I'll have to write some more code myself. Thanks ABCTG for your help and patience!

Regards,

Reply With Quote

Reply



futures io > > > > Does MRO function automatically cut off bars?

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

futures io is celebrating 10-years w/ over $18,000 in prizes!

Right now
 

$250 Amazon Gift Cards with our "Thanks Contest" challenge!

Right now
 

Show us your trading desks and win over $5,000 in prizes w/Jigsaw Trading

September
 

Webinar: The Best Entries and Exits in trading & in life w/Agustin Lebron

Elite only
 

Webinar: NinjaTrader 8 Newest Features Release Sneak Peek

Sep 26
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Helmerich & Payne(HP) & Marathon Oil(MRO) Sell Setups botscrad Stocks and ETFs Trading 1 July 28th, 2016 08:14 AM
How to use if() function to check value returned from cross() function vampirelord AmiBroker 4 March 28th, 2014 12:23 PM
Spy off 4.6%, mcclellan dropping off a cliff, but Russell 2000 off 3.6%? skilluminati Emini and Emicro Index Futures Trading 4 June 6th, 2013 05:43 AM
Automatically placed orders issues when ninjatrader is turned off. snusnufreak NinjaTrader 3 May 4th, 2012 03:07 AM
EL function for Ninja MRO and LRO ? buylosellhi EasyLanguage Programming 4 April 19th, 2012 01:48 PM


All times are GMT -4. The time now is 11:00 PM. (this page content is cached, log in for real-time version)

Copyright © 2019 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