範例1

 

當以下條件成立時, 觸發買一張HSIG6的交易指示

  1. RSI(14 分鐘) >= 60   和
  2. 市價 > SMA(30 分鐘) 和
  3. 最低(30 秒) > SMA(9 分鐘) 和   {意思是: 過去30秒內的最低成交價 > 過去9 分鐘的移動平均價 }
  4. 過去5 分鐘的平均成交量 >= 15

按此下載高請視頻(15M) 

詳細步驟:

In the main window's COMPOSITE page,

#1 RSI(14 minutes) >= 60  
Right click at the button "+/- Condition", Choose "Add RSI" in the pop up menu. In the property window on the right,

  • Set "Level" to 60
  • Set "Compare Operator" to coHigherThanOrEqual
  • Set "Period Count" to 14
  • Set "Period Type" to stMinute
  • Set "Product Code" to HSIG6

#2 Last Price > SMA(30 minutes)
Right click at the button "+/- Condition", Choose "Add Last Price" in the pop up menu. In the property window on the right, 

  • Set "Product Code" to HSIG6
  • Set "Name" to HSIG6
  • Set "Visible" to False (it is important because because we want it to ignore the comparison of Level as it is a subcondition)

Right click at the button "+/- Condition", Choose "Add SMA" in the pop up menu. In the property window on the right,

  • Set "Name" to SMA30
  • Set "Period Count" to 30
  • Set "Period Type" to stMinute
  • Set "Product Code" to HSIG6
  • Set "Visible" to False (it is important because because we want it to ignore the comparison of Level)

Right click at the button "+/- Condition", Choose "Add Operator" in the pop up menu. In the property window on the right,

