NexusFi: Find Your Edge


Home Menu

 





Check last trade PL


Discussion in EasyLanguage Programming

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




 
Search this Thread

Check last trade PL

  #1 (permalink)
 bchip 
Torino, Italy
 
Experience: Advanced
Platform: TradeStation
Trading: ES,YM,CL,GC
Posts: 132 since Sep 2017
Thanks Given: 160
Thanks Received: 116

Hi

Is it possible to check if the last trade was a winner or loser?
Is there any code for this?

E.g. if PrevTradePL < 0 then BuyCtx = 1
else BuyCtx = 2

Thank you

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
REcommedations for programming help
Sierra Chart
ZombieSqueeze
Platforms and Indicators
Trade idea based off three indicators.
Traders Hideout
Cheap historycal L1 data for stocks
Stocks and ETFs
How to apply profiles
Traders Hideout
 
  #2 (permalink)
 
vmodus's Avatar
 vmodus 
Somewhere, Delaware, USA
 
Experience: Intermediate
Platform: MultiCharts
Broker: Barchart.com
Trading: Everything, it all tastes like chicken
Posts: 1,271 since Feb 2017
Thanks Given: 2,958
Thanks Received: 2,853

You probably want to use: PositionProfit
From the EasyLanguage dictionary:
PositionProfit (Reserved Word)

Returns the current gain or loss of the specified position..

PositionProfit(Num);

Num is a numeric expression representing the number of positions ago (up to a maximum of ten).

Remarks

This function can only be used in the evaluation of strategies. It does not require an input, however, by using the input Num, you can obtain the specified value from a previous position, up to ten positions ago.

Example

PositionProfit(3) returns a value of -1.00 if the third most recent position on a chart had a loss of 1.00.

~vmodus

Enjoy everything!
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #3 (permalink)
 bchip 
Torino, Italy
 
Experience: Advanced
Platform: TradeStation
Trading: ES,YM,CL,GC
Posts: 132 since Sep 2017
Thanks Given: 160
Thanks Received: 116



vmodus View Post
You probably want to use: PositionProfit
From the EasyLanguage dictionary:
PositionProfit[/B] (Reserved Word)

Thank you very much

Started this thread Reply With Quote
Thanked by:




Last Updated on June 5, 2021


© 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