How to set PNL for particular set ? or put a stoploss on the basis of the PNL of that set — Tradetron Community
← Community

How to set PNL for particular set ? or put a stoploss on the basis of the PNL of that set

Strategy 9,945 views

Sekh Azizul

How to set PNL for particular set ? or put a stoploss on the basis of the PNL of that set.

Sekh Azizul

To check the PNL of a particular set we need to calculate it using the various keyword available to us like the TradedInstrument Entry price and LTP and Quantity.

On the Above Image, The 1st part is how we are calculating a PNL stop-loss or -1500 and the 2nd part shows how we are calculating Take Profit of 25000.
Here we are using a list as underlying you may also use a single instrument. This means this can be applied to a list of instruments as well.

Sekh Azizul Solution

Answer
There is another way of Setting PNL for each set, Below is an example where an exit condition for Iron Condor is shown where hedges are from entry and sell entries are from repair once.

anoopviswanathan

if any of u r traded instruments have already met its exit condition, abv formula wont work. As per my knowledge pnl in a traded instrument work with eqn LTP-entry price. for an exited leg condition will be false.

Chandrahas

The below condition did not work for a Set Gain of Rs 500 or 20 points (25x20) in Bank Nifty…Can any one suggest any error…? This is a SELL trade so gain is when LTP is 20 points below the Entry price
( ( Traded Instrument ( ‘strategy_id’, ‘run_counter’, ‘Entry’, ‘price’, ‘NIFTY BANK’, ‘1’, ‘1’, ‘1’ ) - LTP ( Traded Instrument Name ( ‘strategy_id’, ‘run_counter’, ‘Entry’, ‘instrument’, ‘NIFTY BANK’, ‘1’, ‘1’, ‘1’ ) , ‘LTP’ ) ) >= Number ( ‘20’ ) )

Chandrahas

The Condition is Perfectly OK but it did not get executed because of an Error in Condition builder…

Lion Algos

Chandrahas - pls share screenshot of your code