Set "Compare Operator" to coHigherThanOrEqual
Set "Left Operand" to HSIG6 (which is the name we gave to the "Last Price" condition earlier)
Set "Operation" to –
Set "Right Operand" to SMA30 (which is the name we gave to the SMA(30 Minute) condition earlier)
Set "Level" to 0 (which will make  the condition = HSIG6's Last Price  – SMA(30 Minute) >= 0     )
   Similarly, if you set "Level" to 30, it will make the condition =  HSIG6's Last Price  – SMA(30 Minute) >= 30
Set "Name" to HSIG6MinusSMA30 (a meaningful name)
Set "Visible" to True
   (now, you understand why we set the previous 2 condition "Visible" to False. It is because they are sub conditions to be used by this condition only)

#3 Low(30 seconds) > SMA(9 minute)
Right click at the button "+/- Condition", Choose "Add PeriodsField" in the pop up menu. In the property window on the right,

Set "Field" to pfLow (which is the Period LOW)
Set "Formula" to pffMin   (which means the minimum of the 30 Field values)
Set "Name" to Low30s
Set "Period Count" to 30
Set "Period Type" to stSecond
Set "Product Code" to HSIG5
Set "Visible" to False  (since it is a subcondition, we set it to FALSE)
Together, this means the Minimum Price of the past 30 seconds of HSIG6

Right click at the button "+/- Condition", Choose "Add SMA" in the pop up menu. In the property window on the right,

  • Set "Name" to SMA9m
  • Set "Period Count" to 9
  • Set "Period Type" to stMinute
  • Set "Product Code" to HSIG6
  • Set "Visible" to False (it is important because it is a sub condition)

Right click at the button "+/- Condition", Choose "Add Operator" in the pop up menu. In the property window on the right,

Set "Compare Operator" to coHigherThanOrEqual
Set "Left Operand" to Low30s
Set "Operation" to –
Set "Right Operand" to SMA9M
Set "Level" to 0 (which will make  the condition = Low30s  – SMA(9 Minutes) >= 0     )
   Similarly, if you set "Level" to 30, it will make the condition =  Low30s  – SMA(9 Minutes) >= 30    
Set "Name" to Low30sMinusSMA9m
Set "Visible" to True  

 

#4 Average Volume (5 minute) >= 15
Right click at the button "+/- Condition", Choose "Add PeriodsField" in the pop up menu. In the property window on the right,


Set "Compare Operator" to coHigherThanOrEqual
Set "Field" to pfVolume (which is the Period Volume)
Set "Formula" to pffAverage   (which means the average of the  15 Field values)
Set "Level" to 15    (In real market, the average volume per minute of HSIG6 is about 300, but in demo market, the volume is much lower, so we set a much smaller level)
Set "Name" to AvgVol5m
Set "Period Count" to 5
Set "Period Type" to stMinute
Set "Product Code" to HSIG5
Set "Visible" to true 
Together, this means the Average (Volume per minute) of the past 5 minutes >= 15

 

By now, the left panel will look like this

listing all the conditions we have defined. The combined condition is effectively :
[ HSIG6.RSI(14M) >= 60 ] and [ (HSIG6.LastPrice – HSIG6.SMA(30M)) >= 0 ] and [ (HSIG6.Low.Min(30S) – HSIG6.SMA(9M)) >= 0 ] and [ HSIG6.Volume.Avg(5M) >= 15 ]

 

Now that you have defined the trigger condition, let's define what to do when triggered.
The bottom left of the COMPOSITE page looks like this:


You now select the product code (the product you want to buy/sell when the composite condition is triggered).
Toller is the amount you add to or subtract from the market price when the order is placed (same as SPTrader's toller)
Close Toller is the toller when the stop loss price is reached.
If you tick the Enabled box, you can define how much to take profit eventually.

 

You also need to define how much to stop loss.

The "Buy/Sell Qty"    is the number of contracts to buy or sell when the composite condition is triggered.

NOTE: a positive number means BUY and a negative number means SELL.
That is, for the same condition, can you place a BUY or a SELL order depending on the sign of the buy/sell quantity.

After you defined all the above parameters, you can click "Add Strategy" button to add this strategy.

NOTE:  by default, you can only trade 1 Buy and 1 SELL strategy. It is to protect beginners from doing too many trades.

You can increase the limits in the above boxes and then click "Update Limits".  If you don't click "Save Settings and Limits", the limits will revert back to the old values the next time you start Spark.

Also, by default, all trades are SIMULATED ONLY if you tick this box:

Clear the box, if you want to send the orders to the real markets.

The following box defines the active periods of your autotrade strategy.


"00:00:00" means it is not defined.

e.g. the above specify the strategies will be active from
1) 10:02 to 11:55 
   and
2) 13:05 to 16:12

No strategies will be triggered outside of the above periods. You do this ff you think your strategy is only correct and useful during these periods.

The "Force Close At" define the time to force close any open order (triggered by the strategy) if it has not reached the "Take Profit" or "Stop Loss" prices. Normally, it is used because traders don't want keep an open position during lunch and overnight. So, any position opened in a trading session will be force closed by the end of that session.

 

  tells Spark how many seconds to wait before it cancels any unfilled order. It is useful when an order is triggered but the market moves too fast away, so the order remain unfilled for a long time.   For safety, we can cancel the order if it is unfilled after 15 seconds, because if the market has moved so fast since the trigger point and later reverses back, the market trend might have completely reversed.  By that time, it might not be wise to open order any more.

 

If your trigger condition is a relative one (e.g. LAST PRICE > SMA(30 minute) instead of a fixed price level (e.g. SMA(30 minute) > 19000) , the same strategy might be reused over and over again during the same day.  In that case, you can tick the following box

and when your strategy is later closed (either Taken profit, or Stopped Loss or Cancelled after being unfilled for too long), Spark will automatically add another strategy of the same parameters for you (if you have not exceeded the max. strategies limits").

 

You can define how many seconds to wait before adding another strategy automatically by setting values of:
Depending on whether that last strategy ends up in profit or loss, different a waiting period is used.

If you want to delete a condition, right click on the condition row and choose "Delete Row"