USER GUIDE - Circadian

USER GUIDE - Circadian

10 August 2022, 21:09
Conor Stephenson
0
1 748

Product page : https://www.mql5.com/en/market/product/82303

1. What is triangular arbitrage? What is this EA? How does Circadian enter and manage trades?

2. Input definitions + On-chart Panel & Buttons.

3. Problems with the EA / Troubleshooting.


1. 

Triangular arbitrage is a trade opportunity that presents itself when three correlated currency pair prices spike to a point what is considered inefficient pricing. If three trades are opened in a synchronized manner at these levels, when price corrects itself, these trades should quickly be in profit.

Circadian is a grid expert advisor that is built around this triangular arbitrage concept. The goal of the expert is to take advantage of quick price irregularities happening between three correlated currency pairs. It's kind of like three experts in one that will work off of each other, each opens a trade related to the other and only in two certain configurations. The expert is always searching for a BUY, SELL, BUY arbitrage or a SELL, BUY, SELL, needed to be crossed with a matched trend following logic so to ensure stronger probability of profitable trades. Initial trades are always opened in a group of three with an aim of the two strongest pairs cancelling each other out and the remainder acting as a hedge pair.

With triangular arbitrage opportunities being few, this expert has a unique way of scanning and comparing pairs and prices. Valid pairs are grouped into sets of three, which sets are then given twenty seconds each to present a trade opportunity, when one is found, the pair set is locked, trades are opened in a group of three, Circadian will then focus on those pairs until all opened trades are closed and then scanning will commence again. Certain pair sets can be used individually or mixed to increase or decease potential trade opportunities. Circadian possess a custom permutations calculator that is able to take all forex pairs shown in the terminals marketwatch list and create all possible valid triangular arbitrage pair set combinations to scan.

Circadian is equipped with multiple functions in order to manage opened trades and gain profit. When needed the expert will use gridded orders with an optional multiplier and a hedge function capable of overviewing and managing all pairs in a current set. Circadian's core profit closing mechanism is a basket close logic that will monitor a sets floating profit and close out all trades at a desired profit level. The expert utilizes a function able to manage each of the pairs take profit level independently, allowing the expert to also scalp pairs individually.


2.

CIR1

  • Magic Number. - Number the EA uses to associate trades with itself - you only need to change the magic number if you are using the EA on two charts of the same pair, each chart would then need a different magic number.
  • Order Comment.- Comment displayed on each trade taken.
  • Show On Chart Comment.- Set true will display information on chart.
  • Chart Panel Mode. - 'Panel_' - Draws a moveable panel with information on chart. - 'Comment_' - Displays a on chart comment on the left side of the screen.
  • Panel Text. - Panel text color.
  • Sell Color. - Panel sell color.
  • Buy Color. - Panel buy color.
  • Text Size. - Panel text size.
  • Draw Line. - True will draw a line at the breakeven point for open trades.
  • BE Line. - Color used for the breakeven line.
  • Draw Profit Labels. - True will draw closed profit labels on chart.
  • Profit Label Mode. - What to display inside the profit lables, currency amount, pips or both.
  • Profit Labels. - Color used for the profit lables.

