I'm guessing the answer will be no but thought I'd ask anyway: is there a way to set (or modify) the EnterLongLimit() string name after the actual order has been executed?
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
EnterLongLimit()
Collapse
X
-
EnterLongLimit()
The EnterLongLimit() order method allows for a string signalName to be set.
I'm guessing the answer will be no but thought I'd ask anyway: is there a way to set (or modify) the EnterLongLimit() string name after the actual order has been executed?Tags: None
-
Hi Patrick,
Thanks for the reply. I had an idea to get the Order ID from OnExecution and use that value in the signal name (for the entry, stop and profit) as a way of tracking trades.
I wanted to do that because I have a strategy where the same condition set generates multiple open trades and I was having trouble implementing a breakeven strategy using BarsSinceEntry....but I since came up with another solution.
I've actually had so much grief with this that I thought I'd post the solution just in case other users are having the same issue. I kind of thought it would be a common thing but I didn't find a similar issue anywhere and so I had to piece together a solution from several different sources.
So I started by using an integer user variable that incremented if my conditions were met and then passed that count into the signal name like so:
Code:private int count=0; if (//conditions) { count++; EnterLongLimit("Long"+count); } if (BarsSinceEntry()==1) { //execute code }
Code:if (//conditions) { count++; EnterLongLimit("Long"+count); trigger = true; } else { trigger = false } if (trigger = true) { if (BarsSinceEntry("Long"+(count-1)) == 1) { // execute code } } else if (trigger = false) { if (BarsSinceEntry("Long"+count) == 1) { // execute code } }
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by DJ888, 04-16-2024, 06:09 PM
|
4 responses
12 views
0 likes
|
Last Post
by DJ888
Today, 04:28 PM
|
||
Started by terofs, Today, 04:18 PM
|
0 responses
8 views
0 likes
|
Last Post
by terofs
Today, 04:18 PM
|
||
Started by nandhumca, Today, 03:41 PM
|
0 responses
6 views
0 likes
|
Last Post
by nandhumca
Today, 03:41 PM
|
||
Started by The_Sec, Today, 03:37 PM
|
0 responses
3 views
0 likes
|
Last Post
by The_Sec
Today, 03:37 PM
|
||
Started by GwFutures1988, Today, 02:48 PM
|
1 response
9 views
0 likes
|
Last Post Today, 03:09 PM |
Comment