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, 10: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 AaronKoRn, Today, 09:49 PM
0 responses
7 views
0 likes
Last Post AaronKoRn  
Started by carnitron, Today, 08:42 PM
0 responses
9 views
0 likes
Last Post carnitron  
Started by strategist007, Today, 07:51 PM
0 responses
10 views
0 likes
Last Post strategist007  
Started by StockTrader88, 03-06-2021, 08:58 AM
44 responses
3,980 views
3 likes
Last Post jhudas88  
Started by rbeckmann05, Today, 06:48 PM
0 responses
9 views
0 likes
Last Post rbeckmann05  
Working...
X