CIR2

  • Arbitrage Threshold. - When using 'Triangular Arbitrage' trade mode the sum of pairs in a set must be above the value in this input to open trades.
  • Trade Mode. - 
    • ' Triangular Arbitrage ' - The expert will open trades once a valid arbitrage sum is above the 'Arbitrage Threshold' and trend following logic indicates a buy sell buy or sell buy sell pattern.
    • ' Scalp With Trend ' - The expert will open trades once trend following logic indicates a buy sell buy or sell buy sell pattern.
    • ' Merge Signals ' - The expert will open a buy sell buy or sell buy sell pattern if any of the pairs in a set show a buy or sell signal.
  • Active Pair Triangle. - Current pair set that Circadian will use to search for a synchronized trade signal.
    • ' Default valid triangles '.
    • ' MarketWatch Permutations ' - The expert will take all pairs shown in the marketwatch list and create all possible valid arbitrage triangles, it will then cycle through each valid pair set and search for the chosen signal. If no pairs are found in the watchlist or no valid pairs can be created, the expert will resort to a hardcoded list to create basic valid arbitrage triangle.
    • ' Custom Pair Inputs ' - When selected the expert will use the custom pair inputs shown below in the three pair slots.
  • Hedge Using. - Which pair or pairs the expert will be allowed to trade both directions simultaneously. 
  • Custom Pair Input 1. - Used when ' Custom Pair Inputs' is selected in 'Active Pair Triangle'.
  • Custom Pair Input 2.
  • Custom Pair Input 3.
  • Prefix. - If your broker uses a prefix before pair names , eg: ' mEURUSD ', type ' m ' into the prefix input.
  • Suffix. - If your broker uses a suffix after pair names , eg: ' EURUSDm ', type ' m ' into the suffix input
    CIR3
      • Max Spread. - Max spread allowed to open a trade - In pips.
      • Max Slippage. - Max slippage allowed to open a trade - used for brokers that may require a requote.
      • Pair 1 Max Lot Size Allowed. - Max lot size allowed to be reached and/or placed.
      • Pair 2 Max Lot Size Allowed. 
      • Pair 3 Max Lot Size Allowed. 
      • Pair 1 Max Buy Trades Allowed. - Max amount of buy trades allowed to be opened.
      • Pair 1 Max Sell Trades Allowed. - Max amount of sell trades allowed to be opened.
      • Pair 2 Max Buy Trades Allowed.
      • Pair 2 Max Sell Trades Allowed.
      • Pair 3 Max Buy Trades Allowed.
      • Pair 3 Max Sell Trades Allowed
        CIR4
        • Allow Hedge To Close. - True will allow the expert to close negative buy trades using positive sell trades and negative sell trades using positive buy trades.
        • Hedge Close Percent. - Percentage of profit needed to be added to the profitable trade to hedge out the other.
        CIR5
        • Alert At Grid Level. - Once the total open trade amount reaches the number in the input the EA will send an alert noification through the MT4 mobile app and ping a log message once per hour.
        • Close Trades If Equity Drops Below. - The EA will close all open trades if the accounts floating equity drops below this percent amount of the total account balance. - (Account Balance Percent) - (Active > 0.0)
        • Only Open Trades Above Free Margin. - The EA will only open new trades when the accounts floating free margin is above this percent amount of the total account balance. - (Account Balance Percent) - (Active > 0.0)

        CLR6

        • Limit Trade Hours. - True will allow trades from 'Start Hour' until 'Stop Hour' - Trades still open after hours will continue to be managed.
        • Start Hour. - Hour to allow trades from. When 'Limit Trade Hours' is set true.
        • Stop Hour. - Hour to stop trades at. When 'Limit Trade Hours' is set true.

        CIR7

        • Trade Monday.
        • Trade Tuesday.
        • Trade Wednesday.
        • Trade Thursday.
        • Trade Friday.
        • Stop Trade Before Weekend. - True will stop the expert from placing trades and close any pending orders from Friday 18:00 until 23:59.
        • Skip Monday Market Open. - True will stop the expert placing trades on market open until after 03:00 Monday morning.
        • Trade Saturday.
        • Trade Sunday.

        CIR8

        • Auto Money Management. - True will allow the EA to adjust the base lot in accordance with the account balance and the 'Auto Risk Percent' set.
        • Auto Risk Percent. - (1 == 0.01 per 100USD) - Defines the risk used in the Auto Money Management. 1 being equal to 0.01 lots per 100 in account currency.
        • Pair 1 Base Lot. - The first initial lot size that will be used. (When Auto Money Management is set false)
        • Pair 2 Base Lot.
        • Pair 3 Base Lot.
        • Stop Loss. - (Pips)
        • Take Profit. - (Pips)

        CIR9

        • Pair 1 Multiplier. (Active>1.0) - Amount to multiply the next series or previous trade by. The function will only work when set above 1.0.
        • Pair 2 Multiplier. (Active>1.0) 
        • Pair 3 Multiplier. (Active>1.0) 
        • Multiplier Mode.
          • 'Position Amount' will multiply the next placed trade by the multiplier and how many trades are currently open.
          • 'After_Loss' will multiply the next placed trade by the multiplier and a count of trades that have closed in loss.
        • After Loss Mode Reset.
          • 'Next_Profit' will reset the loss count after any sized closed profitable trade. 
          • 'Full_Recovery' will only reset the loss count when all total calculated loss has been recovered.
        • After Loss Mode Max Count To Reset. - Max loss count allowed to be reached before the loss count is reset.

        CIR9

        • PipStep Method. - Method which to space orders by.
          • 'Fixed' - The expert will use only be able to place new grid orders at the start of a 'Dynamic Step TimeFrame' candle, and only if price has moved 'IF Fixed PipStep' amount of pips from the last opened trade.
          • 'Dynamic' - The expert will use only be able to place new grid orders at the start of a 'Dynamic Step TimeFrame' candle, and only if price has moved a dynamically generated pip amount from the last opened trade.
        • Dynamic Step TimeFrame. - Timeframe used to space grid orders and also create the dynamically changing pipstep distance.
        • IF Fixed PipStep Pair 1. - Fixed pipstep distance for Pair 1.
        • IF Fixed PipStep Pair 2. 
        • IF Fixed PipStep Pair 3. 
        • Pipstep Multiplier. - Amount to multiply the pipstep distance between each trade. - (Multiplies both fixed and dynamic distances of each pair.)

        CIR10

        • Move Take Profit - When true the expert will move the take profit from the 'Take Profit'  input to the 'Move TP To' input once open trades reaches the amount input in 'Move TP After'. (Separate amounts are considers for the three pairs.)
        • Move TP After - Amount of open trades when to move the take profit to the below input.
        • Move TP To - Amount of pips in profit to move the take profit to.
        • Use Trail StopLoss. - True will allow the EA to adjust the stop loss as orders move into profit.
        • Trail Start From. - Pips into profit to start the trailing stop.
        • Move Trail Stop To. - Once activated move the stop this many pips into profit.
        • Trail Step. - Adjust the stop loss further into profit when price moves this many pips.
        CIR111

            • AutoClose Mode. -
              •  'Currency_Amount' - The EA will search for a account currency amounts worth of floating profit to use the AutoClose function. 
              •  'Account_Percent' The EA will search for a percent amount of the accounts balance of floating profit to use the AutoClose function.
              •  'After Loss Total Plus Account Percent' - The EA will search for a floating profit amount that covers the recorded loss of the 'Multipler Mode, After Loss' plus an added account percent amount to use the AutoClose function.
            • Amount/Percent To Close. - How much floating profit to activate the AutoClose function. - (What mode is selected above will determine what value this number has)
            • Adjust Amount In Accordance with Base Lot. - True will change the 'Amount/Percent To Close' according to the current base lot being used. The default example would be : 0.01 lots = 0.35 , 0.02 lots = 0.70 , 0.03 lots = 1.05 , etc.

            CIR122

            • DrawDown Reduction. - Set to true will turn on drawdown reduction. This will look to breakeven on the first placed and latest placed trade in a formed grid in an aim to reduce overall grid size and free up margin.
            • Reduce After. - Once open trades amount reaches the number in this input the EA will begin the function. - (Separate amounts used for buy and sell and each pair.)
            • Percent To Function. - The EA will take the first placed trade and monitor its floating profit, this input will get a percentage value of that number. We then need the latest placed trade to cover the negative floating of the first plus this stored percentage amount for the function to work.

            Cir15

            • Use News Filter. - When true the expert will draw vertical lines onto the chart at times where news events land, the expert will stop placing new trades the input minutes before an event and will hold off placing trades until time has passed the input minuets after the event.
            • Only Draw Future Lines. - Set true will draw only draw lines in front of the current time.
            • Filter Low News. - True will stop new trades being placed from the input minuets before a low news event until the input minuets after.
            • Filter Mild News. - True will stop new trades being placed from the input minuets before a mild news event until the input minuets after.
            • Filter High News. - True will stop new trades being placed from the input minuets before a high news event until the input minuets after.
            • Minuets To Stop Trading Before Event. - The specified minuets to stop placing new trades before an event.
            • Minuets To Stop Trading After Event. - The specified minuets to start placing new trades after an event.
            • Low Event Line. - Color used for low event lines.
            • Mild Event Line. - Color used for mild event lines.
            • High Event Line. - Color used for high event lines.
            • Market Watch TimeZone. - The GMT offset for your brokers data - (Most brokers are GMT+2)
            - ON CHART BUTTONS -

                C11

                • LAST Cycle. - Pressed will allow the EA to finish current grid cycles and when closed will not allow new trades to be placed until the button is unpressed.
                • STOP Buttons.- Pressed will stop the EA from placing anymore trades on the indicated pair untill the button is unpressed.
                • Close Buttons. - Pressed will close any open trades on the indicated pair.

                --- Circadian v4.0+ includes an on chart panel, below is some breif descriptions of the functionality. ---

                CIERw

                C15

                - The top section of the panel contains three main sections.

                - The top box indicates the trade mode being used, the current status of the expert and then the numbers relate to how many sets are available to scan and which set Circadian is currently scanning.

                - The three boxes side by side indicate which pairs are currently being focused on and the trending status of each pair. The expert is always searching for a 'Buy, sell, buy' or 'Sell, buy, sell' pattern.

                - The lowest box is the current arbitrage sum made from the combination of account balance, ask price and bid prices. For vaild Triangular Arbitrage trades to be placed, this number needs to be above the input 'Arbitrage Threshold'. The box will turn yellow when the number becomes a positive number, and green when above the set 'Arbitrage Threshold'.

                CIR543

                CIR237

                C17

                - The lowest current arbitrage sum box also doubles as a 'Last Cycle Button', pressing this will allow the EA to finish current grid cycles and when closed will not allow new trades to be placed until the button is unpressed.

                CIR890

                - Shown above is the infomation displayed on the panels main section.

                --- Holding your mouse over any text or button in your terminal will show a description.---

                - From top to bottom we have :-

                - Current time & date.

                - Current open buy trades & max allowed buy size.

                - Next buy trade size that will be opened.

                - Current open sell trades & max allowed sell size .

                - Next sell trade size that will be opened.

                - Current pipstep method & the amount being used.

                - Total open trade size & total allowed size.

                - Max spread size allowed.

                - Current spread size.

                - Free margin amount.

                - Multiplers being used.

                - Global Autoclose amount.

                - Limit hours status.

                - Dynamic step timeframe. (Which timeframe the expert will space orders using.)

                - News filter status.

                - Auto money management status

                - Expert event log.


                      3.

                      I am always happy to help with set up or if any problems emerge, please message me for assistance.

                      Some basic checks users can make before contacting me with problems are -

                      3 

                      -  At the top of the MT4 terminal please ensure the ' AutoTrading ' button is pushed in, and has a small green icon like the picture to the left. 

                      4 

                      - At the top left of the terminal go to ' Tools - Options '.

                      F1320

                      - In ' Tools - Options ', go to the ' Expert Advisors ' tab, please make sure, ' Allow automated trading ' & ' Allow WebRequest for listed URL: ', are checked.

                      - To use the news filter the following web address needs to be added to the WebRequest URL list -

                      ' https://nfs.faireconomy.media/ '

                      2

                      - When loading the expert onto a chart please make sure that in the common tab, ' Allow live trading ' is checked.

                      B4

                      - If you have a set file please go to the ' Inputs ' tab, press the ' Load ' button, then click the set file you need to load, press ' OK '.

                      5

                      - In the top right of the chart you will see a smiley face if all the steps are followed correctly and the expert will start to search for trades.

                      F41

                      - Please check if the spread of your loaded chart is below the number set in the max spread input.


                      If you have any problems please contact me using one of the links below.




                      Links -



                      Share it with friends: