Announcement

Collapse
No announcement yet.

stops with the wizard

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

  • stops with the wizard

    i was wondering can anybody help with writing stops using the formula wizard.

    once in the trade, i want to have a trailing stop a certain distance below, say the last bar or two, as an obvious method of locking in profits.

    i would also like to be able to vary this distance as say a percentage for example.

    any help would be appreciated.

    regards

    richard

  • #2
    stops with the wizard

    i have posted a couple of days ago but i am unsure of how this bulletin board works.

    i am desparately trying to work out how to set a trailing stop in the wizard of say 2 or 3 bars back.

    i have worked out how to set it as the entry bar but can't work out the code for 3 back from current bar.

    thanks heaps

    richard

    Comment


    • #3
      richard
      You could use a Donchian study or moving averages of the highs and lows for that purpose. These can be set up with relative ease in the Formula Wizard. For an example of either one see this thread.
      Alex

      Comment


      • #4
        stops with wizard

        thanks for that alex. i am almost there.

        the problem i have now is that the backtest runs as a stop and reverse instead of staying out of the trade until the next signal.

        attached is the file.

        perhaps you can tell me where i am going wrong as i am sure it is simple.

        regards

        richard
        Attached Files

        Comment


        • #5
          richard
          The attached revision of your efs should fix the issue you reported.
          I have also added a final condition that if 1==1 (which is always true) to paint the bars in black else the bars get painted in white when the other conditions are not met.
          Alex
          Attached Files

          Comment


          • #6
            MACD

            thanks alex for the reply as always. the service you provide is truly amazing.

            can you just have a quick look at this macd cross. it seems to be working with longs but not with shorts and i don't know why.

            i added the intrade function as it seemed to go long again even though i was already in.

            i have attached the file.

            regards

            richard
            Attached Files

            Comment


            • #7
              richard
              The reason it is not going short is because in Set2 the second condition is
              vMACD12_26.getValue(MACDStudy.MACD, -1) > vMACD12_26.getValue(MACDStudy.MACD, -1)
              instead of
              vMACD12_26.getValue(MACDStudy.MACD, -1) > vMACD12_26.getValue(MACDStudy.SIGNAL, -1)
              As to the isInTrade() I believe you can take it out as I am not seeing the system re-entering a long once it is long.
              Alex

              Comment


              • #8
                fantastic alex.

                thanks again for the super quick answer.

                have a good weekend.

                richard

                Comment


                • #9
                  richard
                  My pleasure and a good weekend to you too
                  Alex

                  Comment


                  • #10
                    one more question alex. in all of your travels have you seen a good mechanical trading system that seems to work reasonably well across most stocks and or commodities??

                    richard

                    Comment


                    • #11
                      123 tops and bottoms

                      alex

                      do you know as to whether an efs can be written that will colour the bars 1-2-3 top and bottom patterns?

                      if so, a backtest that then takes the trade at the breakout of the number two point of the pattern.

                      all the best

                      richard

                      Comment


                      • #12
                        breakout system

                        hi alex

                        attached is a high low breakout system. can you tell me how to set the buy and sell points at the highest/lowest of the past three bars?

                        thanks

                        richard
                        Attached Files

                        Comment


                        • #13
                          richard
                          In reply to your earlier post I do not use mechanical trading systems so you may want to redirect that question to those who do such as Brad Matheny (user name Doji3333) who may be able to provide you with the information you are seeking.
                          An efs can be written to color some 1-2-3 top and bottom patterns. However depending on the conditions you may not be in a position to take a trade at point 2 if for example the pattern is predicated on the completion of a bar.
                          With regards to your last message with attached efs the script has an error in Set2 where one of the conditions is Strategy.isShort() == true and should be Strategy.isShort() == false. Also, you may want to add a last condition (ie. Set5) for 1==1 to always paint the bars in black (or whatever default color you are using)
                          To set buy and sell points at the highest/lowest of the last three bars use the Donchian channel to define the latter and then Strategy.STOP and the value of the Donchian as the entry point.
                          Alex

                          Comment


                          • #14
                            thanks for the reply alex

                            i am still up here in sydney and was hoping i would hear from you with some answers.

                            you came through as always.

                            i am a bit lost with the entry/exit points and have attached the file. could you please have a look at it as i am not sure whether i have to put the offset bar in or what?

                            this has all be a very rapid learning curve as 2 months ago i had never even seen a trading system let alone an efs.

                            how complicated is the painting the three bar pattern efs??

                            thanks again.

                            i assume you are on usa time.

                            regards

                            richard
                            Attached Files

                            Comment


                            • #15
                              richard
                              The attached revision of your efs should do what you asked.
                              In back tests the entry price is now that of the corresponding Donchian channel.
                              Alex
                              Attached Files

                              Comment

                              Working...
                              X