NexusFi: Find Your Edge


Home Menu

 





New to Multicharts Signal Only Prints on Some Data


Discussion in MultiCharts

Updated
    1. trending_up 1,199 views
    2. thumb_up 1 thanks given
    3. group 2 followers
    1. forum 3 posts
    2. attach_file 0 attachments




 
Search this Thread

New to Multicharts Signal Only Prints on Some Data

  #1 (permalink)
ummmx2
Miami Florida/Dade
 
Posts: 7 since Oct 2016
Thanks Given: 2
Thanks Received: 0

Hello all,

I'm new to multicharts and new to coding in general so forgive me as I'm just fumbling along trying to learn this stuff. Anyways I wrote a code to basically look back and plot Monday's high/low but the problem is that it only plots on some of the data. On the daily chart it will plot 5 Mondays back, and on the H4 chart only 1 hour back. Can anybody please take a look at my code and guide me to exactly where I went wrong? Any help would be greatly appreciated.

On a side note: Does anybody know if the FX data from Oanda with a demo of Multicharts provides limited data? The Daily data only goes back a couple months and I'm thinking it's because I'm using the Multicharts demo since the data on MT4 and oanda goes back years.


Quoting 

Variables:
MonHigh (0),
MonLow (0),
MonHighLine (0),
MonLowLine (0),
MonHightext (-1),
MonLowText (0);

//recognizing Monday High/low
if (dayofweek(date) = 2 {Tuesday} ) then begin
MonHigh = maxlist(highd(1));
MonLow = minlist(lowd(1)) ;
end;

//plotting the Monday High/low lines
MonHighLine = tl_new(d[1], t[1], Monhigh,d,t,Monhigh);
tl_setcolor(monhighline, green);

Monhightext = text_new (d, t, monhigh, numtostr(monhigh, 4) + "Monday High");
text_setstyle (Monhightext, 0, 1);
text_setcolor (Monhightext, RGB(151,129,0));

Monlowline = tl_new(d[1], t[1], Monlow,d,t,Monlow);
tl_setcolor (monlowline, red);

monlowtext = text_new (d, t, monlow, numtostr(monlow, 4) + "Monday Low");
text_setstyle (monlowtext, 0, 1);
Text_setcolor (monlowtext, RGB(151, 129, 0));

if
Monhightext <> Monhightext[1] then begin
text_delete(monhightext[1]);
text_delete(monlowtext[1]);
end;





Reply With Quote

Can you help answer these questions
from other members on NexusFi?
MC PL editor upgrade
MultiCharts
REcommedations for programming help
Sierra Chart
Could it be that currency futures are way easier to trade?
Currencies
ZombieSqueeze
Platforms and Indicators
Better Renko Gaps
The Elite Circle
 
  #2 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,435 since Apr 2013
Thanks Given: 482
Thanks Received: 1,628

ummmx2,

this can be caused by the "max number of bars the study reference" value required by your code. If that is the case the lines should go back further in case you load more data to the chart.

Regards,

ABCTG

Follow me on Twitter Reply With Quote
Thanked by:
  #3 (permalink)
ummmx2
Miami Florida/Dade
 
Posts: 7 since Oct 2016
Thanks Given: 2
Thanks Received: 0


Ahh! You're a genius! Thank you. Also I'm guessing this study references the current timeframe of the chart. So I have one last question which is probably super simple and just has to do with me not knowing how to use Multicharts.

The code is now working properly and references Mondays high/low based on the time on Multicharts. However, it looks like the Multicharts time is off in reference to the actual broker time and even my local time on the computer. The time is ahead by 1 hour. This affects the calculation of the code on the hourly chart. I'm sure this is a simple fix but do you happen to know how to do that?



Also would be nice to figure out how to stop the lines on Friday so that it does not extend over into the next week. Thank you so much!

Reply With Quote
  #4 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,435 since Apr 2013
Thanks Given: 482
Thanks Received: 1,628

ummmx2,

you can change the time on the Settings tab of the Format Instrument dialog. It could be set to Exchange or Local (which is your computer's clock). If this is still incorrect you could adjust the symbol settings in Quotemanager.

Your code appears to draw new text and lines for every bar. It might make sense to only draw them once per period and then update the location (using TL_SetBegin, TL_SetEnd, Text_SetLocation etc..).
Now you can use the reserved word DayOfWeek( Date ) to detect a day of the week where you don't want to update the location and end points.

Regards,

ABCTG

ummmx2 View Post
Ahh! You're a genius! Thank you. Also I'm guessing this study references the current timeframe of the chart. So I have one last question which is probably super simple and just has to do with me not knowing how to use Multicharts.

The code is now working properly and references Mondays high/low based on the time on Multicharts. However, it looks like the Multicharts time is off in reference to the actual broker time and even my local time on the computer. The time is ahead by 1 hour. This affects the calculation of the code on the hourly chart. I'm sure this is a simple fix but do you happen to know how to do that?



Also would be nice to figure out how to stop the lines on Friday so that it does not extend over into the next week. Thank you so much!


Follow me on Twitter Reply With Quote




Last Updated on December 3, 2019


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts