From e792c7254e112c0a4aac4fd71a9f1b3b38201ae3 Mon Sep 17 00:00:00 2001 From: "Documenter.jl" Date: Sat, 28 Dec 2024 10:23:15 +0000 Subject: [PATCH] build based on af41887 --- dev/.documenter-siteinfo.json | 2 +- dev/index.html | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index abb8f3c..05ab6e7 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.11.2","generation_timestamp":"2024-12-27T12:03:30","documenter_version":"1.8.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.11.2","generation_timestamp":"2024-12-28T10:23:11","documenter_version":"1.8.0"}} \ No newline at end of file diff --git a/dev/index.html b/dev/index.html index 7f112bd..02372c1 100644 --- a/dev/index.html +++ b/dev/index.html @@ -1,19 +1,19 @@ -Home · TradingPipeline.jl

TradingPipeline

Documentation for TradingPipeline.

TradingPipeline.AbstractExchangeResponseType

An AbstractExchangeResponse represents a message that was received from an ExchangeFillSubject. The most common is ExchangeFill which lets the StrategySubject know that after putting out an intent to open or close a position, the exchange has filled the order and the requested position change has occurred.

Example

julia> subtypes(TradingPipeline.AbstractExchangeResponse)
source
TechnicalIndicatorCharts.visualizeMethod
visualize(
+Home · TradingPipeline.jl

TradingPipeline

Documentation for TradingPipeline.

TradingPipeline.AbstractExchangeResponseType

An AbstractExchangeResponse represents a message that was received from an ExchangeFillSubject. The most common is ExchangeFill which lets the StrategySubject know that after putting out an intent to open or close a position, the exchange has filled the order and the requested position change has occurred.

Example

julia> subtypes(TradingPipeline.AbstractExchangeResponse)
source
TechnicalIndicatorCharts.visualizeMethod
visualize(
     t::Tuple{TechnicalIndicatorCharts.Chart, ExchangeOperations.AbstractSession};
     kwargs...
 ) -> LightweightCharts.LWCLayout
-

Let's see if I can visualize trades on top of a chart.

source
TradingPipeline.aroundMethod
around(
     ts::Dates.DateTime,
     df::DataFrames.AbstractDataFrame;
     before,
     after,
     ts_field
 ) -> Any
-

Return a few rows before and after the given timestamp ts in the DataFrame df.

source
TradingPipeline.decideMethod
decide(strategy::AbstractStrategy, state::HSM.AbstractHsmState)
--> Union{Nothing, TradeDecision.T}

The decide method takes the current strategy and the current state according to the state machine, and looks at the market data available to it to make a decision. Often, it decides to return nothing, but if conditions as defined by the strategy are met, it could return an HSM.AbstractHsmEvent which will cause the state machine to move to the next appropriate state.

There are decide methods for every state in the state machine.

source
TradingPipeline.qtyMethod
qty(c::Contracts, price::Number)

Convert contracts into the equivalent quantity of the asset being traded.

source
TradingPipeline.reportMethod

report(session::XO.SimulatorSession) -> DataFrame

Return a list of trades that happened during the simulator session.

source
TradingPipeline.decideMethod
decide(strategy::AbstractStrategy, state::HSM.AbstractHsmState)
+-> Union{Nothing, TradeDecision.T}

The decide method takes the current strategy and the current state according to the state machine, and looks at the market data available to it to make a decision. Often, it decides to return nothing, but if conditions as defined by the strategy are met, it could return an HSM.AbstractHsmEvent which will cause the state machine to move to the next appropriate state.

There are decide methods for every state in the state machine.

source
TradingPipeline.qtyMethod
qty(c::Contracts, price::Number)

Convert contracts into the equivalent quantity of the asset being traded.

source
TradingPipeline.reportMethod

report(session::XO.SimulatorSession) -> DataFrame

Return a list of trades that happened during the simulator session.

source
TradingPipeline.simulateMethod
simulate(
     candle_observable,
     strategy_type::Type{<:TradingPipeline.AbstractStrategy};
     kwargs...
@@ -21,4 +21,4 @@
 

Run a strategy on the simulator using the given candle_observable.

Return Values

A named tuple with the following keys will be returned: simulator_session, hsm, simultator_exchange_driver_subject, fill_observable, chart_subject, strategy_subject, simulator_session_actor.

Example

julia> candle_observable = df_candles_observable(btcusd1m)
 IterableObservable(Candle, Vector{Candle}, Rocket.AsapScheduler)
 
-julia> @unpack simulator_session, chart_subject = simulate(candle_observable, HMAStrategy);
source
TradingPipeline.@hsmMacro
@hsm strategy_subject

Given a StrategySubject instance, define the states and transitions for a MarketOrderStrategyStateMachine, and return the singleton instance of that state machine.

source
TradingPipeline.@pnlMacro
@pnl entry exit quantity leverage

Calculate the profit/loss of a long positon. The quantity and leverage are optional.

source
TradingPipeline.@pnlsMacro
@pnls entry exit quantity leverage

Calculate the profit/loss of a short positon. The quantity and leverage are optional.

source
+julia> @unpack simulator_session, chart_subject = simulate(candle_observable, HMAStrategy);
source
TradingPipeline.@hsmMacro
@hsm strategy_subject

Given a StrategySubject instance, define the states and transitions for a MarketOrderStrategyStateMachine, and return the singleton instance of that state machine.

source
TradingPipeline.@pnlMacro
@pnl entry exit quantity leverage

Calculate the profit/loss of a long positon. The quantity and leverage are optional.

source
TradingPipeline.@pnlsMacro
@pnls entry exit quantity leverage

Calculate the profit/loss of a short positon. The quantity and leverage are optional.

source