X&0 – The Ultimate Scalper Documentation
1. Read the setup from WorkSetup and UseResetTime, ResetTimeSetup
2. Set the current mode of work in relation to all this.
3. Set the first reference price, the average between Bid and Ask.
4. If ReadFirstNBars! = 0 and if IncludeFirstBars! = 0 then look starting from the current bar, otherwise, start counting the N bars of the anterior bar backwards.
5. If all these bars are on the same direction, then the original direction is considered confirmed.
6. If considered confirmed, then send the order to BUY or SELL in accordance with that direction and virtual status.
7. Either way, read the current time on the M bar at the initialization and update the x and 0 chart.
8. If the current direction is zero (“-“)
Set the boxes meter, BoxCount to 0 (it is -1 by default)
Set the type of boxes reversal to current direction (“-“).
1. It reads the current virtual order status.
2. If there is one, it checks if somehow it should have been closed (if current Bid or Ask is beyond the virtual SL/TP).
3. If it should have been closed, it closes the current order.
4. It sets the flag of action/ action flag (ShouldUpdate), as the RealTime flag (true or false).
5. It reads the time of the current bar on M1.
6. If the current time is different from the former current time retained, then we have a new bar M1 and it activates the update flag. For action it sets the current working mode. If the action flag is activated, it calculates the current central point, as the average distance between Bid and Ask and the distance in pips between this and the former reference price.
7. If the distance in pips is bigger or equal (>=) than BoxSize, it sets the direction as Buy and the new reference to current central point
If the distance in pips is <=- BoxSize, it sets the direction as Sell and the new reference to current central point. In either of these two cases,
a. It adds the current direction to the sequence of events
b. It takes the new reference price as the current reference price
c. It calculates how many boxes are identical to the last, hence SameCount7
8. If BoxCount is -1 (ie the first direction of the initialization was non-zero), then:
a. It sends an order on the established current direction
b. It sets the BoxCount at 0
c. It sets the type of reversal boxes to current direction
9. Otherwise, if BoxCount has any value other than -1
a. If SameCount is 1 (ie if the last event is singular), then it writes that is reversal and it closes the current trade
b. If SameCount >= ReversallsConfirmedBy, then it writes that the reversal is confirmed by previous boxes and remembers that it traded.
Otherwise, it writes that reversal is not confirmed.
c. If SameCount is 1 and there is a previous reversal, then if it didn’t trade in the previous step, It calculates how many boxes were identical before the current event (SameBefore). If SameBefore >= ReversalAutoconfirmationByOpposites, then it writes that the reversal is autoconfirmed by the previous opposites and it sends an order.
Otherwise it writes that the reversal is not autoconfirmed.
d. If SameCount is 1 (ie always for a reversal)
It takes the last reversal box as previous reversal box
It sets the previous reversal box to current one and increments BoxCount
1. Consists of creating a virtual order on the indicated direction, and a real market order on the indicated direction if it works on normal, or on reverse direction, if it’s “reversed”
2. It sends the order to market if CheckMaximumSpread is false, and if it’s True, it checks the current spread to be under MaximumSpread and only ini this case it sends to market
3. If the order is refused due to the spread:
• The event is recorded in external log, from files folder, “X0 Trader- RefusedOrders- time”, where time is the local time when the wizard was started; the listed times for refused orders are in server time
• It does absolutely nothing, if the wizard is in “stop” mode
1. It deletes the virtual order for the current operating mode, direct or reversed.
2. It does everything possible to close the existing real order.
1. Of trading:
LotSize, Slippage, stopLoss
ReadFirstNBars – how many bars to read for setting the initial direction
IncludeFirstBar – if the first bar is inckuded or not in the first N
RealTime – if, instead of happening at tick (true), the action occurs al minute (false)
BoxSize – the size of a box in pips. A pip is the smallest change possible (so is dependent on number of decimals)
ReversalIsConfirmedBy – how many boxes of the same type confirm a reversal
ReversalAutoconfirmationByOpposites – how many opposite boxes confirm a reversal
2. Of display:
X0BarsVisible – how many X and 0 bars are visible
EnableComments – if the log displays the comments
IncludeEventsInComments – introduces also the sequence of events in the comments
3. Of verification/ check:
UseResetTime – if it use the concept of reset
ResetTimeSetup – string with the hour and minute of the reset in format “hh:mm”
CheckMaximumSpread ->if it checks the maximum spread
MaximumSpread – what is the maximum spread
WorkSetup – setup sequence of states
The sequence is made of one or more atoms
If there Is more than one atom, you use ; between them
The syntax of an atom is: hh:mm-hh:mm[,state]
state – can be on, off, stopped, reversed
stopped – and off are the same thing, completely stopped
on – is normal on direct
reversed – on reverse
If you don’t set the parameter state, it presumes it’s reversed
In addition, there is the special atom default[,state] – defining everything he does for the rest of the time unspecified by the string