Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Overload for ExitLong/ShortLimit()
Collapse
X
-
Overload for ExitLong/ShortLimit()
My strategy has the possibility of two trade entries, in Currency Pairs, working at the same time. When I close the second trade, I must close both of the entries so I am using ;ExitLong/ShortLimit() for the second trade profit target. The overload is: ExitLongLimit(int quantity, double limitPrice, string signalName, string fromEntrySignal) I can deal with all of the categories except for the <limitprice> because I do not know how to configure the offset from the entry price which I have established in dollars and need to convert this Currency such that I can add or subtract it from the second entry price to establish a profit target. Can you help me with a Currency conversion in this situation?
Tags: None
-
Kate,
At present my strategy is intended exclusively for Currency Pairs as listed on Forex.com. I am using <;SetProfitTarget> for the first trade entry and it works perfectly but there is a <;CalculationMode.Currency>; that goes with it therefore my 'Target1Dollars' is converted to the necessary offset to set the correct profit target.. To set the profit target when there is a second trade, I need to use <ExitLong/ShortLimit> so that the quantity of both trades are combined and then when the Profit target which is set for the second trade is met, both trade entries are closed out. The problem that I have is that my 'Trade2Dollars' must be converted from currency to an appropriate sum to be able to added or subtracted from the entry price in order to create the offset but there is no equivalent function as with <SetProfitTaedt> like <CalculationMode.Currency.. In summary, I need to convert my Target2Dollars to an offset to my second entry price.
Comment
-
Hello galsermil,
Thank you for your reply.
I would take a look at this page of our website for calculating pip value:
Once you know the pip value, you can calculate the price per tenth-pip, which would be the price for one unit of movement. So let's say we've calculated our pip value and it is 1 dollar. If we want to place a target at $100 in profit, that's 100 pips or 1000 * TickSize (which holds the smallest unit of movement). You'd then add that to the Position's average price. So something like:
Position.AveragePrice + (1000 * TickSize) would place the order at $100 in profit for a forex instrument whose pip value is $1.
Please let us know if we may be of further assistance to you.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Yesterday, 05:17 AM
|
0 responses
53 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
130 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
70 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
44 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
49 views
0 likes
|
Last Post
|

Comment