NexusFi: Find Your Edge


Home Menu

 





five digits after the decimal point using "entryprice" function


Discussion in MultiCharts

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




 
Search this Thread

five digits after the decimal point using "entryprice" function

  #1 (permalink)
 avasfx 
Poland
 
Experience: Intermediate
Platform: Multicharts, RealTest
Broker: AMP, TradeNation, IntractiveBrokers
Trading: ES, DAX, YM, FTSE
Posts: 23 since Jul 2009
Thanks Given: 15
Thanks Received: 1

Hello,
i'm fairly new to PowerLanguage and programming at all. So please excuse me

i'm trying to code some conditions, after first target was reached, stop loss will be moved to BE + x%. For this i'm using build-in function: entryprice(0) like this:

if high >= Fib1_55 then sell ("BE") 2000 contracts next bar at (entryprice(0)+(entryprice(0)*0.05)/100) stop;

The problem is, when i print(entryprice(0)) it gives me 1.31 insted of 1.31992 (GBP/USD pair, using oanda datafeed).
I've tried to use "round" function - round(entryprice(0)+(entryprice(0)*0.05)/100),5) but it still returns 1.31. Where could be a problem here?
Thanks in advance,
Alex

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Better Renko Gaps
The Elite Circle
Futures True Range Report
The Elite Circle
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
61 thanks
Funded Trader platforms
39 thanks
NexusFi site changelog and issues/problem reporting
26 thanks
Battlestations: Show us your trading desks!
26 thanks
The Program
18 thanks
  #2 (permalink)
 ocpb 
Hartford CT, USA
 
Experience: Beginner
Platform: None
Trading: ES
Posts: 126 since Jan 2015
Thanks Given: 152
Thanks Received: 125


avasfx View Post
Hello,
i'm fairly new to PowerLanguage and programming at all. So please excuse me

i'm trying to code some conditions, after first target was reached, stop loss will be moved to BE + x%. For this i'm using build-in function: entryprice(0) like this:

if high >= Fib1_55 then sell ("BE") 2000 contracts next bar at (entryprice(0)+(entryprice(0)*0.05)/100) stop;

The problem is, when i print(entryprice(0)) it gives me 1.31 insted of 1.31992 (GBP/USD pair, using oanda datafeed).
I've tried to use "round" function - round(entryprice(0)+(entryprice(0)*0.05)/100),5) but it still returns 1.31. Where could be a problem here?
Thanks in advance,
Alex

Looks like you may control the precision of the outputted value, if you follow the instructions here:
https://www.multicharts.com/trading-software/index.php/Print

Currently you're accepting the default which is 2 decimal places.

Reply With Quote
Thanked by:
  #3 (permalink)
 avasfx 
Poland
 
Experience: Intermediate
Platform: Multicharts, RealTest
Broker: AMP, TradeNation, IntractiveBrokers
Trading: ES, DAX, YM, FTSE
Posts: 23 since Jul 2009
Thanks Given: 15
Thanks Received: 1


Thanks ocpb, I didn't know about it. But I'm using print function just to understand what's going wrong. The main problem is that stop order was not generated based on my condition, that's why I was trying to print it and see what's wrong inside.
ocpb View Post
Looks like you may control the precision of the outputted value, if you follow the instructions here:
https://www.multicharts.com/trading-software/index.php/Print

Currently you're accepting the default which is 2 decimal places.

Sent using the NexusFi mobile app

Started this thread Reply With Quote
  #4 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,431 since Apr 2013
Thanks Given: 481
Thanks Received: 1,623

avasfx,

the prevision is only related to the Print reserved word. Internally your code would use the number of decimal spaces the reserved words return.
Keep in mind that MC will keep orders alive until the next code calculation only - if your order conditions are still valid the order would remain alive until the next code calculation otherwise it would get cancelled.

Regards,

ABCTG



avasfx View Post
Thanks ocpb, I didn't know about it. But I'm using print function just to understand what's going wrong. The main problem is that stop order was not generated based on my condition, that's why I was trying to print it and see what's wrong inside.

Sent using the NexusFi mobile app


Follow me on Twitter Reply With Quote
Thanked by:




Last Updated on February 3, 2020


© 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