Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
five digits after the decimal point using "entryprice" function
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
Can you help answer these questions from other members on NexusFi?
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.
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.