Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Range Bars : SetStopLoss and SetProfitTarget not working as expected

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Range Bars : SetStopLoss and SetProfitTarget not working as expected

    I'm working on the CL startegy with 6 Range bars.
    Initialize routine is as follows :


    protected override void Initialize()
    {
    SetProfitTarget("LongPosition", CalculationMode.Ticks, 5);
    SetStopLoss("LongPosition", CalculationMode.Ticks, 7, false);

    SetProfitTarget("ShortPosition", CalculationMode.Ticks, 5);
    SetStopLoss("ShortPosition", CalculationMode.Ticks, 7, false);

    CalculateOnBarClose = false;
    }

    When a signal is true, I get in a position, however, SetProfitTarget and SetStopLoss is not getting me out!! CL moves 7 ticks is matter of seconds or minutes but I keep staying in the trade. What am I doing wrong?

    #2
    Hello afshinmoshrefi,
    Please send the log and trace files to support[AT]ninjatrader[DOT]com so that I can take a look of what might has happened.
    • You will find the log file in the Documents > NinjaTrader 7 > Log folder.
    • The log file will be named "log.YYYYMMDD.txt"

    • You will find the trace file in the Documents > NinjaTrader 7 > Trace folder.
    • he trace file will be named "trace.YYYYMMDD.txt"



    Please append Attn:Joydeep in the subject line of the email and give a reference of this thread in the body of the email.

    I look forward to assisting you further.
    JoydeepNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    68 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    38 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    62 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    62 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    53 views
    0 likes
    Last Post CarlTrading  
    Working...
    X