NexusFi: Find Your Edge


Home Menu

 





if positionprofit > 1% of trade value?


Discussion in EasyLanguage Programming

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




 
Search this Thread
  #1 (permalink)
 
toddma's Avatar
 toddma 
vancouver canada
 
Experience: Intermediate
Platform: multicharts, ninjatrader
Trading: forex
Posts: 53 since Jul 2012
Thanks Given: 14
Thanks Received: 6

Hi - I'm a little bit stuck here.
I have absolute values in my code such as:
if positionprofit > 1000 and...
however, when I run this code on something like pesos or yen I believe it is calculating positionprofit in that currency. So the code will execute when it shouldn't.

How would I make this relative? example:
"if positionprofit > (1% of trade value)"...

Thanks in advance.


Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
requesting .nrd replay files from 2026 spy and qqq
The Elite Circle
Datafeed for Atas
Platforms and Indicators
EA
Platforms and Indicators
Trump Media to sell instant access to market-moving soci …
Traders Hideout
No book, only a stair: journaling fills where price move …
Cryptocurrency
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Mes vs MNQ
6 thanks
NexusFi site changelog and issues/problem reporting
5 thanks
BERN ALGOS algo trading journal
3 thanks
Johnnys Journal
2 thanks
TopStep Trader disappointment
2 thanks
  #3 (permalink)
 
toddma's Avatar
 toddma 
vancouver canada
 
Experience: Intermediate
Platform: multicharts, ninjatrader
Trading: forex
Posts: 53 since Jul 2012
Thanks Given: 14
Thanks Received: 6


Sorry - that question was in reference to Multicharts


Started this thread Reply With Quote
  #4 (permalink)
 
bnichols's Avatar
 bnichols 
Dartmouth NS
 
Experience: Intermediate
Platform: MC, MC.Net, NT, TWS
Broker: IB / IQFeed / Kids
Trading: Forex, stocks
Posts: 637 since Feb 2010
Thanks Given: 64
Thanks Received: 460

Relatively new to MC myself so don't know most of the in's and out's but one way to convert to percent might be

Value1 = PositionProfit / (AvgEntryPrice * CurrentContracts) * 100;

assuming PositionProfit and AvgEntryPrice are reported in the same currency :-/


Visit my NexusFi Trade Journal Reply With Quote
  #5 (permalink)
 
toddma's Avatar
 toddma 
vancouver canada
 
Experience: Intermediate
Platform: multicharts, ninjatrader
Trading: forex
Posts: 53 since Jul 2012
Thanks Given: 14
Thanks Received: 6

That looks like a good solution. I've improvised myself and used:

if positionprofit > InitialCapital*.01 - however, I need to ensure that initialcapital is in the currency that profits are reported in - so I may be trading size 100k but if I'm trading yen then I set the initialcapital @ 8,300,000... this seems* to work... not a great solution though...

Thanks for your thoughts.


Started this thread Reply With Quote




Last Updated on November 23, 2012


© 2026 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 - Downloads - Top
no new posts