NexusFi: Find Your Edge


Home Menu

 





Range bar counter


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one Serger with 7 posts (2 thanks)
    2. looks_two cbritton with 6 posts (4 thanks)
    3. looks_3 Big Mike with 3 posts (3 thanks)
    4. looks_4 RickW with 2 posts (0 thanks)
      Best Posters
    1. looks_one SPMC with 2 thanks per post
    2. looks_two Jura with 2 thanks per post
    3. looks_3 Big Mike with 1 thanks per post
    4. looks_4 cbritton with 0.7 thanks per post
    1. trending_up 17,175 views
    2. thumb_up 15 thanks given
    3. group 3 followers
    1. forum 21 posts
    2. attach_file 8 attachments




 
Search this Thread

Range bar counter

  #11 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,463 since Jun 2009
Thanks Given: 33,239
Thanks Received: 101,662

 
Thread Moved


Thread moved to EasyLanguage Programming



When creating a new thread, note which subforum you are in. Here is a short list of suggestions:

- Topic: Anything to do with an Elite indicator -> Subforum: The Elite Circle
- Topic: Looking for an existing indicator, or how-to use an indicator -> Subforum: (the platform)
- Topic: Programmer needing help with non-Elite indicator -> Subforum: (the platform) - Programming
- Topic: Want an indicator created/modified -> Reply to "Want indicator created free" in Elite Circle
- Topic: Vendors (trading rooms, commercial indicators) -> Subforum: Vendors/Product Reviews
- Topic: Discussion of Forex or Currency trading -> Subforum: Forex and Currency Trading
- Topic: Journals of your trading -> Subforum: Trading Journals or Elite Trading Journals
- Topic: General trading related discussions -> Subforum: Traders Hideout
- Topic: Discussion of a trading method -> Subforum: Traders Hideout
- Topic: Automated Trading -> Subforum: Elite Automated Trading

Last, any Elite Member may create more or less any of these topics in The Elite Circle at your own discretion (your support is appreciated).

This is just a short general list and doesn't cover everything. If you are unsure where to create your new thread, just create it in Traders Hideout and a moderator will move it if necessary.

-- Big Mike Trading



Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
Cheap historycal L1 data for stocks
Stocks and ETFs
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
What broker to use for trading palladium futures
Commodities
How to apply profiles
Traders Hideout
 
  #12 (permalink)
 
cbritton's Avatar
 cbritton 
Atlanta, Georgia
 
Experience: Intermediate
Platform: NT
Broker: DDT
Trading: ZN, ZB
Posts: 230 since Mar 2010
Thanks Given: 152
Thanks Received: 256


Big Mike View Post
Can you clarify so I can take a look and see if I can help. I'm not understanding the problem.

Mike

There's a (user provided) function call in this indicator called Text_FloatLocation (in the eld file I provided) that sets the position of the text on the chart from within the indicator. In this case, the upper right side. Serger is saying that the text that the function is placing is moving across the chart. You can see the two screen shots where "0.3" is just left of center on the top of the chart on the first screenshot and, on the next screenshot, you see the "0.1" to the right of center on the top.

Since I don't have MC, I don't know of a function that will fix the location of the text object on the chart so it doesn't float across the chart. I'm sure there is since MC has better text API than TS. If you know it, you can just swap out the Text_FloatLocation function with whatever MC uses and that should be all that is needed.

Thanks,
-C

“Strategy without tactics is the slowest route to victory. Tactics without strategy is the noise before defeat.” - Sun Tzu
Reply With Quote
  #13 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,463 since Jun 2009
Thanks Given: 33,239
Thanks Received: 101,662


Here is a snippet from one of my MC strategies that displays info on chart, it uses the MC method "GetAppInfo" to determine the screen x/y boundries:

 
Code
                            
// trade performance report


if pnltext3 0 then begin
    
if condition1 true then Text_SetString(pnltext3text("  STRATEGY: RUNNING  "));
    if 
condition1 false and todaynet >= dailyprofit then Text_SetString(pnltext3text("  STRATEGY: DAILY PROFIT  "));
    if 
condition1 false and todaynet <= -dailyloss then Text_SetString(pnltext3text("  STRATEGY: DAILY STOP  "));
    
Text_SetLocation(pnltext3dateiff(time 900time805), GetAppInfo(aiHighestDispValue) - (10 MinMove/PriceScale));
    
Text_SetSize(pnltext312);
    
Text_SetBorder(pnltext3true);
    
Text_SetBGColor(pnltext3iff(todaynet >= dailyprofitdarkgreenred));
    
Text_SetColor(pnltext3white);
    
Text_SetSTyle(pnltext3iff(time 90010), 2);
end
Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #14 (permalink)
 SPMC 
GER
 
Experience: Advanced
Platform: MC
Trading: ES
Posts: 144 since May 2011
Thanks Given: 11
Thanks Received: 213

Ok, her is my complete code. It plots the barriers (high blue , low darkred ) at which price a new range bar will
plot, the current price in the middle , and the remain in ticks and percent at the bottom (cyan if there are ticks left, magenta if the range is filled).

Attached Thumbnails
Click image for larger version

Name:	Range Remain.jpg
Views:	406
Size:	15.0 KB
ID:	40673  
Attached Files
Elite Membership required to download: SP RANGE REMAIN.pla
Reply With Quote
Thanked by:
  #15 (permalink)
 
