Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Entry Bool Flag Questions

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

    Entry Bool Flag Questions

    Hello,

    I have figured out how to place extra bool values to flag my entry without putting an actual order in. I have done this to allow myself to enter on a pullback without having to use a limit order and all that other logic. It is working perfectly when I get the pullback. And will exit as it supposed to. I did see if I have it exit, I cannot keep the entry signal alive and it will look for another signal once that is closed. When I exited I tried to keep the Trade_Ready_Long = true but I assume it would not work. If there is a way to simulate it being in the position, that would be helpful as well. Here is what I am dealing with as a simplified system:

    Lets say I want to enter on a moving average cross, I enter on the 5 crossing the 20. Now if I exit at lets say 20 pts for profit and 20 pts for stop it would ignore all other crosses until one of those two situations would happen. Now lets say I moved that profit target to 1 point for example, now I could get many crosses after I just exited for profit which could be good or bad. I want to keep the bool value live until my internal codes say its no longer valid, even if I want to have it do other things inside of that. For instance, lets say I got a pullback of 10 points from my Longentryprice which I save the value for on my trades, if we get back to even and I have it exit, I would want to be able to enter again on that same signal if we got a 10 point pullback if none of the internal code signaled.

    Trade_Ready_Long = true once I get my entry signal.
    I then set 2 other bools to true: intrade and longtrade. This locks in extra things for my logic used.
    Then when I get my pullback it signals a Trade_Long_Entered bool

    In the respective sections for EnterLong(); and ExitLong(); can I add soemthing else that holds a fake market position?

    Once the signal is no longer valid it would reset all these variables to be ready for the next trade. I have had these types of variables working on other systems I have created but this pullback entry is different from what I have done before.

    Now if not submitting an order is there a way simulate a position with another variable without entering? So, if one of my exit conditions hit before I get the pullback for my entry it will allow another entry signal?

    I know I have asked the same thing a few times in this post but tried to explain in differently incase anyone can follow what I trying to do.

    Any help is appreciated!

    #2
    Hello durdcash,

    There is not a way to make a fake market position but you could use a variable like an int to define a value of -1 0 or 1 if you wanted to make something similar to a position which has 3 possible states.

    Comment


      #3
      NinjaTrader_Jesse Thanks! I will look at using integers for the states and see if that allows me to work around this

      Comment

      Latest Posts

      Collapse

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