Simple Order Hedge We want to create two orders, one above the market 0

Posted on 17, June 2013

in Category SID


Description for OrderHedge SID 337

Simple Order Hedge We want to create two orders, one above the market (which will go long) and one below the market (which will go short) If either order is filled, we cancel the other. If none of the orders are filled for this bar, we keep both active

Simple Order Hedge  We want to create two orders, one above the market/sid Notes for this Trading Account:

Simple Order Hedge

We want to create two orders, one above the market (which will go long) and one below the market (which will go short)

If either order is filled, we cancel the other. If none of the orders are filled for this bar, we keep both active until one is filled.

As the option “Implicit Once Cancels All (OCA) group for each system” has been checked in the system object, Seer will cancel the orders for us.

Simple Order Hedge  We want to create two orders, one above the market/sid Rules for this Trading Account:

Simple Order Hedge  We want to create two orders, one above the market/sid Notes for this Trading System:

Simple Order Hedge  We want to create two orders, one above the market/sid Rules for this Trading System:

Simple Order Hedge  We want to create two orders, one above the market/sid Bar event logic:

#We want to create two orders, one above the market (go long) and 
#one below (go short)

#If either order is filled, we cancel the other. If none of the orders
#are filled for this bar, we keep both active until one is filled.

#As the option "Implicit Once Cancels All (OCA) group for each system"
#has been checked in the system object, Seer will cancel the orders
#for us.

unless (Position or Orders) {
  #we dont have a position or any active orders for this symbol
  
  #we define the spead price as 1/2 of a 45 bar average true range
  my $orderspread=Now(ATR(45))/2;
  PlaceBuyStop('Above Market',100,ClosePrice+$orderspread);
  PlaceSellStop('Below Market',100,ClosePrice-$orderspread);
}

#Exit logic - close close after 6 bars

if (Position and BarsSinceEntry==6) {
  if (LongPosition) {
    #If we have a long position, close it.
    PlaceSellOpen('Exit');
  }
  else {
    PlaceBuyOpen('Exit');
  }
}

0 Comments

Leave a Message