Serger's Avatar
 Serger 
Quebec
 
Experience: Intermediate
Platform: Multicharts 64 +VolProfile
Broker: Interactive Brokers
Trading: Ym, Es
Posts: 74 since Oct 2010
Thanks Given: 64
Thanks Received: 25

Hello Spmc
and Work well !!
i just add some ............. more easy to see ...
Thank you so much!!!

Attached Thumbnails
Click image for larger version

Name:	Range_Remain_.png
Views:	351
Size:	27.2 KB
ID:	40686  
Started this thread Reply With Quote
  #16 (permalink)
 
cbritton's Avatar
 cbritton 
Atlanta, Georgia
 
Experience: Intermediate
Platform: NT
Broker: DDT
Trading: ZN, ZB
Posts: 230 since Mar 2010
Thanks Given: 152
Thanks Received: 256


SPMC View Post
Ok, her is my complete code. It plots the barriers (high blue , low darkred ) at which price a new range bar will
plot, the current price in the middle , and the remain in ticks and percent at the bottom (cyan if there are ticks left, magenta if the range is filled).

spmc,

Can you post the code for this? I can not import pla files in TS.

Thanks,
-C

“Strategy without tactics is the slowest route to victory. Tactics without strategy is the noise before defeat.” - Sun Tzu
Reply With Quote
  #17 (permalink)
 
Serger's Avatar
 Serger 
Quebec
 
Experience: Intermediate
Platform: Multicharts 64 +VolProfile
Broker: Interactive Brokers
Trading: Ym, Es
Posts: 74 since Oct 2010
Thanks Given: 64
Thanks Received: 25

Here,you see the code .. and wok well
Thank's all
{================================================= ====================
NAME: _RangeCountdownTimer

TYPE: Indicator

}

inputs:
VertTextPct(80{0-100}),
NormColor(yellow),
AlertColor(red),
AlertPct(10{0-100}),
DispMode(2 {1=Pct,2=Range}),
dec(4)// Significant Decimals in Price
;

vars:
{ Text Object Vars }
TxtStr(""), // Text String
AlertStr(""), // Alert Text String
TxtID(text_new(date,time,close, " ")), // Text Object Reference

{ Constants }
cDispPct(1), // Option to display Percentages
cDispRaw(2), // Option to display Time/Tick/Vol Values

Pad(" "), // Pad to right of text display
BarRange(0.1);

{== Initialization ================================================== =}

once begin

// Check for valid input values
if DispMode <> 1 and DispMode <> 2 then
RaiseRuntimeError("The DispMode input must be set to 1 or 2");
if VertTextPct > 100 or VertTextPct < 0 then
RaiseRuntimeError("The VertTextPct input must be set between 0 and 100");
if AlertPct > 100 or AlertPct < 0 then
RaiseRuntimeError("The AlertPct input must be set between 0 and 100");
// Chart Specific Init

AlertStr = GetSymbolName+" bar has "+NumToStr(AlertPct,0)+"% remaining";

end;

if CurrentBar = 1 then begin
// determine the range of the bar from the ones already shown
BarRange = range[1];
end;

{== Calculations ================================================== ==}

if _LastBarOnChart then begin // Only display in real-time

// Set Text Location from right of chart
Value2 = Text_FloatLocation(TxtID, VertTextPct);

// Calc Remaining value text
if DispMode = cDispPct then
TxtStr = NumToStr((((BarRange - H+L) / BarRange) * 100), 0)+"%"+Pad
else if DispMode = cDispRaw then
TxtStr = NumToStr(BarRange - H+L, dec)+" "+Pad;

// Display Text
text_setstring(TxtID, TxtStr);

// Trigger Alert / Use Alert Color
if (((BarRange - H+L) / BarRange) * 100) < AlertPct then begin
text_SetColor(TxtID, AlertColor);
Alert(AlertStr);
end else text_SetColor(TxtID, NormColor);

end;

Started this thread Reply With Quote
Thanked by:
  #18 (permalink)
 RickW 
Duncan, B.C.
 
Experience: Intermediate
Platform: TS,MC
Trading: CL,TF
Posts: 27 since Jul 2010
Thanks Given: 97
Thanks Received: 3

Hello Serger, would you mind posting your completed code that includes the dotted horizontal lines to the high,low of bar. TIA.

Reply With Quote
  #19 (permalink)
 
Serger's Avatar
 Serger 
Quebec
 
Experience: Intermediate
Platform: Multicharts 64 +VolProfile
Broker: Interactive Brokers
Trading: Ym, Es
Posts: 74 since Oct 2010
Thanks Given: 64
Thanks Received: 25

Hello RickW
Look the post # 14 , slightly higher , post from SPMC : SP Range Remaining .pla
I have just add somme little ......... for the high low dotted line , easy .....
enjoy !

Started this thread Reply With Quote
Thanked by:
  #20 (permalink)
 RickW 
Duncan, B.C.
 
Experience: Intermediate
Platform: TS,MC
Trading: CL,TF
Posts: 27 since Jul 2010
Thanks Given: 97
Thanks Received: 3


Thks Serger, figured it out. Working great.

Reply With Quote




Last Updated on January 20, 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