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

Indicator logic & lot sizes

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

    Indicator logic & lot sizes

    Hi, I'm just dabbling in the strategy builder and I'm looking for a "close below" option but the closes option I see is "crosses below".

    However this isn't very good for me because I need the strategy to place a sell or buy when the entire bar is completely closed below or above the indicator. These are a few times when a trade is placed when the bar only only just peaks above or below the indicator. https://i.gyazo.com/f81a8c8a21d345a4...00b8a7198b.png for example.

    Also I have highlighted the stats from the performance test and they seem good but for some reason the profit is absolutely tiny https://i.gyazo.com/ff95b0f589549c26...8dffd2c9bb.png.

    How can I change the lot size my strategy trades? I think I'm literally trading like 1 microlot per trade or something?

    Thank you kindly.

    #2
    Hello matty89,

    The default crossing conditions would relate to a single price crossing another single price within a lookback period, what you are asking for would require 4 prices or the OHLC prices to be checked.

    For this type of crossing you would likely need to check that all of the OHLC prices have crossed the indicator rather than just one of the bars prices. If you were to do that using the CrossAbove or Below conditions you would also likely need to add more bars to the lookback period. In your example image the cross below would not have worked with 1 lookback period because some of the bar was already crossed prior to being completely below the indicator value. In that case 2 bars lookback would have been needed in addition to checking that all 4 of the OHLC had crossed below.


    For the performance question, it sounds like that was a forex instrument being used. Forex would require the full lot amount like 10000, a tiny profit like this while still seeing trades is usually related to forex and the quantity used.

    You can change the amount in the User interface when you configure the strategy or in the strategies code.
    To change it from the user interface, when applying the strategy scroll down in its properties and look for " Order Properties -> Set order quantity". Change this from Strategy to Default Quantity and then enter the amount.
    To do this in the script you would enter the value when you configure the order. In the Action where you have the order methods you would edit it and type in the quantity where it shows DefaultQuantity.

    I look forward to being of further assistance.

    JesseNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Jesse View Post
      Hello matty89,

      The default crossing conditions would relate to a single price crossing another single price within a lookback period, what you are asking for would require 4 prices or the OHLC prices to be checked.

      For this type of crossing you would likely need to check that all of the OHLC prices have crossed the indicator rather than just one of the bars prices. If you were to do that using the CrossAbove or Below conditions you would also likely need to add more bars to the lookback period. In your example image the cross below would not have worked with 1 lookback period because some of the bar was already crossed prior to being completely below the indicator value. In that case 2 bars lookback would have been needed in addition to checking that all 4 of the OHLC had crossed below.


      For the performance question, it sounds like that was a forex instrument being used. Forex would require the full lot amount like 10000, a tiny profit like this while still seeing trades is usually related to forex and the quantity used.

      You can change the amount in the User interface when you configure the strategy or in the strategies code.
      To change it from the user interface, when applying the strategy scroll down in its properties and look for " Order Properties -> Set order quantity". Change this from Strategy to Default Quantity and then enter the amount.
      To do this in the script you would enter the value when you configure the order. In the Action where you have the order methods you would edit it and type in the quantity where it shows DefaultQuantity.

      I look forward to being of further assistance.
      We have lift off! https://i.gyazo.com/7177321aa25c68e4...f35c7d7c80.png

      Thank you very much for the help.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by alifarahani, Today, 09:40 AM
      3 responses
      15 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by RookieTrader, Today, 09:37 AM
      4 responses
      17 views
      0 likes
      Last Post RookieTrader  
      Started by PaulMohn, Today, 12:36 PM
      0 responses
      4 views
      0 likes
      Last Post PaulMohn  
      Started by love2code2trade, 04-17-2024, 01:45 PM
      4 responses
      39 views
      0 likes
      Last Post love2code2trade  
      Started by junkone, Today, 11:37 AM
      3 responses
      23 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Working...
      X