NexusFi: Find Your Edge


Home Menu

 





Check last trade PL


Discussion in EasyLanguage Programming

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




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

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?
Iran Update May 8: Still Reviewing MOU, Demands Reparati …
Traders Hideout
ATFX Suspends Prop Trading Unit ATFunded -- Full Review …
Funded Trading Evaluation Firms
Election Sunday Resolves: Peru Heads to Runoff at 42pct, …
Prediction Markets & Event Contracts
Powell in 48 Hours: Word Markets Give 78% on Inflation, …
Prediction Markets & Event Contracts
UMA Votes Tonight: Polymarkets $80M Strategy Bitcoin Bat …
Prediction Markets & Event Contracts
 
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
  #2 (permalink)
 
vmodus's Avatar
 vmodus 
Somewhere, Delaware, USA
Systematic Algo Trader
 
Experience: Intermediate
Platform: MultiCharts
Broker: Barchart.com
Trading: Everything, it all tastes like chicken
Posts: 1,270 since Feb 2017
Thanks Given: 2,960
Thanks Received: 2,856

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 X 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: 117



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


© 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