NexusFi: Find Your Edge


Home Menu

 





if positionprofit > 1% of trade value?


Discussion in EasyLanguage Programming

Updated
    1. trending_up 2,769 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?
June 15 Peace Odds Surge From 3.6% to 12.25% After Trump …
Prediction Markets & Event Contracts
Fabrication or Framework? Irans Denied MOU Explains the …
Prediction Markets & Event Contracts
Beijing Summit Closes: Xi Pledges Hormuz Help -- $1.14B …
Prediction Markets & Event Contracts
CFTC Approves First US Bitcoin Perpetual Futures -- Kals …
Traders Hideout
CFTC Opens First COT Report Review in 20 Years -- Asks W …
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Big Mike in Ecuador
196 thanks
Sober Journey With S&P
27 thanks
30 Sessions
20 thanks
BERN ALGOS algo trading journal
8 thanks
Volume Indicators
8 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