Strategy Analyzer

Don't go to farm with a blunt knife? Let's sharpen it!

Why Analyze Load Strategy Result Slip Chart Documentation

BENEFITS OF BACK TESTINGS

  • Provides insight into expected returns, draw downs, and overall risk exposure.
  • Helps assess the profitability and effectiveness of a strategy before using real money.
  • Identifies potential risks and weaknesses in a strategy.
  • Helps adjust risk parameters to avoid large losses.
  • Provides assurance that a strategy has worked in past market conditions.
  • Ensures strategies work before deploying them in live trading.
  • Saves money & time by testing strategies without risking real capital.

FEATURES OF OLANZAR STRATEGY ANALYZER

Supports varieties of pairs
Multiple timeframes available
80% accurate stimulation
Cloud based back tester
Background processing capability
Load your strategy in one click
Instant notification on completion
Download results in CSV or PDF
Interactive Strategy Chart
No new programming language needed
Natively supports PHP & PYTHON
Reliable financial data

Load Strategy

Strategyname
Batchlimit
Candlelimit
Pair
Time Frame
Start From
Stop On
Capital
Runmode
Leverage

Strategy
X
Check Status Refresh ResultTerminate

Click on the refresh result button above to get currently analyzed result.

No slip found here.

Graphics analytics and performance of your strategy will be implemented soon

Documentation

Using our strategy analyzing or back testing service is simplified, and very straight forward. and as such the documentation will be concise and simplified as well. A quick note of what you need to know about our analyzing service.

Things to know

  • Is a cloud based service and it also runs in the background
  • You don't necessarily have to watch your screen waiting for it to complete, jusst load the script and go about your normal business, you will be notified once the analysis is completed
  • You can always come back to the result page to check progress of your script and then either wait for it to complete or stop the process to get already analyzed results
  • Completion time depends on logic, computation and conditions set in your strategy script, and also how many months of data that you are analysis, that is your start to end time
  • Most script and analyses can complete within 1minute - 30days depending on factors listed above

Getting Started

There are global variables and contants that are predefined for you and you have make use of them and avoid naming or defining constants using any of them as that will make your script not to run or may overide some values

COMMON SYSTEM VARIABLES


NAMEUSES
$CANDLESThis is an array of candles to the limit you set in your loading section, it has OHLCV (open,high,low,close,volume) and it is in decending order according to opentime
$REVERSEDCANDLESThis is an array of candles of the $CANDLES variable but it is in ascending order of open time
$SIGNAL$SIGNAL variable must be array and have these parameters mode,entry,tp,sl. when your condition is met you can overide this variable with your values but must contain the required parameters
$CANCELjust incase an order is open and you have counter trade you can use this
$MASTERKEYAvoid using this variable in your script
$MASTERROWAvoid using this variable in your script
$BATCHLASTOPENTIMEAvoid using this variable in your script
$OPENTIMEAvoid using this variable in your script atleast not in all capital letters
$CLOSETIMEAvoid using this variable in your script atleast not in all capital letters
$LASTPRICETIMEAvoid using this variable in your script
$PRICEDATAAvoid using this variable in your script
LASTPRICEARRAYAvoid using this variable in your script

COMMON SYSTEM CONSTANT


NAMEUSES
DATADon't use this constant anywhere in your script
PREVDATADon't use this constant anywhere in your script
BATCHLIMITDon't use this constant anywhere in your script
CANDLELIMITDon't use this constant anywhere in your script
PAIRDon't use this constant anywhere in your script
TIMEFRAMEDon't use this constant anywhere in your script
LASTOPENTIMEDon't use this constant anywhere in your script
LASTBATCHNODon't use this constant anywhere in your script
RUNMODEDon't use this constant anywhere in your script
CAPITALDon't use this constant anywhere in your script
BALANCEDon't use this constant anywhere in your script
LEVERAGEDon't use this constant anywhere in your script
STATUSDon't use this constant anywhere in your script
ENDTIMEDon't use this constant anywhere in your script
PRICERESUMEDon't use this constant anywhere in your script
TIMECHECKDon't use this constant anywhere in your script
TIMECHECKEXPIREDon't use this constant anywhere in your script

USING IN-BUILT FUNCTIONS


You can use any of the php trader extension lib such as trader_ema, trader_macd , trader_rsi or any of the native trader functions.

You can also use python trader library inbuilt functions on your script such as TA-LIB, PANDAS_TA or backtrader

CREATING CUSTOM FUNCTIONS


You can create custom functions using the below method:


	$mycustomCheck = function($price, $volume) {
		
		return $price * $volume;
	};
	


Then use the function like this:

	$vwapcheck = $mycustomCheck($price, $volume);
	

