Announcement

Collapse
No announcement yet.

Secondary conditions?

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

  • Secondary conditions?

    Let say I have my conditions in SET 1, but I want to use a secondary signal to activate my doshort. So if, Set 1 == true anytime after that my second condition would trigger the trade (as long as my SET 2 was'nt triggered)

    Would I put in my conditons like this in SET 3? (Set 2 already has conditions)

    vLastAlert ! = 1 == true

    then add my secondary conditions after this?

    Any help would be appreciated.

    Fibbgann
    Excellent book on JavaScript for beginners

  • #2
    FibbGann
    In Set1 you would only set a flag. For example, if the conditions are true then in "The following will happen every time" you put vFlag==true (or 1). You also need to make sure that there is the condition where vFlag is == false (or 0).
    Then in the conditions for Set2 you verify if vFlag==true (or 1) plus your additional conditions and at that point in "the following will happen every time" you trigger the strategy and reset the vFlag to false (or 0)
    Alex

    Comment


    • #3
      Thanks Alex. Unfortunately you lost me, I guess I am just not to that point yet. I need to do some more homework!

      Fibbgann
      Excellent book on JavaScript for beginners

      Comment


      • #4
        FibbGann
        Here is an example using a flag. When the CCI crosses under 100 it only sets vFlag=1 and paints the background yellow. Then when the Close crosses under the MA it will trigger the strategy and paint the background in red if vFlag=1.
        There is only one thing that needs to be written using the Editor and that is the variable outside of main() (you can see it together with the other variables at the beginning of the script).
        Alex

        Attached Files

        Comment


        • #5
          Alex,

          I tried to send you an e-mail reply to your note and it was rejected as a spam. I don't know If you can do anything on your end, I've tried several times and get a note back saying that my e-mail reply was spam.

          Regards,

          Comment


          • #6
            Steve
            That is probably my ISP being extra diligent. Will try to see if I can do anything at my end.
            In the mean time I have reactivated PM so you can use that
            Alex

            Comment

            Working...
            X