NexusFi: Find Your Edge


Home Menu

 





Help with paintbar - should be an easy one!


Discussion in EasyLanguage Programming

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




 
Search this Thread

Help with paintbar - should be an easy one!

  #1 (permalink)
tozwp
Milwaukee WI/US
 
Posts: 7 since Feb 2012
Thanks Given: 2
Thanks Received: 1

Never worked with paintbars before and am still new to programming. In Multicharts I am trying to paint/color the bars of a 24 hour chart that aren't during regular session hours a different color. I've tried this but nothing happens:
Inputs:
starttime(1516),endtime(829);
IfCurrentTime>starttimeandCurrentTime<endtimethen
PlotPaintBar(High,Low,Open,Close,"",Red)

I'm sure I'm doing something simple wrong but I don't have a clue! Thanks!

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
MC PL editor upgrade
MultiCharts
Trade idea based off three indicators.
Traders Hideout
Better Renko Gaps
The Elite Circle
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
Quant vue
Trading Reviews and Vendors
 
  #3 (permalink)
 
Nicolas11's Avatar
 Nicolas11 
near Paris, France
 
Experience: Beginner
Platform: -
Trading: -
Posts: 1,071 since Aug 2011
Thanks Given: 2,232
Thanks Received: 1,769


Hi,

I see several problems:
- your code does not respect MultiCharts syntax, it does not compile
- your start time is after your end time
- CurrentTime refers to the time of the computer whereas you should refer to the time of the bar (Time).

The following code works on my computer:
 
Code
Variables:
    StartTime    ( 829 ),
    EndTime    ( 1516 );
    
If Time > StartTime AND Time < EndTime then
    PlotPaintBar(High, Low, Open, Close, "", Red);
Nicolas

Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #4 (permalink)
tozwp
Milwaukee WI/US
 
Posts: 7 since Feb 2012
Thanks Given: 2
Thanks Received: 1

Thanks Nicolas. This sort of works but now it paints the regular session instead of the after hours session. Maybe I need to have it change the bar color from 1516 to 2400 and then again from 0 to 829? I'll try that. Thanks for your help.


Nicolas11 View Post
Hi,

I see several problems:
- your code does not respect MultiCharts syntax, it does not compile
- your start time is after your end time
- CurrentTime refers to the time of the computer whereas you should refer to the time of the bar (Time).

The following code works on my computer:
 
Code
Variables:
    StartTime    ( 829 ),
    EndTime    ( 1516 );
 
If Time > StartTime AND Time < EndTime then
    PlotPaintBar(High, Low, Open, Close, "", Red);
Nicolas


Reply With Quote
  #5 (permalink)
 
Nicolas11's Avatar
 Nicolas11 
near Paris, France
 
Experience: Beginner
Platform: -
Trading: -
Posts: 1,071 since Aug 2011
Thanks Given: 2,232
Thanks Received: 1,769

My mistake. I read your first message too quickly.

Try:
If Time < StartTime OR Time > EndTime

Visit my NexusFi Trade Journal Reply With Quote




Last Updated on February 14, 2012


© 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