Thanks
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
Problems with Set Profit Target?
Collapse
X
-
Problems with Set Profit Target?
Hi I have been trying to move my profit targets, but I am experience an interesting phenomena. If I move the profit target, it seems like if I was in a long position, it will exit that position and enter a short position. Would I be better off using an ExitLongLimit instead?
ThanksTags: None
-
hmm. I just have SetProfitTarget and SetStopLoss on FirstBarOfTick. I put in debugging statements in the method and it's printing out the stop loss and the profit targets correctly. I am also checking the market position and adjusting the targets accordingly.
Comment
-
This is odd. I have EnterLong as the first line of OnBarUpdate and I ran the strategy. I set the session times to 12:00 AM-12:00AM and set the account to Sim101. I have it running on the Simulator feed and nothing clicked in. Are there any other restrictions that are preventing the strategy from entering a trade?
Edit: NM, it seems to have clicked in, however the stop and the profit targets are not showing up.Last edited by mazachan; 09-20-2007, 04:35 PM.
Comment
-
Hi Ray, I think I found the issue(s). For some reason if I call SetTrailStop or SetProfitTarget within a helper function in the class, it would not execute an EnterLong order. Once I moved my logic for changing the stops and profit targets to within OnBarUpdate, it seems to have fixed the problem.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by proptradingshop, 03-21-2024, 09:50 AM
|
5 responses
26 views
0 likes
|
Last Post Today, 05:17 AM | ||
Started by MaupinFinche, Today, 05:08 AM
|
0 responses
2 views
0 likes
|
Last Post
by MaupinFinche
Today, 05:08 AM
|
||
Started by Enkidu, Yesterday, 06:40 AM
|
9 responses
35 views
0 likes
|
Last Post
by Enkidu
Yesterday, 01:11 PM
|
||
Started by Mestor, 03-10-2023, 01:50 AM
|
12 responses
309 views
0 likes
|
Last Post
by z.franck
Today, 04:29 AM
|
||
Started by AgriTrdr, 07-16-2023, 12:54 PM
|
32 responses
268 views
0 likes
|
Last Post
by f.saeidi
Yesterday, 06:49 AM
|
Comment