Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

A few signsls on one candle

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

    #16
    Hi, I made an example that works on my end. I attached it here so you can compare it to your script to see whay may be different here. The most important detail here is to make sure the entries per direction properties are set correctly, and that you have uniquely named signals. Your signal names seem incorrect to me, unless this II is a variable, you need to have this wrapped in quotation marks so that the compiler recognizes this as a string.

    EntryHandling = EntryHandling.UniqueEntries;
    EntriesPerDirection = 1;
    Attached Files

    Comment


      #17
      Hi Chris. Thank you for sample file but signals in your file not opening positions on one candle. In situation when I have just one signal on candle - my code is working well! I have problem when I have two or more signals on one candle....
      And yes, in my code II - is variable

      Comment


        #18
        Hi, you can change the example to remove the BarsSinceEntryExecution condition and change it to Calculate.OnEachTick and it works with no issue.

        Code:
                protected override void OnBarUpdate()
                {
                    if(State == State.Historical)
                        return;
        
                    if(!initialOrder)
                    {
                        EnterLong(1, "MyEntry1");
                        initialOrder = true;
                        return;
                    } else if(!secondOrder)
                    {
                        EnterLong(1, "MyEntry2");
                        secondOrder = true;
                    }
                    else
                    {
                        return;
                    }
        
                }​

        Comment


          #19
          Thanks Chris.
          I added into OnOrderUpdate conditions for each order name separately and now all SL and PT opening for each positions on one candle correctly (earlier I worked with one condition and order name was change each time, like "MyOrder" + variable).

          Now I still have a small problem with first trade.
          My BOT working with Historical trades and I see at start (with start condition "wait until flat") when BOT have virtual position and this position is closing and BOT going to Real Time - it open just one position on canle (like earlier). BUT ALL next trades after that working well.
          In current situation I don't have positions which need to move vrom virtual to realtime, therefore I don't understand why first trade ignore conditions.​

          Comment


            #20
            Hello Chris
            I tried to run BOT with start parameter "Immediately enter", it open positions correctly, but if need to open on one candle 8 positions from 8 signals - it place SL and PT only for 6 positions.. After second crossover BOT working well and place correct quantity of SL and PT.
            (I know about transfer virtual position to Real Time and use State.RealTime for it)
            So, I have a problem only with first trade after start BOT.
            What is the BOT must be checking when virtual position going to real position? for start states "immediately enter" and for "wait until flat"?​

            Comment


              #21
              I tested my BOT with Market Replay and it put correct quantity of SL and PT (without first trade) BUT when I tried to run it on real data - it put wrong quantity SL and PT if have more one conditions on one candle...
              So I have second question: why code is working correctly on Market replay and working with errors on real data?​

              Comment


                #22
                Originally posted by vitaly_p View Post
                I tested my BOT with Market Replay and it put correct quantity of SL and PT (without first trade) BUT when I tried to run it on real data - it put wrong quantity SL and PT if have more one conditions on one candle...
                So I have second question: why code is working correctly on Market replay and working with errors on real data?​
                Hello vitaly_p,

                Thank you for your patience.

                I see you have posted the same question both here and in a new thread at the following link:
                Hello I tested my BOT with Market Replay and it put correct quantity of SL and PT, BUT when I tried to run it on real data - it put wrong quantity SL and PT if have more one conditions on one candle... So I have the question: why code is working correctly on Market replay and working with errors on realtime?​ Thanks


                I would be glad to assist you with your questions about market replay vs. real-time results in the new thread that I have already replied to. Please continue to respond there if you have any additional questions.

                Thank you for your understanding.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by NullPointStrategies, Today, 05:17 AM
                0 responses
                53 views
                0 likes
                Last Post NullPointStrategies  
                Started by argusthome, 03-08-2026, 10:06 AM
                0 responses
                130 views
                0 likes
                Last Post argusthome  
                Started by NabilKhattabi, 03-06-2026, 11:18 AM
                0 responses
                70 views
                0 likes
                Last Post NabilKhattabi  
                Started by Deep42, 03-06-2026, 12:28 AM
                0 responses
                44 views
                0 likes
                Last Post Deep42
                by Deep42
                 
                Started by TheRealMorford, 03-05-2026, 06:15 PM
                0 responses
                49 views
                0 likes
                Last Post TheRealMorford  
                Working...
                X