Hedging

  • This topic has 3 replies, 2 voices, and was last updated 7 years ago by avatarWing.
Viewing 4 posts - 1 through 4 (of 4 total)
  • #25962

    Question….

    If I am long on the market, can i use a 2nd automated script to see if there is a long position, and if that long position is – 20 pips enter a short position as a hedge?

    I know this cant be done in the same script as you cant have a long and short order together, but can it be done separately? If so how ?

    Thanks

    #25964

    No, systems can’t check each other. But by including a variable that checks for the long entry inside the system that only goes short, you can ‘check’ if the mirror system is long currently.

    #25966

    but i wouldn’t know at what price the long was? ie know its position in relation to entry?

    #25969

    You wouldn’t know the exact entry price, but the price would likely be close to the open of the bar, or based on a limit price that you can also give the other system access to. For example:

    Long system:

    Short hedging system:

    Or something like that. If you exit both positions at the same time (a set time for example), you need to just reset the variables again.

    The easiest way is to create a common indicator that gives entries to each system, so they know exactly when an entry is triggered for the opposite system.

    2 users thanked author for this post.
Viewing 4 posts - 1 through 4 (of 4 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login