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!
See more
See less

Partner 728x90

Collapse

unexpected/unwanted trades + Set methods

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

  • NinjaTrader_ChrisL
    replied
    Hi Amedeus, thanks for posting this.

    The obvious problem from the screen shot is there are only two entries yet it looks like there are profit targets set, so there is something wrong with the entry quantities or order handling in the strategy. What data feed are you using to run the strategy? Can you send me a reduced example to scriptingsupport at ninjatrader.com, referencing "Attn ChrisL 3327115" in the body of the email?

    Best regards,
    -ChrisL

    Leave a comment:


  • Amedeus
    replied

    hey Chris, thank you,

    I can provide some of it.
    The methods are called like this :


    Code:
    protected override void OnStateChange()
    {
    ...
    else if (State == State.DataLoaded)
    {
    someComboz_SetStopTarget();
    }
    }
    
    private void someComboz_SetStopTarget()
    {
    SetStopLoss("someComboa", CalculationMode.Ticks, someInta, false);
    SetStopLoss("someCombob", CalculationMode.Ticks, someInta, false);
    SetStopLoss("someComboc", CalculationMode.Ticks, someInta, false);
    
    SetProfitTarget("someComboa", CalculationMode.Ticks, someIntb);
    SetProfitTarget("someCombob", CalculationMode.Ticks, someIntb);
    SetProfitTarget("someComboc", CalculationMode.Ticks, someIntb);
    }
    None of the FromEntrySignal is called "Profit Target"...
    and the finder cannot find : "Profit Target"

    What better detail could I provide ?
    Last edited by Amedeus; 10-27-2021, 09:15 AM.

    Leave a comment:


  • NinjaTrader_ChrisL
    replied
    Hello Amedeus, thanks for writing in.

    It looks like a signal "Profit Target" is creating the short position. I can not tell what is causing this from the screen shot. Can you provide some details about the strategy?

    Best regards,
    -ChrisL

    Leave a comment:


  • Amedeus
    started a topic unexpected/unwanted trades + Set methods

    unexpected/unwanted trades + Set methods


    Hi everyone,

    I have an issue with a strategy :

    at some point, from time to time, when running real time, the strategy starts to take unexpected trades as the short in the attached picture.
    there is no short in this piece of script, yet at the end of the long, it enters for a short.

    this is using the SetStopLoss(); and SetProfitTarget(); methods.

    Has anyone a clue as why this is doing this ? or what to look for in order to know the why and correct it ?
    Attached Files

Latest Posts

Collapse

Topics Statistics Last Post
Started by Monares, Today, 10:49 AM
1 response
4 views
0 likes
Last Post NinjaTrader_JustinD  
Started by d122y, Today, 10:20 AM
1 response
4 views
0 likes
Last Post NinjaTrader_ChrisL  
Started by trader3000a, Today, 06:41 AM
1 response
10 views
0 likes
Last Post NinjaTrader_Jesse  
Started by slimcactus, Today, 10:26 AM
0 responses
5 views
0 likes
Last Post slimcactus  
Started by trader3000a, Today, 09:23 AM
2 responses
11 views
0 likes
Last Post trader3000a  
Working...
X