USING THE $SIGNAL VARIABLE


This variable is a must to be used in any of your conditions either buy or sell, as the is the only variable our server recognize:


	// Buy condition example
	if ($price < $lowerBand && $stochK < 20) {
		
		$SIGNAL = array(
		'mode' => 'BUY',
		'entry' => $price,
		'tp' => $price + ($price * $takeProfit),
		'sl' => $price - ($price * $stopLoss),
		);
	}
	


	// Sell condition example
	if ($price > $highBand && $stochK > 80) {
		
		$SIGNAL = array(
		'mode' => 'SELL',
		'entry' => $price,
		'tp' => $price - ($price * $takeProfit),
		'sl' => $price + ($price * $stopLoss),
		);
	}
	

PHP CODE SAMPLE



	/*
	### Scalping Strategy Using PHP Trader
	This strategy will:
	1. Buy when the ema50 crosses above ema100.
	2. Sell when the ema50 crosses below ema100.
	*/


	// Declare start datas 
	$count = count($REVERSEDCANDLES);
	$ema50Data_start = $count - 50; // even though the setting is 14 it requires data like plus 14 or more
	$ema100Data_start = $count - 100;

	// Declare sliced datas 
	$close = [];
	$high = [];
	$low = [];
	$volume = [];

	$ema50Data = [];
	$ema100Data = [];

	//Fill the array columns with real values
	foreach($REVERSEDCANDLES as $key => $row){
		
		$closeValue = (!empty($row['close'])) ? $row['close'] : 0;
		$highValue = (!empty($row['high'])) ? $row['high'] : 0;
		$lowValue = (!empty($row['low'])) ? $row['low'] : 0;
		$volumeValue = (!empty($row['volume'])) ? $row['volume'] : 0;
		
		$close[] = $closeValue; 
		$high[] = $highValue; 
		$low[] = $lowValue; 
		$volume[] = $volumeValue;
		
		// Create data for each data that needs slicing
		if($key >= $ema50Data_start){
			$ema50Data[$key] = $closeValue;
		}
		if($key >= $ema100Data_start){
			$ema100Data[$key] = $closeValue;
		}

	}

	// Calculate Indicators
	$ema50 = trader_ema($ema50Data, 50);
	$ema100 = trader_ema($ema100Data, 100);

	// Get last EMA values
	$lastEma50 = end($ema50);
	$lastEma100 = end($ema100);
	$prevEma50 = prev($ema50);
	$prevEma100 = prev($ema100);

	// Trading parameters
	$takeProfit = 1.5 / 100; 
	$stopLoss = 0.50 / 100;


	// BUY CONDITION
	if ($prevEma50 < $prevEma100 && $lastEma50 > $lastEma100) {
		
		$SIGNAL = array(
		'mode' => 'BUY',
		'entry' => $price,
		'tp' => $price + ($price * $takeProfit),
		'sl' => $price - ($price * $stopLoss),
		);
	}

	// SELL CONDITION
	if ($prevEma50 > $prevEma100 && $lastEma50 < $lastEma100) {
		$SIGNAL = array(
		'mode' => 'SELL',
		'entry' => $price,
		'tp' => $price - ($price * $takeProfit),
		'sl' => $price + ($price * $stopLoss),
		);
	} 
	

PYTHON CODE SAMPLE



	# Convert to DataFrame
	df = pd.DataFrame(REVERSEDCANDLES)

	# Ensure close prices are present
	df["close"] = df["close"].fillna(0)

	# Calculate EMA indicators
	df["ema50"] = ta.trend.ema_indicator(df["close"], window=50)
	df["ema100"] = ta.trend.ema_indicator(df["close"], window=100)

	# Get last and previous EMA values
	lastEma50 = df["ema50"].iloc[-1]
	lastEma100 = df["ema100"].iloc[-1]
	prevEma50 = df["ema50"].iloc[-2]
	prevEma100 = df["ema100"].iloc[-2]

	# Trading parameters
	takeProfit = 1.5 / 100
	stopLoss = 0.50 / 100

	# Example price (replace with actual price)
	price = df["close"].iloc[-1]

	# BUY CONDITION
	if prevEma50 < prevEma100 and lastEma50 > lastEma100:
		SIGNAL = {
			"mode": "BUY",
			"entry": price,
			"tp": price + (price * takeProfit),
			"sl": price - (price * stopLoss),
		}

	# SELL CONDITION
	if prevEma50 > prevEma100 and lastEma50 < lastEma100:
	SIGNAL = {
		"mode": "SELL",
		"entry": price,
		"tp": price - (price * takeProfit),
		"sl": price + (price * stopLoss),
	}
	
257HN9wI9bouR173